-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
810128e
commit 765e2fe
Showing
4 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
38 changes: 38 additions & 0 deletions
38
src/test/java/com/fasterxml/jackson/databind/exc/JacksonExceptionSerializationTest.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.databind.exc; | ||
|
||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.core.JacksonException; | ||
|
||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class JacksonExceptionSerializationTest extends BaseMapTest | ||
{ | ||
/* | ||
/********************************************************************** | ||
/* Test methods | ||
/********************************************************************** | ||
*/ | ||
|
||
private final ObjectMapper MAPPER = newJsonMapper(); | ||
|
||
// [databind#3244]: StackOverflow for basic JsonProcessingException? | ||
public void testIssue3244() throws Exception { | ||
JacksonException e = null; | ||
try { | ||
MAPPER.readValue("{ foo ", Map.class); | ||
fail("Should not pass"); | ||
} catch (JacksonException e0) { | ||
e = e0; | ||
} | ||
String json = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(e); | ||
//System.err.println("JSON: "+json); | ||
|
||
// Could try proper validation, but for now just ensure we won't crash | ||
assertNotNull(json); | ||
JsonNode n = MAPPER.readTree(json); | ||
assertTrue(n.isObject()); | ||
} | ||
} |