cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amicha...@apache.org
Subject svn commit: r1078392 - in /cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search: client/FiqlSearchConditionBuilderTest.java sql/SQLPrinterVisitorTest.java
Date Sun, 06 Mar 2011 00:00:10 GMT
Author: amichalec
Date: Sun Mar  6 00:00:10 2011
New Revision: 1078392

URL: http://svn.apache.org/viewvc?rev=1078392&view=rev
Log:
Fix: date localization in tests, search condition with primitive type

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/client/FiqlSearchConditionBuilderTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/client/FiqlSearchConditionBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/client/FiqlSearchConditionBuilderTest.java?rev=1078392&r1=1078391&r2=1078392&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/client/FiqlSearchConditionBuilderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/client/FiqlSearchConditionBuilderTest.java
Sun Mar  6 00:00:10 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.jaxrs.ext.search.client;
 
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -34,6 +35,7 @@ import org.junit.Test;
 
 public class FiqlSearchConditionBuilderTest {
     private static FiqlSearchConditionBuilder b = new FiqlSearchConditionBuilder();
+    private DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 
     @Test
     public void testEmptyBuild() {
@@ -54,7 +56,7 @@ public class FiqlSearchConditionBuilderT
 
     @Test
     public void testEqualToDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("01.03.11 12:34");
+        Date d = df.parse("2011-03-01 12:34");
         String ret = b.query().is("foo").equalTo(d).build();
         assertEquals("foo==2011-03-01T12:34:00.000+01:00", ret);
     }
@@ -80,7 +82,7 @@ public class FiqlSearchConditionBuilderT
 
     @Test
     public void testNotEqualToDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("01.03.11 12:34");
+        Date d = df.parse("2011-03-01 12:34");
         String ret = b.query().is("foo").notEqualTo(d).build();
         assertEquals("foo!=2011-03-01T12:34:00.000+01:00", ret);
     }
@@ -142,28 +144,28 @@ public class FiqlSearchConditionBuilderT
 
     @Test
     public void testGreaterThanDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("02.03.11 22:33");
+        Date d = df.parse("2011-03-02 22:33");
         String ret = b.query().is("foo").after(d).build();
         assertEquals("foo=gt=2011-03-02T22:33:00.000+01:00", ret);
     }
 
     @Test
     public void testLessThanDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("02.03.11 22:33");
+        Date d = df.parse("2011-03-02 22:33");
         String ret = b.query().is("foo").before(d).build();
         assertEquals("foo=lt=2011-03-02T22:33:00.000+01:00", ret);
     }
 
     @Test
     public void testLessOrEqualToDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("02.03.11 22:33");
+        Date d = df.parse("2011-03-02 22:33");
         String ret = b.query().is("foo").notAfter(d).build();
         assertEquals("foo=le=2011-03-02T22:33:00.000+01:00", ret);
     }
 
     @Test
     public void testGreaterOrEqualToDate() throws ParseException {
-        Date d = SimpleDateFormat.getInstance().parse("02.03.11 22:33");
+        Date d = df.parse("2011-03-02 22:33");
         String ret = b.query().is("foo").notBefore(d).build();
         assertEquals("foo=ge=2011-03-02T22:33:00.000+01:00", ret);
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java?rev=1078392&r1=1078391&r2=1078392&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
Sun Mar  6 00:00:10 2011
@@ -132,11 +132,11 @@ public class SQLPrinterVisitorTest exten
             this.name = name;
         }
 
-        public int getLevel() {
+        public Integer getLevel() {
             return level;
         }
 
-        public void setLevel(int level) {
+        public void setLevel(Integer level) {
             this.level = level;
         }
 



Mime
View raw message