use of org.webpieces.webserver.test.OverridesForTestRealServer 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.test.OverridesForTestRealServer in project webpieces by deanhiller.
the class TestPRGSelenium method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
Asserts.assertWasCompiledWithParamNames("test");
VirtualFileClasspath metaFile = new VirtualFileClasspath("beansMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(new OverridesForTestRealServer(new SimpleMeterRegistry()), new AppOverridesModule(), true, metaFile);
webserver.start();
port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
use of org.webpieces.webserver.test.OverridesForTestRealServer in project webpieces by deanhiller.
the class TestStaticSelenium method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
Asserts.assertWasCompiledWithParamNames("test");
VirtualFileClasspath metaFile = new VirtualFileClasspath("staticMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(new OverridesForTestRealServer(new SimpleMeterRegistry()), null, true, metaFile);
webserver.start();
port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
use of org.webpieces.webserver.test.OverridesForTestRealServer in project webpieces by deanhiller.
the class TestScopesSelenium method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
Asserts.assertWasCompiledWithParamNames("test");
VirtualFileClasspath metaFile = new VirtualFileClasspath("scopesMeta.txt", PrivateWebserverForTest.class.getClassLoader());
PrivateWebserverForTest webserver = new PrivateWebserverForTest(new OverridesForTestRealServer(new SimpleMeterRegistry()), null, true, metaFile);
webserver.start();
port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
use of org.webpieces.webserver.test.OverridesForTestRealServer in project webpieces by deanhiller.
the class TestLesson5WithSelenium method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
driver = new FirefoxDriver();
Asserts.assertWasCompiledWithParamNames("test");
jdbc.dropAllTablesFromDatabase();
metrics = new SimpleMeterRegistry();
// 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 NOT drop tables but clear and re-populate
Server webserver = new Server(new OverridesForTestRealServer(metrics), new AppOverridesModule(), new ServerConfig(JavaCache.getCacheLocation()), args);
webserver.start();
httpPort = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
httpsPort = webserver.getUnderlyingHttpsChannel().getLocalAddress().getPort();
}
Aggregations