use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do20SslHandlerTest.
@Test
public void do20SslHandlerTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/sslHandler");
context.addServlet(new ServletHolder(new TestServlet()), "/*");
JettyBootstrap jettyBootstrap = initServer(true);
jettyBootstrap.addHandler(context);
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "ServletTestContent" + LINE_SEPARATOR), get("/sslHandler"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do17Self.
@Test
public void do17Self() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addSelf();
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/index.html"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do15ExplodedWarFromClasspathTest.
@Test
public void do15ExplodedWarFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null, "/explodedWarFromClasspath");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/explodedWarFromClasspath/index.html"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do03ServletWarTest.
@Test
public void do03ServletWarTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
File file = temporaryFolder.newFile();
copyResourceToFile("/servlet.war", file);
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addWarApp(file.getPath(), "/servletWar");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "Value=value1" + LINE_SEPARATOR), get("/servletWar?value=value1"));
Assert.assertEquals(new SimpleResponse(200, "Value=value2" + LINE_SEPARATOR), get("/servletWar?value=value2"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do18SslSelf.
@Test
public void do18SslSelf() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
JettyBootstrap jettyBootstrap = initServer(true);
jettyBootstrap.addSelf();
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/index.html"));
}
Aggregations