You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2012/08/31 10:31:34 UTC
svn commit: r1379357 - in /lucene/dev/trunk/solr/contrib/extraction/src:
test-files/extraction/word2003.doc
test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
Author: uschindler
Date: Fri Aug 31 08:31:34 2012
New Revision: 1379357
URL: http://svn.apache.org/viewvc?rev=1379357&view=rev
Log:
SOLR-3775: Add a test for Office 2003 file (.doc)
Added:
lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/word2003.doc (with props)
Modified:
lucene/dev/trunk/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
Added: lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/word2003.doc
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/word2003.doc?rev=1379357&view=auto
==============================================================================
Binary file - no diff available.
Modified: lucene/dev/trunk/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java?rev=1379357&r1=1379356&r2=1379357&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java (original)
+++ lucene/dev/trunk/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java Fri Aug 31 08:31:34 2012
@@ -145,7 +145,22 @@ public class ExtractingRequestHandlerTes
assertU(commit());
assertQ(req("stream_name:version_control.xml"), "//*[@numFound='1']");
-
+ loadLocal("extraction/word2003.doc", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer",
+ "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords",
+ "fmap.Author", "extractedAuthor",
+ "literal.id", "four",
+ "uprefix", "ignored_",
+ "fmap.content", "extractedContent",
+ "fmap.language", "extractedLanguage",
+ "fmap.Last-Modified", "extractedDate"
+ );
+ assertQ(req("title:\"Word 2003 Title\""), "//*[@numFound='0']");
+ // There is already a PDF file with this content:
+ assertQ(req("extractedContent:\"This is a test of PDF and Word extraction in Solr, it is only a test\""), "//*[@numFound='1']");
+ assertU(commit());
+ assertQ(req("title:\"Word 2003 Title\""), "//*[@numFound='1']");
+ // now 2 of them:
+ assertQ(req("extractedContent:\"This is a test of PDF and Word extraction in Solr, it is only a test\""), "//*[@numFound='2']");
}
@@ -163,8 +178,7 @@ public class ExtractingRequestHandlerTes
//"fmap.content_type", "abcxyz",
"commit", "true" // test immediate commit
);
- assertTrue(false);
-
+ fail("Should throw SolrException");
} catch (SolrException e) {
//do nothing
} finally {