use of org.webpieces.webserver.api.ServerConfig in project webpieces by deanhiller.
the class FeatureTest method startServer.
@Override
protected void startServer() {
metrics = new SimpleMeterRegistry();
Server webserver = new Server(getOverrides(metrics), new AppOverridesModule(), new ServerConfig(JavaCache.getCacheLocation()), args);
webserver.start();
serverHttpsAddr = new InetSocketAddress("localhost", webserver.getUnderlyingHttpsChannel().getLocalAddress().getPort());
serverHttpAddr = new InetSocketAddress("localhost", webserver.getUnderlyingHttpChannel().getLocalAddress().getPort());
}
use of org.webpieces.webserver.api.ServerConfig in project webpieces by deanhiller.
the class TestLesson7AdvancedCookiesCrud method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {
log.info("Setting up test");
Asserts.assertWasCompiledWithParamNames("test");
// clear in-memory database
jdbc.dropAllTablesFromDatabase();
SimpleMeterRegistry 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 you can no longer run single threaded(tradeoffs, tradeoffs)
// This is however pretty fast to do in many systems...
Server webserver = new Server(getOverrides(metrics), null, new ServerConfig(JavaCache.getCacheLocation()), args);
webserver.start();
HttpSocket https11Socket = connectHttps(null, webserver.getUnderlyingHttpChannel().getLocalAddress());
webBrowser = new WebBrowserSimulator(https11Socket);
}
use of org.webpieces.webserver.api.ServerConfig in project webpieces by deanhiller.
the class TestLesson3Errors method setUp.
@Before
public void setUp() throws InterruptedException, ClassNotFoundException, ExecutionException, TimeoutException {
Asserts.assertWasCompiledWithParamNames("test");
// clear in-memory database
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 you can no longer run single threaded(tradeoffs, tradeoffs)
// This is however pretty fast to do in many systems...
Server webserver = new Server(getOverrides(metrics), new AppOverridesModule(), new ServerConfig(JavaCache.getCacheLocation()), args);
webserver.start();
http11Socket = connectHttp(webserver.getUnderlyingHttpChannel().getLocalAddress());
}
use of org.webpieces.webserver.api.ServerConfig 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