Package com.github.jknack.mwa.solr

Source Code of com.github.jknack.mwa.solr.SolrModuleTest

package com.github.jknack.mwa.solr;

import static org.junit.Assert.assertNotNull;

import java.util.concurrent.TimeUnit;

import org.apache.solr.client.solrj.SolrServer;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SolrModuleTest {

  @Test
  public void bootSolr() throws InterruptedException {
    System.setProperty("solr.home", "/solr-home");

    AnnotationConfigApplicationContext context =
        new AnnotationConfigApplicationContext(SolrModule.class);

    SolrServer server1 = context.getBean("core1", SolrServer.class);
    assertNotNull(server1);

    SolrServer server2 = context.getBean("core2", SolrServer.class);
    assertNotNull(server2);

    Thread.sleep(TimeUnit.SECONDS.toMillis(5));
    context.destroy();
    context.close();
  }
}
TOP

Related Classes of com.github.jknack.mwa.solr.SolrModuleTest

TOP
Copyright © 2018 www.massapi.com. 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.