Search in sources :

Example 21 with PrivateWebserverForTest

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

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

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

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

the class TestTokenDollarSign method setUp.

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

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

the class TestIncludeTypeTags method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    Module allOverrides = Modules.combine(getOverrides(false, new SimpleMeterRegistry()), new TagOverridesModule(TagOverrideLookupForTesting.class));
    VirtualFileClasspath metaFile = new VirtualFileClasspath("tagsMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(allOverrides, null, false, metaFile);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Also used : TagOverridesModule(org.webpieces.webserver.api.TagOverridesModule) PrivateWebserverForTest(org.webpieces.webserver.PrivateWebserverForTest) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) Module(com.google.inject.Module) TagOverridesModule(org.webpieces.webserver.api.TagOverridesModule) 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