cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: CXF-5549: Introduce Tika Search Visitor. Fixing date-based tests stability by providing explicit timezone
Date Mon, 14 Jul 2014 12:18:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 51925d81e -> 6c4aa3a94


CXF-5549: Introduce Tika Search Visitor. Fixing date-based tests stability by providing explicit
timezone


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6c4aa3a9
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6c4aa3a9
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6c4aa3a9

Branch: refs/heads/master
Commit: 6c4aa3a94fd35e7ba263d639a04cbbcf31d11edb
Parents: 51925d8
Author: reta <drreta@gmail.com>
Authored: Mon Jul 14 08:18:15 2014 -0400
Committer: reta <drreta@gmail.com>
Committed: Mon Jul 14 08:18:15 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java     | 4 ++--
 .../jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java | 7 ++-----
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6c4aa3a9/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java
index 2565cbb..c35007d 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchUtils.java
@@ -32,7 +32,7 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 
 public final class SearchUtils {
-    public static final String TIMESTAMP_WITH_TIMEZONE = "yyyy-MM-dd'T'HH:mm:ss";
+    public static final String TIMESTAMP_NO_TIMEZONE = "yyyy-MM-dd'T'HH:mm:ss";
     public static final String TIMESTAMP_WITH_TIMEZONE_Z = "yyyy-MM-dd'T'HH:mm:ssZ";
     public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
     public static final String DATE_FORMAT_PROPERTY = "search.date-format";
@@ -190,7 +190,7 @@ public final class SearchUtils {
         Date date = timestampFromString(new SimpleDateFormat(TIMESTAMP_WITH_TIMEZONE_Z),
value);
         
         if (date == null) {
-            date = timestampFromString(new SimpleDateFormat(TIMESTAMP_WITH_TIMEZONE), value);
+            date = timestampFromString(new SimpleDateFormat(TIMESTAMP_NO_TIMEZONE), value);
         }
         
         if (date == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/6c4aa3a9/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java
b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java
index 3c832db..553fcf8 100644
--- a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java
+++ b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/tika/TikaLuceneContentExtractorTest.java
@@ -92,11 +92,8 @@ public class TikaLuceneContentExtractorTest extends Assert {
         writer.addDocument(document);
         writer.commit();
         // testPDF.pdf 'modified' is set to '2007-09-14T09:02:31Z'
-        assertEquals(1, getHits("modified=gt=2007-09-14T09:02:31", documentMetadata.getFieldTypes()).length);
-        
-        // TODO Check why this does not work
-        assertEquals(1, getHits("modified=le=2007-09-15T09:02:31Z", documentMetadata.getFieldTypes()).length);
-        
+        assertEquals(1, getHits("modified=gt=2007-09-14T09:02:31Z", documentMetadata.getFieldTypes()).length);
+        assertEquals(1, getHits("modified=le=2007-09-15T09:02:31-0500", documentMetadata.getFieldTypes()).length);
         assertEquals(1, getHits("modified=ge=2007-09-15", documentMetadata.getFieldTypes()).length);
         assertEquals(1, getHits("modified==2007-09-15", documentMetadata.getFieldTypes()).length);
         assertEquals(0, getHits("modified==2007-09-16", documentMetadata.getFieldTypes()).length);


Mime
View raw message