Names the file when a resource cannot be read
All 3 scenarios hold
A table can live in a classpath resource file instead of the annotation: @TableTest(resource = "external.table", encoding = "UTF-8").
The first three rules below call the loading API with those same arguments. Their tables can therefore show which paths resolve, what text the file's bytes become, and how loading fails.
The rules after them are driven by the very files shown. Each row comes from a line of the file rather than from the annotation.
Loading fails in two ways. The table shows the first way twice, because the search has two halves. A path can resolve to nothing at the classpath root, or inside a folder on it. The second way is a file that resolves while the declared encoding cannot decode it.
Every failure raises the same exception type. The message tells the two ways apart, and each message names the file the rule could not read.
| Scenario | Resource path | Encoding | Throws? | Error message? |
|---|---|---|---|---|
| No such file anywhere | no_such.table | UTF-8 | org.tabletest.junit.TableTestException | External table file no_such.table not found, searched the classpath relative to org.tabletest.junit.features.JavaExternalTableTest and from the root |
| Subfolder file misspelt | subfolder/x | UTF-8 | org.tabletest.junit.TableTestException | External table file subfolder/x not found, searched the classpath relative to org.tabletest.junit.features.JavaExternalTableTest and from the root |
| Encoding does not exist | external.table | Latin-42 | org.tabletest.junit.TableTestException | Failed to read table from external file external.table using encoding Latin-42 |