How can I run my test cases (which written in junit 3.x and 4.x) using jsp?
I want to run my all test cases which is written in both junit versions(3.x & 4.x) in JSP. If I called that 开发者_StackOverflow社区jsp it should run all test cases. Please guide me.
This being odd, there is a way to do it:
You can use JUnitCore.runClasses(..)
, where you pass an array of the classes of your unit tests.
Of cours, you will need a <@% page import="org.junit.runner.JUnitCore" %>
in your jsp.
Still, tell us your scenario, because this doesn't seem quite right. At least do this in a Servlet
, not a jsp
精彩评论