Search in sources :

Example 6 with PrivateWebserverForTest

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

the class TestHttps method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    VirtualFileClasspath metaFile = new VirtualFileClasspath("httpsMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), null, false, metaFile);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
    https11Socket = connectHttps(false, null, webserver.getUnderlyingHttpsChannel().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 7 with PrivateWebserverForTest

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

the class TestBootstrapTag method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    VirtualFileClasspath metaFile = new VirtualFileClasspath("tagsMeta.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 8 with PrivateWebserverForTest

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

the class TestScopes method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    // validate nothing here first
    Assert.assertEquals(new HashMap<>(), Context.getContext());
    VirtualFileClasspath metaFile = new VirtualFileClasspath("scopesMeta.txt", PrivateWebserverForTest.class.getClassLoader());
    PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), null, false, metaFile);
    webserver.start();
    http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
    // not exactly part of this test but checking for leak of server context into client
    // (only in embedded modes does this occur)
    Assert.assertEquals(new HashMap<>(), Context.getContext());
}
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 9 with PrivateWebserverForTest

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

the class TestFieldTag method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    VirtualFileClasspath metaFile = new VirtualFileClasspath("tagsMeta.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 10 with PrivateWebserverForTest

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

the class TestFormTag method setUp.

@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
    VirtualFileClasspath metaFile = new VirtualFileClasspath("tagsMeta.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)

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