-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test refactoring, add reproduction of #123
- Loading branch information
1 parent
1a9600d
commit cb30196
Showing
4 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...taformat/yaml/failing/ObjectId63Test.java → ...ckson/dataformat/yaml/ObjectId63Test.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
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
39 changes: 39 additions & 0 deletions
39
yaml/src/test/java/com/fasterxml/jackson/dataformat/yaml/failing/ObjectId123Test.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,39 @@ | ||
package com.fasterxml.jackson.dataformat.yaml.failing; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.*; | ||
|
||
//for [dataformats-text#123], problem with YAML, Object Ids | ||
public class ObjectId123Test extends ModuleTestBase | ||
{ | ||
private final ObjectMapper MAPPER = newObjectMapper(); | ||
|
||
public void testObjectIdUsingNative() throws Exception | ||
{ | ||
final String YAML_CONTENT = | ||
"foo: &foo1\n" + | ||
" value: bar\n" + | ||
"boo: *foo1\n"; | ||
ScratchModel result = MAPPER.readValue(YAML_CONTENT, ScratchModel.class); | ||
assertNotNull(result); | ||
assertNotNull(result.foo); | ||
assertNotNull(result. boo); | ||
assertSame(result.foo, result.boo); | ||
} | ||
|
||
static class ScratchModel { | ||
public StringHolder foo; | ||
public StringHolder boo; | ||
} | ||
|
||
@JsonIdentityInfo(generator = ObjectIdGenerators.None.class) | ||
static class StringHolder { | ||
public String value; | ||
|
||
@Override | ||
public String toString() { | ||
return value; | ||
} | ||
} | ||
} |
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