|
11 | 11 | import com.fasterxml.jackson.databind.ObjectMapper; |
12 | 12 |
|
13 | 13 | import org.junit.Before; |
| 14 | +import org.junit.Ignore; |
14 | 15 | import org.junit.Test; |
15 | 16 |
|
16 | 17 | import tec.uom.se.unit.Units; |
@@ -96,17 +97,21 @@ public void testParseLength() throws Exception { |
96 | 97 | Unit<?> parsedUnit = parse("\"m\"", Unit.class); |
97 | 98 | assertEquals("The Unit<Length> in the parsed JSON doesn't match", |
98 | 99 | Units.METRE, parsedUnit); |
99 | | - |
100 | | -// parsedUnit = parse("\"km\"", Unit.class); TODO solve km formatting |
101 | | -// assertEquals("The Unit<Length> in the parsed JSON doesn't match", |
102 | | -// KILO(Units.METRE), parsedUnit); |
103 | 100 | } |
104 | 101 |
|
105 | 102 | @Test(expected = JsonParseException.class) |
106 | 103 | public void testParseWithUnrecognizedField() throws Exception { |
107 | 104 | parse("foobar", Unit.class); |
108 | 105 | } |
109 | | - |
| 106 | + |
| 107 | + @Test |
| 108 | + @Ignore |
| 109 | + public void testParseLengthKm() throws Exception { |
| 110 | + Unit<?> parsedUnit = parse("\"km\"", Unit.class); //TODO solve km formatting |
| 111 | + assertEquals("The Unit<Length> in the parsed JSON doesn't match", |
| 112 | + KILO(Units.METRE), parsedUnit); |
| 113 | + } |
| 114 | + |
110 | 115 | protected String serialize(Object objectToSerialize) throws IOException { |
111 | 116 | final Writer writer = new StringWriter(); |
112 | 117 | final JsonGenerator generator = this.jsonFactory.createJsonGenerator(writer); |
|
0 commit comments