SOLR-3775: Add a test for Office 2003 file (.doc)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1379357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-08-31 08:31:34 +00:00
parent adc8db0353
commit 90e692e180
2 changed files with 17 additions and 3 deletions

View File

@ -145,7 +145,22 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
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 ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
//"fmap.content_type", "abcxyz",
"commit", "true" // test immediate commit
);
assertTrue(false);
fail("Should throw SolrException");
} catch (SolrException e) {
//do nothing
} finally {