Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Issue executing JUnit Test in Eclipse with m2e 1.0.100

I am using STS 2.8.1 with 1.0.100 of m2e and I am unable to execute me JUnit Test cases by simply right clicking on the Java Test file and selecting -> 'Run As -> JUnit'

I run into the following ClassNotFoundException :

Class not found com.thesearchagency.smb.service.site.component.contextprocessing.CustomizationImporterCPTest
java.lang.ClassNotFoundException: com.thesearchagency.smb.service.site.component.contextprocessing.CustomizationImporterCPTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


If I delete the target directory with the compiled classes and make some changes to the code in the test class it seems that it is not being automatically compiled. I have the 'Project -> Build Automatically' turned on so it is odd that when i make changes to the test case code that is it not automatically rebuilt.

If I execute the 'Run As -> Maven Test' it does compile the test classes and places them in the 'target/test-classes' directory. Then if I select the JUnit Test class java file and 'Run As -> JUnit' it executes the compiled test class form the previous 'Run As -> Maven Test'. If I then make additional changes to the JUnit code then 'Run As -> JUnit' it does not recompile the test class automatically and the changes made to the class are not reflected in the JUnit execution, Is this a bug??? If anyone can help me in resolving this it would be wonderful.

-Kyle S, Bober

--
Any fool can write code that a computer can understand.  Good programmers write code that humans can understand.  ~Martin Fowler


Back to the top