Added a test to ensure that Gson handles repeated invocation of itself correctly.
Revised proto maven configuration to use Gson 1.6
This commit is contained in:
parent
371befafa3
commit
279649986e
@ -81,4 +81,12 @@ public class EscapingTest extends TestCase {
|
|||||||
assertEquals(target, noEscapeHtmlGson.fromJson(escapedJsonForm, BagOfPrimitives.class));
|
assertEquals(target, noEscapeHtmlGson.fromJson(escapedJsonForm, BagOfPrimitives.class));
|
||||||
assertEquals(target, escapeHtmlGson.fromJson(nonEscapedJsonForm, BagOfPrimitives.class));
|
assertEquals(target, escapeHtmlGson.fromJson(nonEscapedJsonForm, BagOfPrimitives.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testGsonDoubleDeserialization() {
|
||||||
|
BagOfPrimitives expected = new BagOfPrimitives(3L, 4, true, "value1");
|
||||||
|
String json = gson.toJson(gson.toJson(expected));
|
||||||
|
String value = gson.fromJson(json, String.class);
|
||||||
|
BagOfPrimitives actual = gson.fromJson(value, BagOfPrimitives.class);
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.6</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user