|
Re: Class not found exception for JUnit [message #668610 is a reply to message #668531] |
Fri, 06 May 2011 12:21 |
|
Is MyJUnitTest.java in the same folder as the source code you're trying
to test? If not, is it nevertheless in a folder that is or whose parent
is a Source Folder?
On 2011.05.06 0:33, Vishal wrote:
> Hi, I have been trying to execute for Junit s in eclipse environment.
> I have been running the Junit as follows : Right Click on Junit Test
> file -> Run As -> Junit Test
> On the console I get the error
> Class not found packagename.MyJunitTest
> java.lang.ClassNotFoundException: packagename.MyJUnitTest
> 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:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC
> lass(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC
> lasses(RemoteTestRunner.java:425)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe
> sts(RemoteTestRunner.java:445)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe
> sts(RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R
> emoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
>
> Basically it is complaining that it is not able to find the JUnit class
> file which I am trying to execute.
>
> Java Build path is also set as follows :
> Build Path -> Configure Build Path -> Java Build Path -> Source tab
> Default Output Folder :
> FullPathOfTheProject/target/classes
>
> Any Help here would be appreciated.
> Thanks and Regards, Vishal
|
|
|
Re: Class not found exception for JUnit [message #668620 is a reply to message #668610] |
Fri, 06 May 2011 12:53 |
|
(Sorry got distracted...)
Did you also ensure that you have the JUnit JARs in your project (via
Build Path)? I can't see your project, obviously, so I can only ask dumb
questions in an effort to help. Sorry if I'm not being much help.
On 2011.05.06 6:21, Russell Bateman wrote:
> Is MyJUnitTest.java in the same folder as the source code you're trying
> to test? If not, is it nevertheless in a folder that is or whose parent
> is a Source Folder?
>
> On 2011.05.06 0:33, Vishal wrote:
>> Hi, I have been trying to execute for Junit s in eclipse environment.
>> I have been running the Junit as follows : Right Click on Junit Test
>> file -> Run As -> Junit Test
>> On the console I get the error
>> [snip]
>
|
|
|
Powered by
FUDForum. Page generated in 0.03102 seconds