Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Run org.junit.runner.JUnitCore in junit-4.12.jar
How to run org.junit.runner.JUnitCore in junit-4.12.jar?
✍: FYIcenter.com
org.junit.runner.JUnitCore is the main class of the JUnit 4.12, which requires hamcrest-core-1.3.jar.
If you run org.junit.runner.JUnitCore without Hamcrest, you will get a NoClassDefFoundError exception:
\fyicenter>java -version java version "1.8.0_45" \fyicenter>java -cp .;\local\lib\junit-4.12.jar org.junit.runner.JUnitCore JUnit version 4.12 Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access0(URLClassLoader.java:73) at java.net.URLClassLoader.run(URLClassLoader.java:368) at java.net.URLClassLoader.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.junit.runner.Computer.getSuite(Computer.java:28) at org.junit.runner.Request.classes(Request.java:75) at org.junit.runner.JUnitCommandLineParseResult.createRequest (JUnitCommandLineParseResult.java:118) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) at org.junit.runner.JUnitCore.main(JUnitCore.java:36) ...
If you run org.junit.runner.JUnitCore with junit-4.12.jar, you will get OK message:
\fyicenter>java -version java version "1.8.0_45" \fyicenter>java -cp .;\local\lib\junit-4.12.jar; \local\lib\hamcrest-core-1.3.jar org.junit.runner.JUnitCore JUnit version 4.12 Time: 0.001 OK (0 tests)
The output shows that 0 tests performed, because no test class is given.
⇒ Run Sample Program with junit-4.12.jar
⇐ Sample Program for junit-4.12.jar
2016-02-24, 4412🔥, 0💬
Popular Posts:
maven-core-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Core module. Apache Maven is a software ...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...
What Is javamail1_1_3.zip? javamail1_1_3.zip is the binary package of JavaMail API 1.1.3 in ZIP form...
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
io.jar is a component in iText Java library to provide input/output functionalities. iText Java libr...