Example usage for org.apache.solr SolrTestCaseJ4 DEFAULT_TEST_CORENAME

List of usage examples for org.apache.solr SolrTestCaseJ4 DEFAULT_TEST_CORENAME

Introduction

In this page you can find the example usage for org.apache.solr SolrTestCaseJ4 DEFAULT_TEST_CORENAME.

Prototype

String DEFAULT_TEST_CORENAME

To view the source code for org.apache.solr SolrTestCaseJ4 DEFAULT_TEST_CORENAME.

Click Source Link

Usage

From source file:org.alfresco.solr.AbstractAlfrescoSolrTests.java

License:Open Source License

/**
 * @deprecated as testHarness is used/* w  w w .  j a va2s.com*/
 */
@Deprecated
public static void createAlfrescoCore(String schema)
        throws ParserConfigurationException, IOException, SAXException {
    Properties properties = new Properties();
    properties.put("solr.tests.maxBufferedDocs", "1000");
    properties.put("solr.tests.maxIndexingThreads", "10");
    properties.put("solr.tests.ramBufferSizeMB", "1024");
    properties.put("solr.tests.mergeScheduler", "org.apache.lucene.index.ConcurrentMergeScheduler");
    properties.put("alfresco.acl.tracker.cron", "0/10 * * * * ? *");
    properties.put("alfresco.content.tracker.cron", "0/10 * * * * ? *");
    properties.put("alfresco.metadata.tracker.cron", "0/10 * * * * ? *");
    properties.put("alfresco.cascade.tracker.cron", "0/10 * * * * ? *");
    properties.put("alfresco.commit.tracker.cron", "0/10 * * * * ? *");
    if ("schema.xml".equalsIgnoreCase(schema)) {
        String templateName = System.getProperty("templateName", "rerank");
        FileUtils.copyFile(Paths.get(String.format(TEMPLATE_CONF, templateName) + schema).toFile(),
                Paths.get(TEST_SOLR_CONF + schema).toFile());
    }

    SolrResourceLoader resourceLoader = new SolrResourceLoader(Paths.get(TEST_FILES_LOCATION), null,
            properties);
    TestCoresLocator locator = new TestCoresLocator(SolrTestCaseJ4.DEFAULT_TEST_CORENAME, "data",
            "solrconfig.xml", schema);

    NodeConfig nodeConfig = new NodeConfig.NodeConfigBuilder("name", resourceLoader).setUseSchemaCache(false)
            .setCoreAdminHandlerClass(AlfrescoCoreAdminHandler.class.getName()).build();
    try {
        h = new TestHarness(nodeConfig, locator);
        h.coreName = SolrTestCaseJ4.DEFAULT_TEST_CORENAME;
        CORE_NOT_YET_CREATED = false;
    } catch (Exception e) {
        LOG.info("we hit an issue", e);
    }
    lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
}