jUnit tests no longer runnable after upgrading from NetBeans 8.0 to 8.1

时间:2016-02-03 02:46:24

标签: java netbeans junit

I have a workspace that builds the open source jedit editor, that worked fine in NetBeans 8.0, and I upgraded to NetBeans 8.1, and it imported my IDE settings. When I build my project it has this new error:

Error: Could not find or load main class org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
...
C:\..\jedit-svn\build.xml:453: Unit test(s) failed! See reports at C:\Users\warren\IdeaProjects\jedit-svn\build/test/reports/index.html
BUILD FAILED (total time: 15 seconds)

I have junit-4.12.jar and hamcrest-core-1.3.jar referenced in my project classpath/jar-list. The jUnit plugin for NetBeans is installed. My netbeans configuration is pointing at a version of ant that appears to be correct, and which is being used by netbeans to run the build and the test operations.

Everything WORKS from a command prompt in windows (ant test), but it FAILS inside Netbeans.

The output window contains the above message, but the index.html contains this other weird error:

Class org.jedit.io.Native2ASCIIEncodingTest

unknown Error Forked Java VM exited abnormally. Please note the time 
in the report does not reflect the time until the VM exit.

junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the 
 VM exit.
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153) 

Wacky thing that is confusing me and may be what's going on. When I run the unit tests inside the IDE, the "properties" inside the junit report html for the failed test show ant.java.version 1.8 and a java 1.8 appropriate java.class.path, but my build.xml states target.java.version of 1.7. I have both JDK 1.7 and 1.8 installed. I thought that the version of Java specified in build.xml trumps whatever the workspace jdk selection is in netbeans, but not here.

0 个答案:

没有答案