From e26a02a73ec8635a60120b3a8ca5b9f39a4e5d9a Mon Sep 17 00:00:00 2001 From: Chris Goldthorpe Date: Wed, 7 Jul 2010 23:07:37 +0000 Subject: Test was not finalizing the index which could cause random failures. --- .../eclipse/ua/tests/help/remote/SearchIndexCreation.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java index 977805d1d..e9f9c3fde 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java @@ -51,6 +51,20 @@ public class SearchIndexCreation extends TestCase { addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test7.html", true); addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test8.htm", true); addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test77.htm", false); // Does not exist + index.endAddBatch(false, true); + int finalCallCount = MockContentServlet.getCallcount(); + assertEquals("Remote server called", 0, finalCallCount - initialCallCount); + } + + public void testSearchIndexMakesNoRemoteCalls2() throws Throwable { + int initialCallCount = MockContentServlet.getCallcount(); + SearchIndexWithIndexingProgress index = new SearchIndexWithIndexingProgress("en-us", analyzerDesc, HelpPlugin + .getTocManager()); + index.beginAddBatch(true); + addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test7.html", true); + addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test8.htm", true); + addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test77.htm", false); // Does not exist + index.endAddBatch(false, true); int finalCallCount = MockContentServlet.getCallcount(); assertEquals("Remote server called", 0, finalCallCount - initialCallCount); } @@ -64,6 +78,7 @@ public class SearchIndexCreation extends TestCase { addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test7.html", true); addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test8.htm", true); addHrefToIndex(index, "/org.eclipse.ua.tests/data/help/search/test77.htm", false); // Does not exist + index.endAddBatch(false, true); int finalCallCount = MockContentServlet.getCallcount(); assertEquals("Remote server called", 0, finalCallCount - initialCallCount); } -- cgit v1.2.3