You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/11/02 19:29:58 UTC

svn commit: r1196745 - /incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java

Author: andy
Date: Wed Nov  2 18:29:57 2011
New Revision: 1196745

URL: http://svn.apache.org/viewvc?rev=1196745&view=rev
Log:
JENA-153

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java?rev=1196745&r1=1196744&r2=1196745&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/test/java/com/hp/hpl/jena/sparql/expr/TestExpressions.java Wed Nov  2 18:29:57 2011
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue ;
 
 import java.math.BigDecimal ;
+import java.math.BigInteger ;
 
 import junit.framework.JUnit4TestAdapter ;
 import org.junit.AfterClass ;
@@ -111,6 +112,8 @@ public class TestExpressions
     
     @Test public void testNumeric_28() { testNumeric("+2.5", new BigDecimal("+2.5")) ; }
     @Test public void testNumeric_29() { testNumeric("-2.5", new BigDecimal("-2.5")) ; }
+    @Test public void testNumeric_30() { testNumeric("10000000000000000000000000000+1", new BigInteger("10000000000000000000000000001")) ; }
+    @Test public void testNumeric_31() { testNumeric("-10000000000000000000000000000+1", new BigInteger("-9999999999999999999999999999")) ; }
     
     @Test public void testBoolean_1() { testBoolean("4111222333444 > 1234", 4111222333444L > 1234) ; }
     @Test public void testBoolean_2() { testBoolean("4111222333444 < 1234", 4111222333444L < 1234L) ; }
@@ -347,9 +350,9 @@ public class TestExpressions
     @Test public void testString_22()   { testString("str('lex'^^<x:unknown>)", "lex") ; }
     @Test public void testBoolean_147() { testBoolean("sameTerm(1, 1)", true, env) ; }
     @Test public void testBoolean_148() { testBoolean("sameTerm(1, 1.0)", false, env) ; }
-    @Test public void testNumeric_30()  { testNumeric("<"+xsd+"integer>('3')", 3) ; }
-    @Test public void testNumeric_31()  { testNumeric("<"+xsd+"byte>('3')", 3) ; }
-    @Test public void testNumeric_32()  { testNumeric("<"+xsd+"int>('3')", 3) ; }
+    @Test public void testNumeric_52()  { testNumeric("<"+xsd+"integer>('3')", 3) ; }
+    @Test public void testNumeric_53()  { testNumeric("<"+xsd+"byte>('3')", 3) ; }
+    @Test public void testNumeric_54()  { testNumeric("<"+xsd+"int>('3')", 3) ; }
     @Test public void testBoolean_149() { testBoolean("<"+xsd+"double>('3') = 3", true) ; }
     @Test public void testBoolean_150() { testBoolean("<"+xsd+"float>('3') = 3", true) ; }
     @Test public void testBoolean_151() { testBoolean("<"+xsd+"double>('3') = <"+xsd+"float>('3')", true) ; }
@@ -439,7 +442,14 @@ public class TestExpressions
         assertTrue(v.isDecimal()) ;
         assertEquals(decimal, v.getDecimal()) ;
     }
-
+
+    private static void testNumeric(String string, BigInteger integer)
+    {
+        Expr expr = parse(string) ;
+        NodeValue v = expr.eval( BindingFactory.binding() , new FunctionEnvBase()) ;
+        assertTrue(v.isInteger()) ;
+        assertEquals(integer, v.getInteger()) ;
+    }
     private static void testNumeric(String string, double d)
     {
         Expr expr = parse(string) ;