You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/09/17 20:55:47 UTC

svn commit: r998256 - in /pivot/trunk: build.xml core/test/org/apache/pivot/json/test/JSONSerializerTest.java

Author: gbrown
Date: Fri Sep 17 18:55:47 2010
New Revision: 998256

URL: http://svn.apache.org/viewvc?rev=998256&view=rev
Log:
Resolve PIVOT-517; fix bug in JSONSerializer test.

Modified:
    pivot/trunk/build.xml
    pivot/trunk/core/test/org/apache/pivot/json/test/JSONSerializerTest.java

Modified: pivot/trunk/build.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/build.xml?rev=998256&r1=998255&r2=998256&view=diff
==============================================================================
--- pivot/trunk/build.xml (original)
+++ pivot/trunk/build.xml Fri Sep 17 18:55:47 2010
@@ -176,7 +176,7 @@ limitations under the License.
                 <formatter type="brief" usefile="false" if="test.formatter"/>
 
                 <batchtest>
-                    <fileset dir="@{project}/test" includes="**/*Test.java"/>
+                    <fileset dir="@{project}/test" includes="**/*Test*.java"/>
                 </batchtest>
             </junit>
         </sequential>

Modified: pivot/trunk/core/test/org/apache/pivot/json/test/JSONSerializerTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/json/test/JSONSerializerTest.java?rev=998256&r1=998255&r2=998256&view=diff
==============================================================================
--- pivot/trunk/core/test/org/apache/pivot/json/test/JSONSerializerTest.java (original)
+++ pivot/trunk/core/test/org/apache/pivot/json/test/JSONSerializerTest.java Fri Sep 17 18:55:47 2010
@@ -44,18 +44,28 @@ public class JSONSerializerTest {
         assertEquals(0, emptyList.getLength());
     }
 
-    @Test(expected=RuntimeException.class)
-    public void testInvalidNumbers() {
-        try {
-            JSONSerializer.toString(Float.NaN);
-            JSONSerializer.toString(Float.NEGATIVE_INFINITY);
-            JSONSerializer.toString(Float.POSITIVE_INFINITY);
-            JSONSerializer.toString(Double.NaN);
-            JSONSerializer.toString(Double.NEGATIVE_INFINITY);
-            JSONSerializer.toString(Double.POSITIVE_INFINITY);
-        } catch (SerializationException exception) {
-            // No-op
-        }
+    public void testFloatNaN() throws SerializationException {
+        JSONSerializer.toString(Float.NaN);
+    }
+
+    public void testFloatNegativeInfinity() throws SerializationException {
+        JSONSerializer.toString(Float.NEGATIVE_INFINITY);
+    }
+
+    public void testFloatPositiveInfinity() throws SerializationException {
+        JSONSerializer.toString(Float.POSITIVE_INFINITY);
+    }
+
+    public void testDoubleNaN() throws SerializationException {
+        JSONSerializer.toString(Double.NaN);
+    }
+
+    public void testDoubleNegativeInfinity() throws SerializationException {
+        JSONSerializer.toString(Double.NEGATIVE_INFINITY);
+    }
+
+    public void testDoublePositiveInfinityN() throws SerializationException {
+        JSONSerializer.toString(Double.POSITIVE_INFINITY);
     }
 
     @Test