Questions tagged [servletunit]

9 questions
3
votes
2 answers

example of using ServletUnit to test JSP's

Can anyone point me to an example of how to use ServletUnit to test JSP's? Do I need I need to call registerServlet()? If so, what class name do I pass?
Clint Miller
  • 15,173
  • 4
  • 37
  • 39
2
votes
1 answer

Test the jsp pages which includes jstl code in servlet using Httpunit and Servlet unit

I am trying to test the following servlet code using httpunit servlet runner. Here every thing goes fine except jsp pages which includes jstl. public class ListTenantServlet extends HttpServlet { private static final long serialVersionUID = 1L; …
majji
  • 169
  • 2
  • 3
  • 19
1
vote
0 answers

ServletUnit RequestDispatcher forward() / include() methods AbstractMethodError

I'm doing a java web app with a servlet and I wanted to write some tests to check its functionality (ex. authorization form). I hadn't been using any framework, just bare java in eclipse with tomcat 7.0 I've run into an error while trying to test…
1
vote
2 answers

How can I unit test a servlet with a request that just consists of xml content

I'm trying to unit test a java WFS web service implementation. The service can accept requests containing KVP params such as: http://www.someserver.com/wfs&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=InWaterA_1M or it can also accept a…
Alb
  • 3,601
  • 6
  • 33
  • 38
1
vote
4 answers

Is is possible to capture the type parameter of a trait using Manifests in Scala 2.7.7?

I'm writing a ServletUnitTest trait in Scala to provide a convenience API for ServletUnit. I have something like the following in mind: /** * Utility trait for HttpUnit/ServletUnit tests * * @param [T] Type parameter for the class under test …
Aaron Novstrup
  • 20,967
  • 7
  • 70
  • 108
1
vote
0 answers

How do we unit test servlets that forward to JSP using ServletUnit

I have a servlet that forwards the request/response to a JSP, but I keep getting the exception junit.framework.AssertionFailedError: An exception has been thrown. com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 404…
jcb
  • 195
  • 1
  • 4
  • 20
1
vote
0 answers

HttpUnit not honoring load-on-startup in web.xml

I'm still trying to navigate how the httpunit class architecture works, but I've come across an issue where I'm not seeing my "load-on-startup" directives in web.xml being honored when I use ServletRunner. Is there a standard way to make this work,…
Ryan
  • 1,557
  • 9
  • 11
0
votes
1 answer

Testing Web Apps with HttpUnit & ServletUnit

I am a pretty naive programmer looking forward to test my web app with Fitnesse + (HttpUnit/ServletUnit). The idea is to test the action/representation layer in completeness, I do not intend to test/assert on the final HTML response received rather…
Bhuvnesh Pratap
  • 437
  • 1
  • 5
  • 16
0
votes
1 answer

Receiving multiple syntax errors when using registerServlet method

I am trying to implement JUnit unit testing using a ServletUnit to test a servlet, specifically a java file named SignedNotesServlet.java . This test class is in the same directory as SignedNotesServlet.java . I am using Eclipse. However, I am…
ThinkFlow
  • 161
  • 1
  • 3
  • 16