use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do09StaticResourceTest.
@Test
public void do09StaticResourceTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
File folder = temporaryFolder.newFolder();
copyResourceToFile("/webapp", folder);
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addExplodedWarApp(folder.getPath(), null, "/staticResource");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/staticResource/index.html"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do16SslExplodedWarFromClasspathTest.
@Test
public void do16SslExplodedWarFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
JettyBootstrap jettyBootstrap = initServer(true);
jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null, "/sslExplodedWarFromClasspath");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/sslExplodedWarFromClasspath/index.html"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do05StaticWarFromClasspathTest.
@Test
public void do05StaticWarFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addWarAppFromClasspath("/static.war", "/staticWarFromClasspath");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "test1content\n"), get("/staticWarFromClasspath/test1.html"));
Assert.assertEquals(new SimpleResponse(200, "test2content\n"), get("/staticWarFromClasspath/test2.html"));
Assert.assertEquals(new Integer(404), get("/test3.html").getStatusCode());
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do10SslStaticResourceTest.
@Test
public void do10SslStaticResourceTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
File folder = temporaryFolder.newFolder();
copyResourceToFile("/webapp", folder);
JettyBootstrap jettyBootstrap = initServer(true);
jettyBootstrap.addExplodedWarApp(folder.getPath(), null, "/sslStaticResource");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/sslStaticResource/index.html"));
}
use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.
the class JettyBootstrapTest method do13ExplodedWarTest.
@Test
public void do13ExplodedWarTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
File folder = temporaryFolder.newFolder();
copyResourceToFile("/webapp", folder);
JettyBootstrap jettyBootstrap = initServer(false);
jettyBootstrap.addExplodedWarApp(folder.getPath(), null, "/explodedWar");
jettyBootstrap.startServer();
Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/explodedWar/index.html"));
}
Aggregations