commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r412458 - in /jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2: option/ArgumentTest.java validation/DateValidatorTest.java
Date Wed, 07 Jun 2006 17:27:12 GMT
Author: bayard
Date: Wed Jun  7 10:27:11 2006
New Revision: 412458

URL: http://svn.apache.org/viewvc?rev=412458&view=rev
Log:
Renaming YYYY_MM_YY to YYYY_MM_DD as that seems like a much more accurate name

Modified:
    jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/ArgumentTest.java
    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/option/ArgumentTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/ArgumentTest.java?rev=412458&r1=412457&r2=412458&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/ArgumentTest.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/option/ArgumentTest.java
Wed Jun  7 10:27:11 2006
@@ -63,7 +63,7 @@
 
     public static Argument buildDateLimitArgument() {
         return new ArgumentImpl("limit", "the last acceptable date", 0, 1, '=', '\0',
-                                new DateValidator(DateValidatorTest.YYYY_MM_YY), null, null,
0);
+                                new DateValidator(DateValidatorTest.YYYY_MM_DD), null, null,
0);
     }
 
     public static Argument buildTargetsArgument() {
@@ -91,7 +91,7 @@
     public void testNew() {
         try {
             new ArgumentImpl("limit", "the last acceptable date", 10, 5, '=', '\0',
-                             new DateValidator(DateValidatorTest.YYYY_MM_YY), null, null,
0);
+                             new DateValidator(DateValidatorTest.YYYY_MM_DD), null, null,
0);
         } catch (IllegalArgumentException e) {
             assertEquals(resources.getMessage("Argument.minimum.exceeds.maximum"), e.getMessage());
         }
@@ -99,7 +99,7 @@
         {
             ArgumentImpl arg =
                 new ArgumentImpl(null, "the last acceptable date", 5, 5, '=', '\0',
-                                 new DateValidator(DateValidatorTest.YYYY_MM_YY), null, null,
0);
+                                 new DateValidator(DateValidatorTest.YYYY_MM_DD), null, null,
0);
             assertEquals("wrong arg name", "arg", arg.getPreferredName());
         }
 
@@ -108,7 +108,7 @@
 
             try {
                 new ArgumentImpl(null, "the last acceptable date", 1, 1, '=', '\0',
-                                 new DateValidator(DateValidatorTest.YYYY_MM_YY), null, defaults,
0);
+                                 new DateValidator(DateValidatorTest.YYYY_MM_DD), null, defaults,
0);
             } catch (IllegalArgumentException exp) {
                 assertEquals(resources.getMessage("Argument.too.few.defaults"), exp.getMessage());
             }
@@ -120,7 +120,7 @@
             defaults.add("2");
 
             new ArgumentImpl(null, "the last acceptable date", 1, 1, '=', '\0',
-                             new DateValidator(DateValidatorTest.YYYY_MM_YY), null, defaults,
0);
+                             new DateValidator(DateValidatorTest.YYYY_MM_DD), null, defaults,
0);
         } catch (IllegalArgumentException exp) {
             assertEquals(resources.getMessage("Argument.too.many.defaults"), exp.getMessage());
         }
@@ -367,7 +367,7 @@
 
         option.validate(commandLine, option);
         assertContentsEqual(Arrays.asList(new Object[] {
-                                              DateValidatorTest.YYYY_MM_YY.parse("2004-01-01")
+                                              DateValidatorTest.YYYY_MM_DD.parse("2004-01-01")
                                           }), commandLine.getValues(option));
     }
 

Modified: jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java?rev=412458&r1=412457&r2=412458&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
Wed Jun  7 10:27:11 2006
@@ -40,8 +40,8 @@
     extends TestCase {
     private static final ResourceHelper resources = ResourceHelper.getResourceHelper();
     public static final DateFormat D_M_YY = new SimpleDateFormat("d/M/yy");
-    public static final DateFormat YYYY_MM_YY = new SimpleDateFormat("yyyy-MM-dd");
-    private List formats = Arrays.asList(new Object[] { D_M_YY, YYYY_MM_YY });
+    public static final DateFormat YYYY_MM_DD = new SimpleDateFormat("yyyy-MM-dd");
+    private List formats = Arrays.asList(new Object[] { D_M_YY, YYYY_MM_DD });
 
     public void testSingleFormatValidate()
         throws InvalidArgumentException {
@@ -52,7 +52,7 @@
         validator.validate(list);
 
         final Iterator i = list.iterator();
-        assertEquals("2003-12-23", YYYY_MM_YY.format((Date) i.next()));
+        assertEquals("2003-12-23", YYYY_MM_DD.format((Date) i.next()));
         assertFalse(i.hasNext());
     }
 
@@ -65,7 +65,7 @@
         validator.validate(list);
 
         final Iterator i = list.iterator();
-        // CLI-40: For some reason, the YYYY_MM_YY object gets quite 
+        // CLI-40: For some reason, the YYYY_MM_DD object gets quite 
         // confused here and returns 2003-12-22. If we make a new one 
         // there is no problem.
         assertEquals("2003-12-23", new SimpleDateFormat("yyyy-MM-dd").format((Date) i.next()));
@@ -123,8 +123,8 @@
         validator.validate(list);
 
         final Iterator i = list.iterator();
-        assertEquals("2003-12-23", YYYY_MM_YY.format((Date) i.next()));
-        assertEquals("2002-10-12", YYYY_MM_YY.format((Date) i.next()));
+        assertEquals("2003-12-23", YYYY_MM_DD.format((Date) i.next()));
+        assertEquals("2002-10-12", YYYY_MM_DD.format((Date) i.next()));
         assertFalse(i.hasNext());
     }
 



---------------------------------------------------------------------
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