简体   繁体   中英

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 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM