Search in sources :

Example 21 with JettyBootstrap

use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.

the class JettyBootstrapTest method do14SslExplodedWarTest.

@Test
public void do14SslExplodedWarTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, URISyntaxException {
    File folder = temporaryFolder.newFolder();
    copyResourceToFile("/webapp", folder);
    JettyBootstrap jettyBootstrap = initServer(true);
    jettyBootstrap.addExplodedWarApp(folder.getPath(), null, "/sslExplodedWar");
    jettyBootstrap.startServer();
    Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/sslExplodedWar/index.html"));
}
Also used : JettyBootstrap(org.teknux.jettybootstrap.JettyBootstrap) File(java.io.File) Test(org.junit.Test)

Example 22 with JettyBootstrap

use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.

the class JettyBootstrapTest method do11StaticResourceFromClasspathTest.

@Test
public void do11StaticResourceFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
    JettyBootstrap jettyBootstrap = initServer(false);
    jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null, "/staticResourceFromClasspath");
    jettyBootstrap.startServer();
    Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/staticResourceFromClasspath/index.html"));
}
Also used : JettyBootstrap(org.teknux.jettybootstrap.JettyBootstrap) Test(org.junit.Test)

Example 23 with JettyBootstrap

use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.

the class JettyBootstrapTest method do07ServletWarFromClasspathTest.

@Test
public void do07ServletWarFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
    JettyBootstrap jettyBootstrap = initServer(false);
    jettyBootstrap.addWarAppFromClasspath("/servlet.war", "/servletWarFromClasspath");
    jettyBootstrap.startServer();
    Assert.assertEquals(new SimpleResponse(200, "Value=value1" + LINE_SEPARATOR), get("/servletWarFromClasspath?value=value1"));
    Assert.assertEquals(new SimpleResponse(200, "Value=value2" + LINE_SEPARATOR), get("/servletWarFromClasspath?value=value2"));
}
Also used : JettyBootstrap(org.teknux.jettybootstrap.JettyBootstrap) Test(org.junit.Test)

Example 24 with JettyBootstrap

use of org.teknux.jettybootstrap.JettyBootstrap in project jetty-bootstrap by teknux-org.

the class JettyBootstrapTest method do12SslStaticResourceFromClasspathTest.

@Test
public void do12SslStaticResourceFromClasspathTest() throws IllegalStateException, IOException, JettyBootstrapException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
    JettyBootstrap jettyBootstrap = initServer(true);
    jettyBootstrap.addExplodedWarAppFromClasspath("/webapp", null, "/sslStaticResourceFromClasspath");
    jettyBootstrap.startServer();
    Assert.assertEquals(new SimpleResponse(200, "StaticResContent\n"), get("/sslStaticResourceFromClasspath/index.html"));
}
Also used : JettyBootstrap(org.teknux.jettybootstrap.JettyBootstrap) Test(org.junit.Test)

Aggregations

JettyBootstrap (org.teknux.jettybootstrap.JettyBootstrap)24 Test (org.junit.Test)22 File (java.io.File)9 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)2 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)2 JettyConfiguration (org.teknux.jettybootstrap.configuration.JettyConfiguration)1