You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/06/14 18:09:14 UTC
[4/5] lucene-solr:jira/SOLR-10834: Fix absurd way of 'reloading' in
SuggesterTest that was actaully trying to use a completley diff config/schema
after the 'reload'
Fix absurd way of 'reloading' in SuggesterTest that was actaully trying to use a completley diff config/schema after the 'reload'
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/df119921
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/df119921
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/df119921
Branch: refs/heads/jira/SOLR-10834
Commit: df11992106f8c338503b6e3e9a27ba6ddcfa2953
Parents: fcf9813
Author: Chris Hostetter <ho...@apache.org>
Authored: Wed Jun 14 10:07:19 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Wed Jun 14 11:05:23 2017 -0700
----------------------------------------------------------------------
.../solr/spelling/suggest/SuggesterTest.java | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df119921/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
index a9eefdc..9168741 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
@@ -16,8 +16,6 @@
*/
package org.apache.solr.spelling.suggest;
-import java.io.File;
-
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.SpellingParams;
import org.apache.solr.common.util.NamedList;
@@ -76,25 +74,18 @@ public class SuggesterTest extends SolrTestCaseJ4 {
@Test
public void testReload() throws Exception {
- String leaveData = System.getProperty("solr.test.leavedatadir");
- if (leaveData == null) leaveData = "";
- System.setProperty("solr.test.leavedatadir", "true");
addDocs();
assertU(commit());
- File data = initCoreDataDir;
- String config = configString;
- deleteCore();
- initCoreDataDir = data;
- configString = config;
- initCore();
+
+ h.reload();
+ // wait until the new searcher is registered
+ waitForWarming();
+
assertQ(req("qt", requestUri, "q", "ac", SpellingParams.SPELLCHECK_COUNT, "2", SpellingParams.SPELLCHECK_ONLY_MORE_POPULAR, "true"),
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/int[@name='numFound'][.='2']",
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/arr[@name='suggestion']/str[1][.='acquire']",
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/arr[@name='suggestion']/str[2][.='accommodate']"
);
-
- // restore the property
- System.setProperty("solr.test.leavedatadir", leaveData);
}
@Test