public static CoreContainer createDefaultCoreContainer(Path solrHome) { testSolrHome = requireNonNull(solrHome); h = new TestHarness("collection1", initCoreDataDir.getAbsolutePath(), "solrconfig.xml", "schema.xml"); lrf = h.getRequestFactory("", 0, 20, CommonParams.VERSION, "2.2"); return h.getCoreContainer(); }
public static CoreContainer createCoreContainer(Path solrHome, String solrXML) { testSolrHome = requireNonNull(solrHome); h = new TestHarness(solrHome, solrXML); lrf = h.getRequestFactory("", 0, 20, CommonParams.VERSION, "2.2"); return h.getCoreContainer(); }
/** * 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("/select", 0, 20, CommonParams.VERSION, "2.2"); }
public void setUp() throws Exception { log.info("####SETUP_START " + getName()); dataDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + getClass().getName() + "-" + System.currentTimeMillis()); dataDir.mkdirs(); String configFile = getSolrConfigFile(); if (configFile != null) { solrConfig = h.createConfig(getSolrConfigFile()); h = new TestHarness( dataDir.getAbsolutePath(), solrConfig, getSchemaFile()); lrf = h.getRequestFactory ("standard",0,20,"version","2.2"); } log.info("####SETUP_END " + getName()); }
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 ("",0,20,CommonParams.VERSION,"2.2"); }
public static CoreContainer createCoreContainer(NodeConfig config, CoresLocator locator) { testSolrHome = config.getSolrResourceLoader().getInstancePath(); h = new TestHarness(config, locator); lrf = h.getRequestFactory("", 0, 20, CommonParams.VERSION, "2.2"); return h.getCoreContainer(); }