Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » junit-plug-in-test
junit-plug-in-test [message #282549] Wed, 16 March 2005 12:34 Go to next message
Eclipse UserFriend
Originally posted by: heinecke.blue-cable.de

Hi everyone,

I encountered a strange problem while running junit-plug-in-tests.
This is what I've done.
I created a TestCase as follows:

import junit.framework.TestCase;

public class UseCaseEditorTest extends TestCase
{

public void testUseCaseEditor() throws Exception
{
//...
}
}

When I run this test via run as junit-plug-in-test my test-workbench starts
an I could see my plug-in but I get the message:
Failed to execute runnable (java.lang.NoClassDefFoundError:
junit/framework/TestCase)

That is quite strange for me. Because I added the junit-jar to my project
and made my plug-in depending on:
<requires>
....
<import plugin="org.eclipse.pde.junit.runtime"/>
<import plugin="org.eclipse.jdt.junit.runtime"/>
<import plugin="org.eclipse.jdt.junit"/>
</requires>

So why eclipse can not find the TestCase???

Can anybody help?

Thanks in advance!

best regards

Andreas
Re: junit-plug-in-test [message #282553 is a reply to message #282549] Wed, 16 March 2005 19:13 Go to previous messageGo to next message
Ingo Maier is currently offline Ingo MaierFriend
Messages: 25
Registered: July 2009
Junior Member
Andreas,

I have just org.junit in my dependencies without the pde and jdt stuff.
Have you tried that?

Ingo


Andreas Heinecke wrote:
> Hi everyone,
>
> I encountered a strange problem while running junit-plug-in-tests.
> This is what I've done.
> I created a TestCase as follows:
>
> import junit.framework.TestCase;
>
> public class UseCaseEditorTest extends TestCase
> {
>
> public void testUseCaseEditor() throws Exception
> {
> //...
> }
> }
>
> When I run this test via run as junit-plug-in-test my test-workbench starts
> an I could see my plug-in but I get the message:
> Failed to execute runnable (java.lang.NoClassDefFoundError:
> junit/framework/TestCase)
>
> That is quite strange for me. Because I added the junit-jar to my project
> and made my plug-in depending on:
> <requires>
> ....
> <import plugin="org.eclipse.pde.junit.runtime"/>
> <import plugin="org.eclipse.jdt.junit.runtime"/>
> <import plugin="org.eclipse.jdt.junit"/>
> </requires>
>
> So why eclipse can not find the TestCase???
>
> Can anybody help?
>
> Thanks in advance!
>
> best regards
>
> Andreas
Re: junit-plug-in-test [message #282610 is a reply to message #282553] Wed, 16 March 2005 21:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: heinecke.blue-cable.de

Ingo,

I tried that but it doesn't work for me.
Is there anything different in a TestCase which is intended to be a plug-in
test from a "normal" TestCase which is intended to test a "normal" class?

many regards and thanks for help...

Andreas

Ingo Maier wrote:

> Andreas,
>
> I have just org.junit in my dependencies without the pde and jdt stuff.
> Have you tried that?
>
> Ingo
>
>
> Andreas Heinecke wrote:
>> Hi everyone,
>>
>> I encountered a strange problem while running junit-plug-in-tests.
>> This is what I've done.
>> I created a TestCase as follows:
>>
>> import junit.framework.TestCase;
>>
>> public class UseCaseEditorTest extends TestCase
>> {
>>
>> public void testUseCaseEditor() throws Exception
>> {
>> //...
>> }
>> }
>>
>> When I run this test via run as junit-plug-in-test my test-workbench
>> starts an I could see my plug-in but I get the message:
>> Failed to execute runnable (java.lang.NoClassDefFoundError:
>> junit/framework/TestCase)
>>
>> That is quite strange for me. Because I added the junit-jar to my project
>> and made my plug-in depending on:
>> <requires>
>> ....
>> <import plugin="org.eclipse.pde.junit.runtime"/>
>> <import plugin="org.eclipse.jdt.junit.runtime"/>
>> <import plugin="org.eclipse.jdt.junit"/>
>> </requires>
>>
>> So why eclipse can not find the TestCase???
>>
>> Can anybody help?
>>
>> Thanks in advance!
>>
>> best regards
>>
>> Andreas
Re: junit-plug-in-test [message #282615 is a reply to message #282610] Wed, 16 March 2005 21:56 Go to previous message
Eclipse UserFriend
Originally posted by: heinecke.blue-cable.de

I solved the problem!

Ingo, you gave the important hint!
It was my fault to integrate the JUnit.jar in the build path. But that is
wrong. The org.junit plug-in must be placed in the list of dependencies.
According to the newsgroup I must say it is a common problem to integrate
third-party .jar files in the build path. Compling will be without problems
but running your application will cause a ClassNotFound...bla bla.

Thats all for now...
Thank you for your help Ingo...

Many regards

Andreas

Andreas Heinecke wrote:

> Ingo,
>
> I tried that but it doesn't work for me.
> Is there anything different in a TestCase which is intended to be a
> plug-in test from a "normal" TestCase which is intended to test a "normal"
> class?
>
> many regards and thanks for help...
>
> Andreas
>
> Ingo Maier wrote:
>
>> Andreas,
>>
>> I have just org.junit in my dependencies without the pde and jdt stuff.
>> Have you tried that?
>>
>> Ingo
>>
>>
>> Andreas Heinecke wrote:
>>> Hi everyone,
>>>
>>> I encountered a strange problem while running junit-plug-in-tests.
>>> This is what I've done.
>>> I created a TestCase as follows:
>>>
>>> import junit.framework.TestCase;
>>>
>>> public class UseCaseEditorTest extends TestCase
>>> {
>>>
>>> public void testUseCaseEditor() throws Exception
>>> {
>>> //...
>>> }
>>> }
>>>
>>> When I run this test via run as junit-plug-in-test my test-workbench
>>> starts an I could see my plug-in but I get the message:
>>> Failed to execute runnable (java.lang.NoClassDefFoundError:
>>> junit/framework/TestCase)
>>>
>>> That is quite strange for me. Because I added the junit-jar to my
>>> project and made my plug-in depending on:
>>> <requires>
>>> ....
>>> <import plugin="org.eclipse.pde.junit.runtime"/>
>>> <import plugin="org.eclipse.jdt.junit.runtime"/>
>>> <import plugin="org.eclipse.jdt.junit"/>
>>> </requires>
>>>
>>> So why eclipse can not find the TestCase???
>>>
>>> Can anybody help?
>>>
>>> Thanks in advance!
>>>
>>> best regards
>>>
>>> Andreas
Previous Topic:Intercepting
Next Topic:Help System Hosed by McAfee VirusScan Enterprise 8.0
Goto Forum:
  


Current Time: Sun Oct 06 14:15:19 GMT 2024

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

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

Back to the top