Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ClassNotFoundException when running JUnit test(ClassNotFoundException when running JUnit test)
ClassNotFoundException when running JUnit test [message #903319] Thu, 23 August 2012 07:18 Go to next message
Kris Ram is currently offline Kris RamFriend
Messages: 11
Registered: July 2012
Junior Member
Hi guys,

I have a maven project and I have imported it into Eclipse.

I have successfuly run a few unit tests before, but after a few maven builds on the command line and then refresing on eclipse, I get a failure.

Class not found com.company.search.repo.impl.DefaultCusRepoUnitTest
java.lang.ClassNotFoundException: com.company.search.repo.impl.DefaultCusRepoUnitTest
	at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:345)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
	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)



Where in Eclipse, do I start to investigate what is wrong? And if you know how to solve it permanently it would be great.

I know I can get this to work by cleaning, rebuilding, etc...

Regards
Kris
Re: ClassNotFoundException when running JUnit test [message #903370 is a reply to message #903319] Thu, 23 August 2012 11:37 Go to previous message
Kris Ram is currently offline Kris RamFriend
Messages: 11
Registered: July 2012
Junior Member
I imported the project in STS 2.6.0 and ran the test again and it worked.


I noticed one difference, in the target folder the are 2 folders; classes and test-classes.

Previously the test-classes folder was not populated and it now contains all the test classes.


I can't confirm why it is generated now and not before though.

Hope somebody has some answers.

Previous Topic:cannot resolve org.eclipse.org.boot
Next Topic:Debugging not working while running works
Goto Forum:
  


Current Time: Thu Mar 28 11:11:17 GMT 2024

Powered by FUDForum. Page generated in 0.06139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top