Check out ServletUnit, which is part of HttpUnit. In a nutshell, ServletUnit provides a library of mocks and utilities you can use in ordinary JUnit tests to mock out a servlet container and other servlet-related objects like request and response objects. The link above contains examples.
More Related Contents:
- java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted
- java.lang.IllegalArgumentException: The main resource set specified […] is not valid
- Where is the deployment directory in Eclipse?
- ClassNotFoundException when using User Libraries in Eclipse build path
- Tomcat started in Eclipse but unable to connect to http://localhost:8085/
- What does “The APR based Apache Tomcat Native library was not found” mean?
- Set default home page via in JSF project
- Remote debugging Tomcat with Eclipse
- “Server Tomcat v7.0 Server at localhost failed to start” without stack trace while it works in terminal [closed]
- HTTP Status 404 – The requested resource (/ProjectName/) is not available
- Eclipse “Server Locations” section disabled and need to change to use Tomcat installation
- HTTP Status 404 – The requested resource (/) is not available
- Specifying a custom log4j.properties file for all of JUnit tests run from Eclipse
- java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
- java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
- How to test my servlet using JUnit
- How to use Tomcat 8 in Eclipse?
- Change Tomcat Server’s timeout in Eclipse
- Running a single JUnit test in Eclipse
- TOMCAT – HTTP Status 404 [duplicate]
- java.lang.NoClassDefFoundError in junit
- how to export (JUnit) test suite as executable jar
- Eclipse/Maven: JUnit tests not compiled when running them
- The import javax.servlet can’t be resolved [duplicate]
- Multiple contexts with the same path error running web service in Eclipse using Tomcat
- Jersey REST Web Service, Tomcat, Eclipse and 404’s
- Eclipse on-click deploy to remote Tomcat
- Running Maven project on Tomcat from Eclipse
- Tomcat Not Starting Through Eclipse (Timeout)
- Ivy fails to resolve a dependency, unable to find cause