Title: [2115] trunk/xstream/src/test/com/thoughtworks/xstream/io/json/JettisonMappedXmlDriverTest.java: Add test with max long value for Jettison (XSTR-540).
Revision
2115
Author
joehni
Date
2013-09-17 12:52:23 -0500 (Tue, 17 Sep 2013)

Log Message

Add test with max long value for Jettison (XSTR-540).

Modified Paths


Diff

Modified: trunk/xstream/src/test/com/thoughtworks/xstream/io/json/JettisonMappedXmlDriverTest.java (2114 => 2115)


--- trunk/xstream/src/test/com/thoughtworks/xstream/io/json/JettisonMappedXmlDriverTest.java	2013-09-17 17:43:07 UTC (rev 2114)
+++ trunk/xstream/src/test/com/thoughtworks/xstream/io/json/JettisonMappedXmlDriverTest.java	2013-09-17 17:52:23 UTC (rev 2115)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009, 2010, 2011 XStream Committers.
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013 XStream Committers.
  * All rights reserved.
  *
  * The software in this package is published under the terms of the BSD
@@ -241,6 +241,19 @@
         assertEquals(json, xstream.toXML(topic2));
     }
 
+    public void testLongValueWithHighPrecision() {
+        Topic topic1 = new Topic();
+        topic1.id = Long.MAX_VALUE;
+        topic1.description = "JSON";
+        xstream.alias("topic", Topic.class);
+        String json = xstream.toXML(topic1);
+        assertEquals(
+            "{'topic':{'id':9223372036854775807,'description':'JSON'}}"
+                .replace('\'', '"'), json);
+        Topic topic2 = (Topic)xstream.fromXML(json);
+        assertEquals(json, xstream.toXML(topic2));
+    }
+
     public void testEmbeddedXml() {
         ArrayList list1 = new ArrayList();
         list1.add("<xml attribute=\"foo\"><![CDATA[&quot;\"\'<>]]></xml>");

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to