Search in sources :

Example 1 with PrivateTestConfig

use of org.webpieces.webserver.PrivateTestConfig in project webpieces by deanhiller.

the class TestAsyncHibernate method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    // clear in-memory database
    JdbcApi jdbc = JdbcFactory.create(JdbcConstants.jdbcUrl, JdbcConstants.jdbcUser, JdbcConstants.jdbcPassword);
    jdbc.dropAllTablesFromDatabase();
    mockExecutor.clear();
    VirtualFileClasspath metaFile = new VirtualFileClasspath("plugins/hibernateMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateTestConfig config = new PrivateTestConfig();
    config.setPlatformOverrides(getOverrides(false, new SimpleMeterRegistry()));
    config.setAppOverrides(new TestOverrides());
    config.setMetaFile(metaFile);
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(config);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Also used : PrivateWebserverForTest(org.webpieces.webserver.PrivateWebserverForTest) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) JdbcApi(org.webpieces.ddl.api.JdbcApi) PrivateTestConfig(org.webpieces.webserver.PrivateTestConfig) Before(org.junit.Before)

Example 2 with PrivateTestConfig

use of org.webpieces.webserver.PrivateTestConfig in project webpieces by deanhiller.

the class TestAjaxHibernate method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    // clear in-memory database
    JdbcApi jdbc = JdbcFactory.create(JdbcConstants.jdbcUrl, JdbcConstants.jdbcUser, JdbcConstants.jdbcPassword);
    jdbc.dropAllTablesFromDatabase();
    VirtualFileClasspath metaFile = new VirtualFileClasspath("plugins/hibernateMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateTestConfig config = new PrivateTestConfig();
    config.setPlatformOverrides(getOverrides(false, new SimpleMeterRegistry()));
    config.setAppOverrides(new TestModule());
    config.setMetaFile(metaFile);
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(config);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Also used : PrivateWebserverForTest(org.webpieces.webserver.PrivateWebserverForTest) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) JdbcApi(org.webpieces.ddl.api.JdbcApi) PrivateTestConfig(org.webpieces.webserver.PrivateTestConfig) Before(org.junit.Before)

Example 3 with PrivateTestConfig

use of org.webpieces.webserver.PrivateTestConfig in project webpieces by deanhiller.

the class TestFlashAndSelect method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    // clear in-memory database
    JdbcApi jdbc = JdbcFactory.create(JdbcConstants.jdbcUrl, JdbcConstants.jdbcUser, JdbcConstants.jdbcPassword);
    jdbc.dropAllTablesFromDatabase();
    user = loadDataInDb();
    VirtualFileClasspath metaFile = new VirtualFileClasspath("plugins/hibernateMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateTestConfig config = new PrivateTestConfig();
    config.setPlatformOverrides(getOverrides(false, new SimpleMeterRegistry()));
    config.setMetaFile(metaFile);
    config.setAppOverrides(new TestModule(mock));
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(config);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Also used : PrivateWebserverForTest(org.webpieces.webserver.PrivateWebserverForTest) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) JdbcApi(org.webpieces.ddl.api.JdbcApi) PrivateTestConfig(org.webpieces.webserver.PrivateTestConfig) Before(org.junit.Before)

Example 4 with PrivateTestConfig

use of org.webpieces.webserver.PrivateTestConfig in project webpieces by deanhiller.

the class TestSyncHibernate method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    // clear in-memory database
    JdbcApi jdbc = JdbcFactory.create(JdbcConstants.jdbcUrl, JdbcConstants.jdbcUser, JdbcConstants.jdbcPassword);
    jdbc.dropAllTablesFromDatabase();
    VirtualFileClasspath metaFile = new VirtualFileClasspath("plugins/hibernateMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateTestConfig config = new PrivateTestConfig();
    config.setPlatformOverrides(getOverrides(false, new SimpleMeterRegistry()));
    config.setMetaFile(metaFile);
    config.setAppOverrides(new TestModule(mock));
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(config);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Also used : PrivateWebserverForTest(org.webpieces.webserver.PrivateWebserverForTest) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) JdbcApi(org.webpieces.ddl.api.JdbcApi) PrivateTestConfig(org.webpieces.webserver.PrivateTestConfig) Before(org.junit.Before)

Aggregations

SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)4 Before (org.junit.Before)4 JdbcApi (org.webpieces.ddl.api.JdbcApi)4 VirtualFileClasspath (org.webpieces.util.file.VirtualFileClasspath)4 PrivateTestConfig (org.webpieces.webserver.PrivateTestConfig)4 PrivateWebserverForTest (org.webpieces.webserver.PrivateWebserverForTest)4