Fails a value that fits no built-in conversion
All 7 scenarios hold
Five things raise a parse-time failure. They are a number outside the target's range, a malformed date or character, text that is no spelling of a boolean, an address whose scheme the target type cannot handle, and a type with no available converter.
Two of them are worth knowing, because the plain Java call they resemble does not fail. Reading yes as a boolean gives false in plain Java, and a failure here. The URL row rejects a urn: address, and Files and addresses shows the same address converting to a URI.
Each message closes by naming the classes searched for a type converter. Those depend on where the test lives, so the table leaves them out.
expected outcome
broken scenario
| Scenario | Input value | Parameter type | Error message? |
|---|---|---|---|
| Decimal for a whole-number type | 0.1 | java.lang.Byte | Built-in conversion of value "0.1" to type java.lang.Byte failed. Are you missing a type converter for this conversion? |
| Whole number outside the range | 128 | java.lang.Byte | Built-in conversion of value "128" to type java.lang.Byte failed. Are you missing a type converter for this conversion? |
| More than a single character | abc | java.lang.Character | Built-in conversion of value "abc" to type java.lang.Character failed. Are you missing a type converter for this conversion? |
| A word that is not true or false | yes | boolean | Built-in conversion of value "yes" to type boolean failed. Are you missing a type converter for this conversion? |
| Malformed date | invalid | java.time.LocalDate | Built-in conversion of value "invalid" to type java.time.LocalDate failed. Are you missing a type converter for this conversion? |
| Scheme with no protocol handler | urn:isbn:0451450523 | java.net.URL | Built-in conversion of value "urn:isbn:0451450523" to type java.net.URL failed. Are you missing a type converter for this conversion? |
| Type with no built-in conversion | 52 | org.tabletest.junit.javadomain.Ages | Built-in conversion of value "52" to type org.tabletest.junit.javadomain.Ages failed. Are you missing a type converter for this conversion? |