struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnenn...@apache.org
Subject [3/4] struts git commit: added tests for rfc3339 date formats
Date Fri, 09 Oct 2015 09:13:51 GMT
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 <cnenning@apache.org>
Authored: Fri Oct 9 11:11:34 2015 +0200
Committer: cnenning <cnenning@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() {


Mime
View raw message