use of org.apache.solr.util.TestHarness in project lucene-solr by apache.
the class SolrTestCaseJ4 method createCoreContainer.
public static CoreContainer createCoreContainer(NodeConfig config, CoresLocator locator) {
testSolrHome = config.getSolrResourceLoader().getInstancePath();
h = new TestHarness(config, locator);
lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
return h.getCoreContainer();
}
use of org.apache.solr.util.TestHarness in project lucene-solr by apache.
the class SolrTestCaseJ4 method setupNoCoreTest.
/**
* Call this from @BeforeClass to set up the test harness and update handler with no cores.
*
* @param solrHome The solr home directory.
* @param xmlStr - the text of an XML file to use. If null, use the what's the absolute minimal file.
* @throws Exception Lost of file-type things can go wrong.
*/
public static void setupNoCoreTest(Path solrHome, String xmlStr) throws Exception {
if (xmlStr == null)
xmlStr = "<solr></solr>";
Files.write(solrHome.resolve(SolrXmlConfig.SOLR_XML_FILE), xmlStr.getBytes(StandardCharsets.UTF_8));
h = new TestHarness(SolrXmlConfig.fromSolrHome(solrHome));
lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
}
use of org.apache.solr.util.TestHarness in project lucene-solr by apache.
the class SolrTestCaseJ4 method createCoreContainer.
public static CoreContainer createCoreContainer(Path solrHome, String solrXML) {
testSolrHome = requireNonNull(solrHome);
h = new TestHarness(solrHome, solrXML);
lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
return h.getCoreContainer();
}
use of org.apache.solr.util.TestHarness in project lucene-solr by apache.
the class SolrTestCaseJ4 method createCore.
public static void createCore() {
assertNotNull(testSolrHome);
solrConfig = TestHarness.createConfig(testSolrHome, coreName, getSolrConfigFile());
h = new TestHarness(coreName, hdfsDataDir == null ? initCoreDataDir.getAbsolutePath() : hdfsDataDir, solrConfig, getSchemaFile());
lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
}
use of org.apache.solr.util.TestHarness in project lucene-solr by apache.
the class SolrTestCaseJ4 method createDefaultCoreContainer.
public static CoreContainer createDefaultCoreContainer(Path solrHome) {
testSolrHome = requireNonNull(solrHome);
h = new TestHarness("collection1", initCoreDataDir.getAbsolutePath(), "solrconfig.xml", "schema.xml");
lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
return h.getCoreContainer();
}
Aggregations