Package com.findwise.hydra

Examples of com.findwise.hydra.CoreConfiguration


 
  private static RESTServer server;

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    CoreConfiguration conf = ConfigurationFactory.getConfiguration(TEST_NAME);
    new MongoClient(new MongoClientURI(conf.getDatabaseUrl())).getDB(TEST_NAME).dropDatabase();
    dbc = new MongoConnector(conf);
   
    ShutdownHandler shutdownHandler = Mockito.mock(ShutdownHandler.class);
   
    Mockito.when(shutdownHandler.isShuttingDown()).thenReturn(false);
View Full Code Here


    dbc.getDocumentWriter().deleteAll();
  }
 
  @AfterClass
  public static void tearDownClass() throws Exception {
    CoreConfiguration conf = ConfigurationFactory.getConfiguration(TEST_NAME);
    new MongoClient(new MongoClientURI(conf.getDatabaseUrl())).getDB(TEST_NAME).dropDatabase();
  }
View Full Code Here

public class RESTServerTest {

  @Test
  public void testBlockingStart() throws IOException, InterruptedException {
    CoreConfiguration conf = ConfigurationFactory.getConfiguration("jUnit-RESTServerTest");
    MongoConnector dbc = new MongoConnector(conf);
    int port = conf.getRestPort();
    RESTServer server1 = new RESTServer(conf, new HttpRESTHandler<MongoType>(dbc));
   
    if(!server1.blockingStart()) {
      server1 = RESTServer.getNewStartedRESTServer(port, new HttpRESTHandler<MongoType>(dbc));
    }
View Full Code Here

    server2.shutdown();
  }

  @Test
  public void testShutdown() throws IOException, InterruptedException {
    CoreConfiguration conf = ConfigurationFactory.getConfiguration("jUnit-RESTServerTest");
    RESTServer server = RESTServer.getNewStartedRESTServer(conf.getRestPort(), new HttpRESTHandler<MongoType>(new MongoConnector(conf)));
    server.shutdown();
    Thread.sleep(1000);
    if(server.isAlive()) {
      fail("Thread should be dead");
    }
View Full Code Here

TOP

Related Classes of com.findwise.hydra.CoreConfiguration

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.