Skip to content

Commit 6ac19f6

Browse files
committed
instant deserialization ofr 1e-100000 test
1 parent cab47f5 commit 6ac19f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java

+17
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,25 @@ public void testDeserializationWithTypeInfoAndStringTooLarge02() throws Exceptio
429429
m.readValue(
430430
"[\"" + Instant.class.getName() + "\","+customInstant+"]", Temporal.class
431431
);
432+
System.out.println("test");
432433
}
433434

435+
/**
436+
* This test can potentially hang the VM, so exit if it doesn't finish
437+
* within a few seconds.
438+
*
439+
* @throws Exception
440+
*/
441+
@Test(timeout=13000, expected = JsonParseException.class)
442+
public void testDeserializationWithTypeInfoAndStringTooFractional01() throws Exception
443+
{
444+
String customInstant = "1e-100000000000";
445+
ObjectMapper m = newMapper()
446+
.addMixIn(Temporal.class, MockObjectConfiguration.class);
447+
m.readValue(
448+
"[\"" + Instant.class.getName() + "\","+customInstant+"]", Temporal.class
449+
);
450+
}
434451

435452
@Test
436453
public void testCustomPatternWithAnnotations01() throws Exception

0 commit comments

Comments
 (0)