Search in sources :

Example 41 with PrivateWebserverForTest

use of org.webpieces.webserver.PrivateWebserverForTest 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)

Example 42 with PrivateWebserverForTest

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

the class TestAsynchronousErrors method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {
    Asserts.assertWasCompiledWithParamNames("test");
    VirtualFileClasspath metaFile = new VirtualFileClasspath("asyncMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), new AppOverridesModule(), false, metaFile);
    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) Before(org.junit.Before)

Example 43 with PrivateWebserverForTest

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

the class TestAsyncWebServer method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    VirtualFileClasspath metaFile = new VirtualFileClasspath("asyncMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), new AppOverridesModule(), false, metaFile);
    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) Before(org.junit.Before)

Aggregations

SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)43 PrivateWebserverForTest (org.webpieces.webserver.PrivateWebserverForTest)43 Before (org.junit.Before)42 VirtualFileClasspath (org.webpieces.util.file.VirtualFileClasspath)37 Module (com.google.inject.Module)4 JdbcApi (org.webpieces.ddl.api.JdbcApi)4 PrivateTestConfig (org.webpieces.webserver.PrivateTestConfig)4 OverridesForTestRealServer (org.webpieces.webserver.test.OverridesForTestRealServer)4 ArrayList (java.util.ArrayList)2 TemplateCompileConfig (org.webpieces.templatingdev.api.TemplateCompileConfig)2 VirtualFile (org.webpieces.util.file.VirtualFile)2 OverridesForEmbeddedSvrWithParsing (org.webpieces.webserver.test.OverridesForEmbeddedSvrWithParsing)2 File (java.io.File)1 Test (org.junit.Test)1 CompileConfig (org.webpieces.compiler.api.CompileConfig)1 TwoPools (org.webpieces.data.api.TwoPools)1 DevRouterModule (org.webpieces.devrouter.api.DevRouterModule)1 HttpSocket (org.webpieces.httpclient11.api.HttpSocket)1 ConnectionListener (org.webpieces.nio.api.handlers.ConnectionListener)1 DataListener (org.webpieces.nio.api.handlers.DataListener)1