MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / TimestampBadTest

Class TimestampBadTest

src/test/java/com/amazon/ion/TimestampBadTest.java:31–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31public 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}

Callers

nothing calls this directly

Calls 1

testdataFilesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…