I saw Jetty has got and ServletTest class which you can use to test Servlets.
tester = new ServletTester();
tester.setContextPath("/");
tester.addServlet(TestServlet.class, "/servlet/*");
...
tester.start();
Do you know if there is something similar in Tomcat? How could I test a servlet?