Skip to content

Commit e49d78c

Browse files
committed
Move new failing to under 'failing', since it can't be fixed right away
1 parent df0be55 commit e49d78c

File tree

3 files changed

+56
-35
lines changed

3 files changed

+56
-35
lines changed

jr-objects/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ com.fasterxml.jackson.core.type,
8484
</replacements>
8585
</configuration>
8686
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-surefire-plugin</artifactId>
90+
<configuration>
91+
<redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
92+
<excludes>
93+
<exclude>**/failing/*.java</exclude>
94+
</excludes>
95+
</configuration>
96+
</plugin>
8797
</plugins>
8898
</build>
8999

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.fasterxml.jackson.jr.failing;
2+
3+
import java.util.*;
4+
5+
import com.fasterxml.jackson.jr.ob.JSON;
6+
import com.fasterxml.jackson.jr.ob.TestBase;
7+
8+
public class ReadEnumMapTest extends TestBase
9+
{
10+
enum DEF { D, E, F; }
11+
12+
static class WithEnumMap {
13+
private Map<DEF, String> values;
14+
15+
WithEnumMap() { }
16+
public WithEnumMap(DEF key, String value) {
17+
values = new LinkedHashMap<DEF,String>();
18+
values.put(key, value);
19+
}
20+
21+
public Map<DEF, String> getValues() { return values; }
22+
public void setValues(Map<DEF, String> v) { values = v; }
23+
}
24+
25+
// [issue#21]
26+
public void testMapWithEnumKey() throws Exception
27+
{
28+
WithEnumMap input = new WithEnumMap(DEF.E, "bar");
29+
// verify serialization, should be ok:
30+
String json = JSON.std.asString(input);
31+
assertEquals(aposToQuotes("{'values':{'E':'bar'}}"), json);
32+
33+
// and then get it back too
34+
WithEnumMap result = JSON.std.beanFrom(WithEnumMap.class, json);
35+
assertNotNull(result);
36+
Map<DEF, String> map = result.getValues();
37+
assertNotNull(map);
38+
assertEquals(1, map.size());
39+
Map.Entry<?,?> entry = map.entrySet().iterator().next();
40+
assertEquals("bar", entry.getValue());
41+
if (!(entry.getKey() instanceof DEF)) {
42+
fail("Expected key to be of type ABC, is: "+entry.getKey().getClass().getName());
43+
}
44+
assertEquals(DEF.E, entry.getKey());
45+
}
46+
}

jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadSimpleTest.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@ public class ReadSimpleTest extends TestBase
99
{
1010
enum ABC { A, B, C; }
1111

12-
static class WithEnumMap {
13-
private Map<ABC, String> values;
14-
15-
WithEnumMap() { }
16-
public WithEnumMap(ABC key, String value) {
17-
values = new LinkedHashMap<ABC,String>();
18-
values.put(key, value);
19-
}
20-
21-
public Map<ABC, String> getValues() { return values; }
22-
public void setValues(Map<ABC, String> v) { values = v; }
23-
}
24-
2512
public void testSimpleList() throws Exception
2613
{
2714
final String INPUT = "[1,2,3]";
@@ -88,26 +75,4 @@ public void testSimpleEnums() throws Exception
8875
abc = JSON.std.beanFrom(ABC.class, quote("C"));
8976
assertEquals(ABC.C, abc);
9077
}
91-
92-
// [issue#21]
93-
public void testMapWithEnumKey() throws Exception
94-
{
95-
WithEnumMap input = new WithEnumMap(ABC.B, "bar");
96-
// verify serialization, should be ok:
97-
String json = JSON.std.asString(input);
98-
assertEquals(aposToQuotes("{'values':{'B':'bar'}}"), json);
99-
100-
// and then get it back too
101-
WithEnumMap result = JSON.std.beanFrom(WithEnumMap.class, json);
102-
assertNotNull(result);
103-
Map<ABC, String> map = result.getValues();
104-
assertNotNull(map);
105-
assertEquals(1, map.size());
106-
Map.Entry<?,?> entry = map.entrySet().iterator().next();
107-
assertEquals("bar", entry.getValue());
108-
if (!(entry.getKey() instanceof ABC)) {
109-
fail("Expected key to be of type ABC, is: "+entry.getKey().getClass().getName());
110-
}
111-
assertEquals(ABC.B, entry.getKey());
112-
}
11378
}

0 commit comments

Comments
 (0)