Author: bayard Date: Wed Jun 7 10:21:48 2006 New Revision: 412456 URL: http://svn.apache.org/viewvc?rev=412456&view=rev Log: Modifying the test so it creates a new format object rather than reusing the static one. For some reason it gives the wrong response and it's hard to see why given that it works for other methods and JUnit is single threaded. This is discussed in CLI-40
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/viewvc/jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/validation/DateValidatorTest.java?rev=412456&r1=412455&r2=412456&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:21:48 2006 @@ -65,7 +65,10 @@ validator.validate(list); final Iterator i = list.iterator(); - assertEquals("2003-12-23", YYYY_MM_YY.format((Date) i.next())); + // CLI-40: For some reason, the YYYY_MM_YY 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())); assertFalse(i.hasNext()); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]