WebContainer servletEngine = new WebContainer(new CompareParametersServlet());
servletEngine.start();
// start xSocket
Server server = new HttpServer(0, new CompareParametersHandler());
server.start();
// compare calls
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?print=¶m2= ");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?test=12&test=zwei");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/over/there/index.dtb;type=animal?name=ferret#nose");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test+2");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?print=&print=tr");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?print=tr&print=");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?print=");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/wiki/Comet_%28programming%29");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/wiki/Comet_(programming)");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test/test2#fragment");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test/tee?aa=33&bb=44&aa=55");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?" + URLEncoder.encode("Schl�ssel", "UTF-8") + "=" + URLEncoder.encode("Sch�n", "UTF-8"));
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?key=" + URLEncoder.encode("important&confidential", "UTF-8"));
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test/tee?aa=33&bb=44");
callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test/");
// shutdown server
servletEngine.stop();
server.close();
}