You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by cn...@apache.org on 2015/10/09 11:13:51 UTC

[3/4] struts git commit: added tests for rfc3339 date formats

added tests for rfc3339 date formats


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/366a0b4a
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/366a0b4a
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/366a0b4a

Branch: refs/heads/master
Commit: 366a0b4a5876b26c95eb186487afbd7e84a1cfaf
Parents: d95fc63
Author: cnenning <cn...@apache.org>
Authored: Fri Oct 9 11:11:34 2015 +0200
Committer: cnenning <cn...@apache.org>
Committed: Fri Oct 9 11:11:34 2015 +0200

----------------------------------------------------------------------
 .../xwork2/conversion/impl/XWorkConverterTest.java            | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/366a0b4a/core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkConverterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkConverterTest.java b/core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkConverterTest.java
index 3d7fc49..d185c64 100644
--- a/core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkConverterTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkConverterTest.java
@@ -109,6 +109,13 @@ public class XWorkConverterTest extends XWorkTestCase {
         assertEquals(date, ts);
         java.sql.Time time1 = (java.sql.Time) converter.convertValue(context, null, null, null, datetStr, java.sql.Time.class);
         assertEquals(datet, time1);
+
+        Date dateWithTime = format.parse("01/10/2001 01:02:03");
+        Date dateRfc3339 = (Date) converter.convertValue(context, null, null, null, "2001-01-10T01:02:03", Date.class);
+        assertEquals(dateWithTime, dateRfc3339);
+
+        Date dateRfc3339DateOnly = (Date) converter.convertValue(context, null, null, null, "2001-01-10", Date.class);
+        assertEquals(date, dateRfc3339DateOnly);
     }
 
     public void testFieldErrorMessageAddedForComplexProperty() {