commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r384139 - /jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
Date Wed, 08 Mar 2006 07:13:08 GMT
Author: bayard
Date: Tue Mar  7 23:13:07 2006
New Revision: 384139

URL: http://svn.apache.org/viewcvs?rev=384139&view=rev
Log:
As #38845 states, three tests in this class fail. This is because they make assumptions about
the default datetime formatting instances. I've made them non-default, which should allow
tests to pass. Two do pass for me, but the third oddly enough doesn't - somehow it turns 23-Dec-2003
into 2003-12-22. Very odd. 

Modified:
    jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java

Modified: jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java?rev=384139&r1=384138&r2=384139&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
Tue Mar  7 23:13:07 2006
@@ -60,7 +60,7 @@
         throws InvalidArgumentException {
         final Object[] array = new Object[] { "23-Dec-2003" };
         final List list = Arrays.asList(array);
-        final Validator validator = DateValidator.getDateInstance();
+        final Validator validator = new DateValidator( new SimpleDateFormat("dd-MMM-yyyy")
);
 
         validator.validate(list);
 
@@ -73,7 +73,7 @@
         throws InvalidArgumentException {
         final Object[] array = new Object[] { "18:00:00" };
         final List list = Arrays.asList(array);
-        final Validator validator = DateValidator.getTimeInstance();
+        final Validator validator = new DateValidator( new SimpleDateFormat("HH:mm:ss") );
 
         validator.validate(list);
 
@@ -87,7 +87,7 @@
         throws InvalidArgumentException {
         final Object[] array = new Object[] { "23-Jan-2003 18:00:00" };
         final List list = Arrays.asList(array);
-        final Validator validator = DateValidator.getDateTimeInstance();
+        final Validator validator = new DateValidator( new SimpleDateFormat("dd-MMM-yyyy
HH:mm:ss") );
 
         validator.validate(list);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message