use of org.webpieces.webserver.PrivateWebserverForTest in project webpieces by deanhiller.
the class SeleniumBasicTest method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
Asserts.assertWasCompiledWithParamNames("test");
// you may want to create this server ONCE in a static method BUT if you do, also remember to clear out all your
// mocks after every test AND you can no longer run multi-threaded(tradeoffs, tradeoffs)
// This is however pretty fast to do in many systems...
PrivateWebserverForTest webserver = new PrivateWebserverForTest(new OverridesForTestRealServer(new SimpleMeterRegistry()), new AppOverridesModule(), true, null);
webserver.start();
port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
use of org.webpieces.webserver.PrivateWebserverForTest in project webpieces by deanhiller.
the class TestSynchronousErrors method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {
Asserts.assertWasCompiledWithParamNames("test");
// you may want to create this server ONCE in a static method BUT if you do, also remember to clear out all your
// mocks after every test AND you can no longer run single threaded(tradeoffs, tradeoffs)
// This is however pretty fast to do in many systems...
PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), new AppOverridesModule(), false, null);
webserver.start();
http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
use of org.webpieces.webserver.PrivateWebserverForTest in project webpieces by deanhiller.
the class TestBeansAndSplit method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
VirtualFileClasspath metaFile = new VirtualFileClasspath("beansMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), new AppOverridesModule(), false, metaFile);
webserver.start();
channel.setDataListener(new DataReceiver());
ConnectionListener listener = mgr.getHttpConnection();
XFuture<DataListener> future = listener.connected(channel, true);
dataListener = future.get(2, TimeUnit.SECONDS);
}
use of org.webpieces.webserver.PrivateWebserverForTest in project webpieces by deanhiller.
the class TestUrlHtmlEncoding method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
VirtualFileClasspath metaFile = new VirtualFileClasspath("beansMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), null, false, metaFile);
webserver.start();
http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
use of org.webpieces.webserver.PrivateWebserverForTest in project webpieces by deanhiller.
the class TestI18n method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException {
Context.clear();
VirtualFileClasspath metaFile = new VirtualFileClasspath("i18nMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(getOverrides(false, new SimpleMeterRegistry()), null, false, metaFile);
webserver.start();
http11Socket = connectHttp(false, webserver.getUnderlyingHttpChannel().getLocalAddress());
}
Aggregations