Author: mbrohl
Date: Fri Jun 30 11:56:05 2017 New Revision: 1800376 URL: http://svn.apache.org/viewvc?rev=1800376&view=rev Log: Fixed: Lucene tests fail due to problems in the test data. (OFBIZ-9439) The data is missing some content associations and the test code is not reflecting the new data, will fix this. This completes r1800322. Modified: ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java ofbiz/ofbiz-plugins/trunk/lucene/testdef/data/LuceneTestsData.xml Modified: ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java?rev=1800376&r1=1800375&r2=1800376&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java (original) +++ ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java Fri Jun 30 11:56:05 2017 @@ -61,14 +61,17 @@ public class LuceneTests extends OFBizTe public void testSearchTermHand() throws Exception { Map<String, Object> ctx = new HashMap<String, Object>(); - ctx.put("contentId", "WebStoreCONTENT"); + ctx.put("contentId", "LuceneCONTENT"); ctx.put("userLogin", userLogin); Map<String, Object> resp = dispatcher.runSync("indexContentTree", ctx); assertTrue("Could not init search index", ServiceUtil.isSuccess(resp)); + try { Thread.sleep(3000); // sleep 3 seconds to give enough time to the indexer to process the entries } catch(Exception e) {} + Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath("content")).toPath()); + DirectoryReader r = null; try { r = DirectoryReader.open(directory); Modified: ofbiz/ofbiz-plugins/trunk/lucene/testdef/data/LuceneTestsData.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/lucene/testdef/data/LuceneTestsData.xml?rev=1800376&r1=1800375&r2=1800376&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/lucene/testdef/data/LuceneTestsData.xml (original) +++ ofbiz/ofbiz-plugins/trunk/lucene/testdef/data/LuceneTestsData.xml Fri Jun 30 11:56:05 2017 @@ -37,6 +37,10 @@ under the License. </div> ]]></textData> </ElectronicText> + <Content contentId="LCNTGIZMOSLRG" contentTypeId="WEB_SITE_PUB_PT" ownerContentId="LCNTGIZMOS" contentName="Large Lucene Gizmos" description="Large Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin" + dataResourceId="LCNTGIZMOSLRG" mimeTypeId="text/html" localeString="en_US"/> + <ContentAssoc contentId="LCNTGIZMOS" contentIdTo="LCNTGIZMOSLRG" contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/> + <DataResource dataResourceId="LCNTGIZMOSSML" dataResourceTypeId="ELECTRONIC_TEXT" mimeTypeId="text/html" localeString="en_US" isPublic="Y" dataResourceName="Small Lucene Gizmos"/> <ElectronicText dataResourceId="LCNTGIZMOSSML"> <textData><![CDATA[ @@ -48,6 +52,10 @@ under the License. </div> ]]></textData> </ElectronicText> + <Content contentId="LCNTGIZMOSSML" contentTypeId="WEB_SITE_PUB_PT" ownerContentId="LCNTGIZMOS" contentName="Small Lucene Gizmos" description="Large Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin" + dataResourceId="LCNTGIZMOSSML" mimeTypeId="text/html" localeString="en_US"/> + <ContentAssoc contentId="LCNTGIZMOS" contentIdTo="LCNTGIZMOSSML" contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/> + <DataResource dataResourceId="GIZMOSLRG" dataResourceTypeId="ELECTRONIC_TEXT" mimeTypeId="text/html" localeString="en_US" isPublic="Y" dataResourceName="Advocacy"/> <ElectronicText dataResourceId="GIZMOSLRG"> <textData><![CDATA[ @@ -59,11 +67,8 @@ under the License. </div> ]]></textData> </ElectronicText> - - <Content contentId="LCNTGIZMOSLRG" contentTypeId="WEB_SITE_PUB_PT" ownerContentId="LCNTGIZMOS" contentName="Large Lucene Gizmos" description="Large Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin" - dataResourceId="LCNTGIZMOSLRG" mimeTypeId="text/html" localeString="en_US"/> - <Content contentId="LCNTGIZMOSSML" contentTypeId="WEB_SITE_PUB_PT" ownerContentId="LCNTGIZMOS" contentName="Small Lucene Gizmos" description="Large Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin" - dataResourceId="LCNTGIZMOSSML" mimeTypeId="text/html" localeString="en_US"/> <Content contentId="GIZMOSLRG" contentTypeId="WEB_SITE_PUB_PT" ownerContentId="LCNTGIZMOS" contentName="Advocacy" description="Advocacy" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin" dataResourceId="GIZMOSLRG" mimeTypeId="text/html" localeString="en_US"/> -</entity-engine-xml> \ No newline at end of file + <ContentAssoc contentId="LCNTGIZMOS" contentIdTo="GIZMOSLRG" contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/> + +</entity-engine-xml> |
Free forum by Nabble | Edit this page |