Skip to content

Commit

Permalink
[PAXWEB-984] Improve Integration-Tests
Browse files Browse the repository at this point in the history
Commented lines with the former testWebpath-method have been removed now that all tests are running.
  • Loading branch information
lostiniceland committed Aug 10, 2016
1 parent 1d73f64 commit 8020b01
Show file tree
Hide file tree
Showing 112 changed files with 1 addition and 1,372 deletions.
Expand Up @@ -85,9 +85,6 @@ public void testMultipleServiceCombination() throws Exception {
resp -> resp.contains("FILTER-INIT: true"))
.doGETandExecuteTest("http://127.0.0.1:8181/crosservice");

// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "TEST OK");
// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "FILTER-INIT: true");

registerService.unregister();

httpService.unregister("/crosservice");
Expand Down Expand Up @@ -115,9 +112,6 @@ public void testMultipleServiceCombinationWithDefaultHttpContext() throws Except
resp -> resp.contains("FILTER-INIT: true"))
.doGETandExecuteTest("http://127.0.0.1:8181/crosservice");

// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "TEST OK");
// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "FILTER-INIT: true");

registerService.unregister();

httpService.unregister("/crosservice");
Expand Down Expand Up @@ -147,9 +141,6 @@ public void testMultipleServiceCombinationWithWebContainer() throws Exception {
resp -> resp.contains("FILTER-INIT: true"))
.doGETandExecuteTest("http://127.0.0.1:8181/crosservice");

// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "TEST OK");
// testClient.testWebPath("http://127.0.0.1:8181/crosservice", "FILTER-INIT: true");

wcService.unregisterFilter(new SimpleFilter());
httpService.unregister("/crosservice");

Expand Down
Expand Up @@ -42,15 +42,6 @@ public static Option[] configure() {
return configureJetty();
}

@Before
public void setUp() throws BundleException, InterruptedException {
}

@After
public void tearDown() throws BundleException {
}


@Test
public void testSimpleFilter() throws Exception {
super.testSimpleFilter();
Expand All @@ -72,8 +63,6 @@ public void testFilterWar() throws Exception {
resp -> resp.contains("Filtered"))
.doGETandExecuteTest("http://127.0.0.1:8181/web-filter/me.filter");

// testClient.testWebPath("http://127.0.0.1:8181/web-filter/me.filter",
// "Filtered");

installWarBundle.uninstall();

Expand Down
Expand Up @@ -65,9 +65,6 @@ public void testRoot() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/", "Session:");
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", null);
}

}
Expand Up @@ -99,19 +99,12 @@ public void testSubPath() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/helloworld/hs", "Hello World");
//
// //test to retrive Image
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", "", 200, false);
}

@Test
public void testRootPath() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/");

// testClient.testWebPath("http://127.0.0.1:8181/", "");
}

