myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r695698 - in /myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator: DoubleRangeValidatorTest.java LongRangeValidatorTest.java
Date Tue, 16 Sep 2008 00:26:22 GMT
Author: matzew
Date: Mon Sep 15 17:26:21 2008
New Revision: 695698

URL: http://svn.apache.org/viewvc?rev=695698&view=rev
Log:
added test cases for TRINIDAD-1227

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidatorTest.java
    myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/LongRangeValidatorTest.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidatorTest.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidatorTest.java?rev=695698&r1=695697&r2=695698&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidatorTest.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidatorTest.java
Mon Sep 15 17:26:21 2008
@@ -165,6 +165,21 @@
     mock.verify();
   }
 
+  public void testStringBasedValues()
+  {
+    DoubleRangeValidator validator = new DoubleRangeValidator();
+    Mock mock = buildMockUIComponent();
+    UIComponent component = (UIComponent) mock.proxy();
+    MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
+
+    String values[]   = {"200.05","500.00"};
+    validator.setMinimum(200);
+    for (int i = 0; i < values.length ; i++)
+    {
+      doTestValidate(validator, facesContext, wrapper, values[i]);
+    }
+  }
+
   public void testSanitySuccess()
   {
     //some very basic sanity test

Modified: myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/LongRangeValidatorTest.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/LongRangeValidatorTest.java?rev=695698&r1=695697&r2=695698&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/LongRangeValidatorTest.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/validator/LongRangeValidatorTest.java
Mon Sep 15 17:26:21 2008
@@ -165,6 +165,21 @@
     mock.verify();
   }
 
+  public void testStringBasedValues()
+  {
+    LongRangeValidator validator = new LongRangeValidator();
+    Mock mock = buildMockUIComponent();
+    UIComponent component = (UIComponent) mock.proxy();
+    MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
+
+    String values[]   = {"200","500"};
+    validator.setMinimum(190);
+    for (int i = 0; i < values.length ; i++)
+    {
+      doTestValidate(validator, facesContext, wrapper, values[i]);
+    }
+  }
+
   public void testSanitySuccess()
   {
     //some very basic sanity test



Mime
View raw message