-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4b80c5
commit dbcfff6
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
ion/src/test/java/com/fasterxml/jackson/dataformat/ion/failing/UncaughtException303Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.fasterxml.jackson.dataformat.ion.failing; | ||
|
||
import java.net.URL; | ||
|
||
import org.junit.Test; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.dataformat.ion.IonObjectMapper; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class UncaughtException303Test | ||
{ | ||
private final IonObjectMapper MAPPER = IonObjectMapper.builder().build(); | ||
|
||
// [dataformats-binary#303] | ||
@Test | ||
public void testUncaughtException303() throws Exception | ||
{ | ||
URL poc = getClass().getResource("/data/issue-303.ion"); | ||
try { | ||
MAPPER.readTree(poc); | ||
fail("Should not pass with invalid content"); | ||
} catch (JsonProcessingException e) { | ||
// !!! TODO: change to match what we actually expect | ||
verifyException(e, "MATCH MESSAGE"); | ||
} | ||
} | ||
|
||
void verifyException(Throwable e, String match) | ||
{ | ||
String msg = e.getMessage(); | ||
String lmsg = (msg == null) ? "" : msg.toLowerCase(); | ||
if (lmsg.indexOf(match.toLowerCase()) < 0) { | ||
fail("Expected an exception with a substrings ("+match+"): got one with message \""+msg+"\""); | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
ion/src/test/java/com/fasterxml/jackson/dataformat/ion/misc/UncaughtExceptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.