| 29 | |
| 30 | |
| 31 | public class TimestampBadTest |
| 32 | extends IonTestCase |
| 33 | { |
| 34 | @Inject("testFile") |
| 35 | public static final File[] FILES = |
| 36 | testdataFiles(GLOBAL_SKIP_LIST, BAD_TIMESTAMP_IONTESTS_FILES); |
| 37 | |
| 38 | private File myTestFile; |
| 39 | |
| 40 | public void setTestFile(File file) |
| 41 | { |
| 42 | myTestFile = file; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | @Test |
| 47 | public void testValueOf() |
| 48 | throws IOException |
| 49 | { |
| 50 | String tsText; |
| 51 | try |
| 52 | { |
| 53 | tsText = _Private_Utils.utf8FileToString(myTestFile); |
| 54 | } |
| 55 | catch (IonException e) |
| 56 | { |
| 57 | // Bad UTF-8 data, just ignore the file |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | tsText = new BufferedReader(new StringReader(tsText)).readLine(); |
| 62 | tsText = tsText.trim(); // Trim newlines and whitespace |
| 63 | |
| 64 | // TODO some bad files have comments in them |
| 65 | |
| 66 | try |
| 67 | { |
| 68 | Timestamp.valueOf(tsText); |
| 69 | fail("Expected exception"); |
| 70 | } |
| 71 | catch (IllegalArgumentException e) { } |
| 72 | } |
| 73 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…