Unit testing a Java Servlet

后端 未结 8 1745
心在旅途
心在旅途 2020-11-28 21:05

I would like to know what would be the best way to do unit testing of a servlet.

Testing internal methods is not a problem as long as they don\'t refer to the servl

8条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 21:54

    Mockrunner (http://mockrunner.sourceforge.net/index.html) can do this. It provides a mock J2EE container that can be used to test Servlets. It can also be used to unit test other server-side code like EJBs, JDBC, JMS, Struts. I've only used the JDBC and EJB capabilities myself.

提交回复
热议问题