Revision: 387
Author: tfenne
Date: 2006-08-27 11:53:49 -0700 (Sun, 27 Aug 2006)
ViewCVS: http://svn.sourceforge.net/stripes/?rev=387&view=rev
Log Message:
-----------
Merging changes to DateTypeConverter from r386 onto the 1.4 branch.
Modified Paths:
--------------
branches/1.4.x/stripes/src/net/sourceforge/stripes/validation/DateTypeConverter.java
branches/1.4.x/tests/src/net/sourceforge/stripes/validation/DateTypeConverterTest.java
Modified:
branches/1.4.x/stripes/src/net/sourceforge/stripes/validation/DateTypeConverter.java
===================================================================
---
branches/1.4.x/stripes/src/net/sourceforge/stripes/validation/DateTypeConverter.java
2006-08-27 18:49:10 UTC (rev 386)
+++
branches/1.4.x/stripes/src/net/sourceforge/stripes/validation/DateTypeConverter.java
2006-08-27 18:53:49 UTC (rev 387)
@@ -57,6 +57,7 @@
* <li>d MMM yy (note that for parsing MMM and MMMM are
interchangable)</li>
* <li>yyyy M d (note that for parsing M and MM are interchangable)</li>
* <li>yyyy MMM d</li>
+ * <li>EEE MMM dd HH:mm:ss zzz yyyy (the format created by
Date.toString())</li>
* </ul>
* </p>
*/
@@ -86,7 +87,8 @@
public static final String[] formatStrings = new String[] {
"d MMM yy",
"yyyy M d",
- "yyyy MMM d"
+ "yyyy MMM d",
+ "EEE MMM dd HH:mm:ss zzz yyyy"
};
/**
Modified:
branches/1.4.x/tests/src/net/sourceforge/stripes/validation/DateTypeConverterTest.java
===================================================================
---
branches/1.4.x/tests/src/net/sourceforge/stripes/validation/DateTypeConverterTest.java
2006-08-27 18:49:10 UTC (rev 386)
+++
branches/1.4.x/tests/src/net/sourceforge/stripes/validation/DateTypeConverterTest.java
2006-08-27 18:53:49 UTC (rev 387)
@@ -165,4 +165,16 @@
Assert.assertEquals(0, errors.size());
Assert.assertEquals(format.format(date), "03/01/2006");
}
+
+ @Test(groups="fast")
+ public void testDateToStringFormat() {
+ Collection<ValidationError> errors = new ArrayList<ValidationError>();
+ DateTypeConverter converter = getConverter(Locale.US);
+ Date now = new Date();
+
+ Date date = converter.convert(now.toString(), Date.class, errors);
+ Assert.assertNotNull(date);
+ Assert.assertEquals(0, errors.size());
+ Assert.assertEquals(format.format(date), format.format(now));
+ }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development