incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1209707 - /incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java
Date Fri, 02 Dec 2011 21:46:53 GMT
Author: mbenson
Date: Fri Dec  2 21:46:53 2011
New Revision: 1209707

URL: http://svn.apache.org/viewvc?rev=1209707&view=rev
Log:
add a few additional digits tests

Modified:
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java?rev=1209707&r1=1209706&r2=1209707&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/constraints/DigitsValidatorTest.java
Fri Dec  2 21:46:53 2011
@@ -41,10 +41,12 @@ public class DigitsValidatorTest extends
         DigitsValidatorForNumber validator = new DigitsValidatorForNumber();
         validator.setFractional(4);
         validator.setIntegral(2);
-        BigDecimal val = new BigDecimal("100.12345");
-        Assert.assertFalse(validator.isValid(val, null));
-        val = new BigDecimal("99.1234");
-        Assert.assertTrue(validator.isValid(val, null));
+        Assert.assertFalse(validator.isValid(new BigDecimal("100.1234"), null));
+        Assert.assertFalse(validator.isValid(new BigDecimal("99.12345"), null));
+        Assert.assertTrue(validator.isValid(new BigDecimal("99.1234"), null));
+        Assert.assertFalse(validator.isValid(Double.valueOf(100.1234), null));
+        Assert.assertFalse(validator.isValid(Double.valueOf(99.12345), null));
+        Assert.assertTrue(validator.isValid(Double.valueOf(99.1234), null));
     }
 
     public void testValidateString() {



Mime
View raw message