简体   繁体   中英

java.lang.Exception: No runnable methods exception in running JUnits Solution

I have the same issue as this question here: java.lang.Exception: No runnable methods exception in running JUnits

The answer says to look at this link: http://sqa.fyicenter.com/FAQ/JUnit/Can_You_Explain_the_Exception_No_runnable_meth.html

However, I don't see what the solution to the problem is. What do I need to add to my code in order to execute the java -cp ... command and not get an error.

How are you building the jar ? check the version of the JUnit library and if its is using JUnit 4.4 core runner to execute a class that has no "@Test" you will face this issue.

Check if there are any classes with no @Test method from test suite and remove them.

also check your package imports for @Test annotation.

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