jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bae...@apache.org
Subject svn commit: r1468842 - in /jackrabbit/branches/2.1: ./ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
Date Wed, 17 Apr 2013 11:29:00 GMT
Author: baedke
Date: Wed Apr 17 11:28:59 2013
New Revision: 1468842

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

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

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

Modified: jackrabbit/branches/2.1/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.1/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java?rev=1468842&r1=1468841&r2=1468842&view=diff
==============================================================================
--- jackrabbit/branches/2.1/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
(original)
+++ jackrabbit/branches/2.1/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyDoubleTest.java
Wed Apr 17 11:28:59 2013
@@ -131,4 +131,18 @@ 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 (int k = 0; k < tests.length; k++) {
+            double v = tests[k];
+            testNode.setProperty(propertyName1, v);
+            testRootNode.getSession().save();
+            assertEquals("Round-trip of " + v, new Double(v), new Double(superuser.getNode(path).getProperty(propertyName1).getDouble()));
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message