Package org.apache.stanbol.entityhub.yard.solr.impl

Examples of org.apache.stanbol.entityhub.yard.solr.impl.SolrYardConfig


        // use property substitution to test this feature!
        String prefix = System.getProperty("basedir") == null ? "." : "${basedir}";
        String solrServerDir = prefix + TEST_INDEX_REL_PATH;
        log.info("Test Solr Server Directory: {}", solrServerDir);
        System.setProperty(ManagedSolrServer.MANAGED_SOLR_DIR_PROPERTY, solrServerDir);
        SolrYardConfig config = new SolrYardConfig(TEST_YARD_ID, TEST_SOLR_CORE_NAME);
        config.setAllowInitialisation(false);
        config.setIndexConfigurationName(TEST_SOLR_CORE_CONFIGURATION); //the dbpedia default data
        config.setAllowInitialisation(true); //init from datafile provider
        config.setName("DBpedia.org default data");
        config.setDescription("Data used for FstLinkingEngie tests");
        // create the Yard used for the tests
        IndexReference solrIndexRef = IndexReference.parse(config.getSolrServerLocation());
       
        SolrServer server = StandaloneEmbeddedSolrServerProvider.getInstance().getSolrServer(
            solrIndexRef, config.getIndexConfigurationName());
        Assert.assertNotNull("Unable to initialise SolrServer for testing",server);
        core = ((EmbeddedSolrServer)server).getCoreContainer().getCore(
            solrIndexRef.getIndex());
        Assert.assertNotNull("Unable to get SolrCore '" + config.getIndexConfigurationName()
            + "' from SolrServer "+server, core);
        yard = new SolrYard(server,config,null);
        //setup the index configuration
        LanguageConfiguration langConf = new LanguageConfiguration("not.used",
            new String[]{"en;field=dbpedia-ont:surfaceForm;generate=true"});
View Full Code Here


     * Layout, lazy commits and a commitWithin duration of an minute
     * @param yardName the name of the yard
     * @param indexName the name of the index
     */
    private SolrYardConfig createSolrYardConfig(String yardName, String indexName) {
        SolrYardConfig solrYardConfig = new SolrYardConfig(yardName, indexName);
        solrYardConfig.setMultiYardIndexLayout(Boolean.FALSE);
        //use the lazy commit feature
        solrYardConfig.setImmediateCommit(Boolean.FALSE);
        solrYardConfig.setCommitWithinDuration(1000*60);//one minute
        return solrYardConfig;
    }
