jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bae...@apache.org
Subject svn commit: r1468537 - in /jackrabbit/branches/2.4: ./ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
Date Tue, 16 Apr 2013 18:05:52 GMT
Author: baedke
Date: Tue Apr 16 18:05:52 2013
New Revision: 1468537

URL: http://svn.apache.org/r1468537
Log:
JCR-3566: add TCK test for NaN and infinity double property values

Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1467255

Modified: jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java?rev=1468537&r1=1468536&r2=1468537&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
Tue Apr 16 18:05:52 2013
@@ -131,4 +131,17 @@ public class SetPropertyDoubleTest exten
                 testNode.hasProperty(propertyName1));
     }
 
+    /**
+     * Tests that in infinity and NaN values can be persisted and round-tripped.
+     */
+    public void testEdgeCases() throws Exception {
+        double tests[] = { Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
};
+        String path = testNode.getPath();
+
+        for (double v : tests) {
+            testNode.setProperty(propertyName1, v);
+            testRootNode.getSession().save();
+            assertEquals("Round-trip of " + v, v, superuser.getNode(path).getProperty(propertyName1).getDouble());
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message