-
-
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
b7edca6
commit 2657ff3
Showing
3 changed files
with
38 additions
and
3 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
36 changes: 36 additions & 0 deletions
36
src/test/java/com/fasterxml/jackson/failing/TestLocalType609.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,36 @@ | ||
package com.fasterxml.jackson.failing; | ||
|
||
import com.fasterxml.jackson.databind.*; | ||
|
||
/** | ||
* Failing test related to [databind#609] | ||
*/ | ||
public class TestLocalType609 extends BaseMapTest | ||
{ | ||
static class EntityContainer { | ||
RuleForm entity; | ||
|
||
@SuppressWarnings("unchecked") | ||
public <T extends RuleForm> T getEntity() { return (T) entity; } | ||
public <T extends RuleForm> void setEntity(T e) { entity = e; } | ||
} | ||
|
||
static class RuleForm { | ||
public int value; | ||
|
||
public RuleForm() { } | ||
public RuleForm(int v) { value = v; } | ||
} | ||
|
||
public void testLocalPartialType609() throws Exception { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
|
||
EntityContainer input = new EntityContainer(); | ||
input.entity = new RuleForm(12); | ||
String json = mapper.writeValueAsString(input); | ||
|
||
EntityContainer output = mapper.readValue(json, EntityContainer.class); | ||
assertEquals(12, output.getEntity().value); | ||
} | ||
} | ||
|