View Full Code Here

        // get the working directory
        // use property substitution to test this feature!
        String prefix = System.getProperty("basedir") == null ? "." : "${basedir}";
        String solrServerDir = prefix + TEST_INDEX_REL_PATH;
        log.info("Test Solr Server Directory: " + solrServerDir);
        SolrYardConfig config = new SolrYardConfig(TEST_YARD_ID, TEST_SOLR_CORE_NAME);
        config.setName("Solr Yard Test");
        config.setDescription("The Solr Yard instance used to execute the Unit Tests defined for the Yard Interface");
        config.setAllowInitialisation(true);
        //for unit testing we want immidiate commits (required after STANBOL-1092
        // as the default changed to false)
        config.setImmediateCommit(true);
        //init the ManagedSolrServer used for the UnitTest
        System.setProperty(ManagedSolrServer.MANAGED_SOLR_DIR_PROPERTY, solrServerDir);
        IndexReference solrServerRef = IndexReference.parse(config.getSolrServerLocation());
        solrServerProvider = StandaloneEmbeddedSolrServerProvider.getInstance();
        SolrServer server = solrServerProvider.getSolrServer(solrServerRef,
            config.isAllowInitialisation() ? config.getIndexConfigurationName() : null);
        //Optional support for the nsPrefix service
        final NamespacePrefixService nsPrefixService;
        ServiceLoader<NamespacePrefixService> spsl = ServiceLoader.load(NamespacePrefixService.class);
        Iterator<NamespacePrefixService> it = spsl.iterator();
        if(it.hasNext()){
View Full Code Here

     * Three unit tests that check that SolrYardConfig does throw IllegalArgumentExceptions when parsing an
     * illegal parameters.
     */
    @Test(expected = IllegalArgumentException.class)
    public void testSolrYardConfigInitWithNullParams() {
        new SolrYardConfig(null, null);
    }
View Full Code Here

        new SolrYardConfig(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testSolrYardConfigInitWithNullUrl() {
        new SolrYardConfig(TEST_YARD_ID, null);
    }
View Full Code Here

        new SolrYardConfig(TEST_YARD_ID, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testSolrYardConfigInitWithNullID() {
        new SolrYardConfig(null, TEST_SOLR_CORE_NAME);
    }
View Full Code Here

   
    public static final String TEST_SOLR_CORE_CONFIGURATION = "dbpedia_26k.solrindex.bz2";
    protected SolrYard yard;
   
    protected MockEntityhub(){
        SolrYardConfig config = new SolrYardConfig("dbpedia", "dbpedia");
        config.setIndexConfigurationName(TEST_SOLR_CORE_CONFIGURATION);
        config.setAllowInitialisation(true);
        IndexReference solrIndexRef = IndexReference.parse(config.getSolrServerLocation());
        SolrServer server = StandaloneEmbeddedSolrServerProvider.getInstance().getSolrServer(
            solrIndexRef, config.getIndexConfigurationName());
        Assert.assertNotNull("Unable to initialise SolrServer for testing",server);
        try {
            yard = new SolrYard(server,config,null);
            Representation paris = yard.getRepresentation("http://dbpedia.org/resource/Paris");
            if(paris == null){
View Full Code Here

        // use property substitution to test this feature!
        String prefix = System.getProperty("basedir") == null ? "." : "${basedir}";
        String solrServerDir = prefix + TEST_INDEX_REL_PATH;
        log.info("Test Solr Server Directory: {}", solrServerDir);
        System.setProperty(ManagedSolrServer.MANAGED_SOLR_DIR_PROPERTY, solrServerDir);
        SolrYardConfig config = new SolrYardConfig(TEST_YARD_ID, TEST_SOLR_CORE_NAME);
        config.setAllowInitialisation(false);
        config.setIndexConfigurationName(TEST_SOLR_CORE_CONFIGURATION); //the dbpedia default data
        config.setAllowInitialisation(true); //init from datafile provider
        config.setName("DBpedia.org default data");
        config.setDescription("Data used for the LDPath setup");
        // create the Yard used for the tests
        IndexReference solrIndexRef = IndexReference.parse(config.getSolrServerLocation());
       
        SolrServer server = StandaloneEmbeddedSolrServerProvider.getInstance().getSolrServer(
            solrIndexRef, config.getIndexConfigurationName());
        Assert.assertNotNull("Unable to initialise SolrServer for testing",server);
        yard = new SolrYard(server,config,null);
        backend = new YardBackend(yard);
    }
View Full Code Here

        // use property substitution to test this feature!
        String prefix = System.getProperty("basedir") == null ? "." : "${basedir}";
        String solrServerDir = prefix + TEST_INDEX_REL_PATH;
        log.info("Test Solr Server Directory: " + solrServerDir);
        System.setProperty(ManagedSolrServer.MANAGED_SOLR_DIR_PROPERTY, solrServerDir);
        SolrYardConfig config = new SolrYardConfig(TEST_YARD_ID, TEST_SOLR_CORE_NAME);
        config.setName("Solr Yard Test");
        config.setDescription("The Solr Yard instance used to execute the Unit Tests defined for the Yard Interface");
        //use the default Solr Index configuration for this tests
        config.setDefaultInitialisation(true);
        // create the Yard used for the tests
        yard = new SolrYard(config);
    }
View Full Code Here

     * Three unit tests that check that SolrYardConfig does throw IllegalArgumentExceptions when parsing an
     * illegal parameters.
     */
    @Test(expected = IllegalArgumentException.class)
    public void testSolrYardConfigInitWithNullParams() {
        new SolrYardConfig(null, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.yard.solr.impl.SolrYardConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.