@Test
Expand All @@ -122,9 +115,6 @@ public void testServletPath() throws Exception {
.withResponseAssertion("Response must contain 'Path Info: /lall/blubb'",
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:8181/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Path Info: /lall/blubb");
}

@Test
Expand Down Expand Up @@ -153,8 +143,6 @@ public void testRegisterServlet() throws Exception {
.withResponseAssertion("Response must contain 'TEST OK'",
resp -> resp.contains("TEST OK"))
.doGETandExecuteTest("http://127.0.0.1:8181/test");

// testClient.testWebPath("http://127.0.0.1:8181/test", "TEST OK");
}

@Test
Expand Down Expand Up @@ -182,9 +170,6 @@ public void testRegisterMultipleServlets() throws Exception {
.withResponseAssertion("Response must contain 'TEST OK'",
resp -> resp.contains("TEST OK"))
.doGETandExecuteTest("http://127.0.0.1:8181/test2");

// testClient.testWebPath("http://127.0.0.1:8181/test1", "TEST OK");
// testClient.testWebPath("http://127.0.0.1:8181/test2", "TEST OK");
}

/**
Expand Down Expand Up @@ -227,8 +212,6 @@ public void testRegisterMultipleServletsSameContext() throws Exception {
resp -> resp.contains("TEST OK"))
.doGETandExecuteTest("http://127.0.0.1:8181/test1");

// testClient.testWebPath("http://127.0.0.1:8181/test1", "TEST OK");

TestServlet servlet2 = new TestServlet();
httpService.registerServlet("/test2", servlet2, null, httpContext1.get());
Assert.assertTrue("Servlet.init(ServletConfig) was not called", servlet2.isInitCalled());
Expand All @@ -254,9 +237,6 @@ public void testRegisterMultipleServletsSameContext() throws Exception {
.withResponseAssertion("Response must contain 'TEST OK'",
resp -> resp.contains("TEST OK"))
.doGETandExecuteTest("http://127.0.0.1:8181/test2");

// testClient.testWebPath("http://127.0.0.1:8181/test1", "TEST OK");
// testClient.testWebPath("http://127.0.0.1:8181/test2", "TEST OK");
}

/**
Expand Down Expand Up @@ -301,8 +281,6 @@ public void testRegisterServletToWarContext() throws Exception {
resp -> resp.contains("Hello, World, from JSP"))
.doGETandExecuteTest("http://127.0.0.1:8181/war");

// testClient.testWebPath("http://127.0.0.1:8181/war", "Hello, World, from JSP");

// ---

final HttpService httpService = getHttpService(installWarBundle.getBundleContext());
Expand Down Expand Up @@ -340,9 +318,6 @@ public void testRegisterServletToWarContext() throws Exception {
.withResponseAssertion("Response must contain 'TEST OK'",
resp -> resp.contains("TEST OK"))
.doGETandExecuteTest("http://127.0.0.1:8181/war/test2");

// testClient.testWebPath("http://127.0.0.1:8181/war", "Hello, World, from JSP");
// testClient.testWebPath("http://127.0.0.1:8181/war/test2", "TEST OK");
}


Expand Down Expand Up @@ -405,14 +380,6 @@ public void destroy() {
resp -> resp.contains("content is Filtered by"))
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/test-context/some/random/path", expectedContent);
// testClient.testWebPath("http://127.0.0.1:8181/test-context/some/notregistered/random/path", expectedContent);
// testClient.testWebPath("http://127.0.0.1:8181/test-context/", expectedContent);
// //Even for existing path!
// testClient.testWebPath("http://127.0.0.1:8181/helloworld/hs", expectedContent);
// //And even for images
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", expectedContent);

//of course we should be able to deregister :-)
service.unregisterFilter(filter);
tracker.close();
Expand All @@ -432,9 +399,6 @@ public void testFilterOnly() throws Exception {
resp -> resp.contains("Hello Whiteboard Filter"))
.doGETandExecuteTest("http://127.0.0.1:8181/testFilter/filterMe");

// testClient.testWebPath("http://127.0.0.1:8181/testFilter/filterMe",
// "Hello Whiteboard Filter");

service.unregisterFilter(filter);
}

Expand Down
Expand Up @@ -93,18 +93,12 @@ public void testSubPath() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/helloworld/hs", "Hello World");
// //test to retrive Image
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", "", 200, false);
}

@Test
public void testRootPath() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/");

// testClient.testWebPath("http://127.0.0.1:8181/", "");
}

@Test
Expand All @@ -116,9 +110,6 @@ public void testServletPath() throws Exception {
.withResponseAssertion("Response must contain 'Path Info: /lall/blubb'",
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:8181/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Path Info: /lall/blubb");
}

@Test
Expand All @@ -143,11 +134,6 @@ public void testReconfiguration() throws Exception {
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:8181/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb",
// "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb",
// "Path Info: /lall/blubb");

org.osgi.service.cm.Configuration config = caService.getConfiguration(WebContainerConstants.PID);

Dictionary<String, Object> props = new Hashtable<>();
Expand All @@ -166,9 +152,6 @@ public void testReconfiguration() throws Exception {
.withResponseAssertion("Response must contain 'Path Info: /lall/blubb'",
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:9191/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:9191/lall/blubb", "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:9191/lall/blubb", "Path Info: /lall/blubb");
}

}
Expand Up @@ -68,18 +68,12 @@ public void testSubPath() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/helloworld/hs", "Hello World");
// //test to retrive Image
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", "", 200, false);
}

@Test
public void testRootPath() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/");

// testClient.testWebPath("http://127.0.0.1:8181/", "");
}

@Test
Expand All @@ -90,9 +84,6 @@ public void testServletPath() throws Exception {
.withResponseAssertion("Response must contain 'Path Info: /lall/blubb'",
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:8181/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Path Info: /lall/blubb");
}

@Test
Expand All @@ -102,6 +93,4 @@ public void testServletDeRegistration() throws Exception {
installWarBundle.stop();
}
}


}
Expand Up @@ -84,9 +84,6 @@ public void testRoot() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/success.png");

// testClient.testWebPath("http://127.0.0.1:8181/", "New session created");
// testClient.testWebPath("http://127.0.0.1:8181/images/success.png", null, 200, false);
}

}
Expand Up @@ -82,9 +82,6 @@ public void testLoginPage() throws Exception {
.withResponseAssertion("Response must contain '<H1> Enter your username and password to login </H1>'",
resp -> resp.contains("<H1> Enter your username and password to login </H1>"))
.doGETandExecuteTest("http://127.0.0.1:8181/test-annotation-webapp/login.html");

// testClient.testWebPath("http://127.0.0.1:8181/test-annotation-webapp/login.html",
// "<H1> Enter your username and password to login </H1>");
}

}
Expand Up @@ -56,7 +56,6 @@ public static Option[] configure() {
.version(VersionUtil.getProjectVersion())

));

}

@Before
Expand Down Expand Up @@ -86,19 +85,12 @@ public void testSubPath() throws Exception {
// test image-serving
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/images/logo.png");

// testClient.testWebPath("http://127.0.0.1:8181/helloworld/hs", "Hello World");
// // test to retrive Image
// testClient.testWebPath("http://127.0.0.1:8181/images/logo.png", "", 200, false);

}

@Test
public void testRootPath() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.doGETandExecuteTest("http://127.0.0.1:8181/");

// testClient.testWebPath("http://127.0.0.1:8181/", "");
}

@Test
Expand All @@ -109,11 +101,6 @@ public void testServletPath() throws Exception {
.withResponseAssertion("Response must contain 'Path Info: /lall/blubb'",
resp -> resp.contains("Path Info: /lall/blubb"))
.doGETandExecuteTest("http://127.0.0.1:8181/lall/blubb");

// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb", "Servlet Path: ");
// testClient.testWebPath("http://127.0.0.1:8181/lall/blubb",
// "Path Info: /lall/blubb");

}

@Test
Expand Down
Expand Up @@ -87,26 +87,20 @@ public void testWeb() throws Exception {
.withResponseAssertion("Response must contain '<h1>Hello World</h1>'",
resp -> resp.contains("<h1>Hello World</h1>"))
.doGETandExecuteTest("http://localhost:8181/test/wc/example");

// testClient.testWebPath("http://localhost:8181/test/wc/example", "<h1>Hello World</h1>");
}

@Test
public void testWebIP() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.withReturnCode(404)
.doGETandExecuteTest("http://127.0.0.1:8181/test/wc/example");

// testClient.testWebPath("http://127.0.0.1:8181/test/wc/example", 404);
}

@Test
public void testWebJettyIP() throws Exception {
HttpTestClientFactory.createDefaultTestClient()
.withReturnCode(404)
.doGETandExecuteTest("http://127.0.0.1:8282/test/wc/example");

// testClient.testWebPath("http://127.0.0.1:8282/test/wc/example", 404);
}

@Test
Expand All @@ -115,8 +109,5 @@ public void testWebJetty() throws Exception {
.withResponseAssertion("Response must contain '<h1>Hello World</h1>'",
resp -> resp.contains("<h1>Hello World</h1>"))
.doGETandExecuteTest("http://localhost:8282/test/wc/example");

// testClient.testWebPath("http://localhost:8282/test/wc/example",
// "<h1>Hello World</h1>");
}
}

0 comments on commit 8020b01

Please sign in to comment.