开发者

I've inherited a JSP/Java Servlet web-app, can I JUnit test this (in Tomcat) to get the code coverage?

Happy Friday! I assume somebody out there has a simple answer to this question and I'm hoping you read this post. I haven't really found the answer that I want searching the tubes & StackOverflow today.

I've inherited a web-app (version 2.4) that runs in Tomcat 5.5 and I want to run code coverage and JUnit tests on this to see what's really being used (I believe muc开发者_如何学Goh of it's been deprecated) and what can be improved. I'm using Eclipse, I'd like to use EclEmma and I'd like to run these tests inside Tomcat because of some online resources the web app uses for data.

Does anyone have a tutorial or suggestion on how I might accomplish this?


It is quite hard to unit test a servlet/jsp application which was not designed with testability in mind. I was working with dependency injection frameworks and test-driven development for last 7 years or so. Before that I once had to retrofit a servlet/jsp application with the unit tests. I believe I used JUnitEE for that purpose. I was not using code coverage tools at the time, so I'm not sure if it would have worked with them. Then again, it probably improved greatly since I used it last time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