JUnits fail to start [Eclipse - Run As JUnit Test]

classic Classic list List threaded Threaded
12 messages Options
Rafal Korytkowski Rafal Korytkowski
Reply | Threaded
Open this post in threaded view
|

JUnits fail to start [Eclipse - Run As JUnit Test]

Hi,

I updated a moment ago to the trunk and I can't run JUnits from Eclipse
anymore. Is it just me? I get an exception at the very beginning:

java.lang.TypeNotPresentException: Type [unknown] not present
        at
sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
        at
sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
        at $Proxy7.value(Unknown Source)
        at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
        at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NoClassDefFoundError:
org/junit/runners/BlockJUnit4ClassRunner
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at
sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
        at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
        at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
        at
sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
        at
sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
        at
sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
        at java.lang.Class.getAnnotation(Class.java:3029)
        at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
        ... 9 more
Caused by: java.lang.ClassNotFoundException:
org.junit.runners.BlockJUnit4ClassRunner
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 37 more

--
Best regards,
Rafal

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Ben Wolfe Ben Wolfe
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Looks like an openjdk issue.  I had to uninstall openjdk and install
sunjdk in ubuntu 10.04 to get the unit tests to work again.  I couldn't
figure out why openjdk was failing and how to fix it.

We have a continuous integration server that runs all the tests after
each commit, so if you want to see if its just your machine, you can
check: http://ci.openmrs.org

Ben

On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:

> Hi,
>
> I updated a moment ago to the trunk and I can't run JUnits from Eclipse
> anymore. Is it just me? I get an exception at the very beginning:
>
> java.lang.TypeNotPresentException: Type [unknown] not present
> at
> sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
> at
> sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
> at $Proxy7.value(Unknown Source)
> at
> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
> at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.lang.NoClassDefFoundError:
> org/junit/runners/BlockJUnit4ClassRunner
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
> at
> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
> at
> sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
> at
> sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
> at
> sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
> at
> sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
> at java.lang.Class.getAnnotation(Class.java:3029)
> at
> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
> ... 9 more
> Caused by: java.lang.ClassNotFoundException:
> org.junit.runners.BlockJUnit4ClassRunner
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> ... 37 more
>

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Rafal Korytkowski Rafal Korytkowski
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
junit-report works fine, though one test fails right now:
PatientDashboardGraphControllerTest
shouldReturnJSONWithPatientObservationDetails. Anyway everything worked
fine a moment ago before I synchronized with the trunk (I didn't do it
for a week or so). I am wondering if any significant changes to the
build path have been made recently? I see just checkstyle and nothing else.

Best regards,
Rafal

On 2010-05-12 18:01, Ben Wolfe wrote:

> Looks like an openjdk issue.  I had to uninstall openjdk and install
> sunjdk in ubuntu 10.04 to get the unit tests to work again. I couldn't
> figure out why openjdk was failing and how to fix it.
>
> We have a continuous integration server that runs all the tests after
> each commit, so if you want to see if its just your machine, you can
> check: http://ci.openmrs.org
>
> Ben
>
> On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
>> Hi,
>>
>> I updated a moment ago to the trunk and I can't run JUnits from Eclipse
>> anymore. Is it just me? I get an exception at the very beginning:
>>
>> java.lang.TypeNotPresentException: Type [unknown] not present
>> at
>> sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>>
>> at
>> sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>>
>> at $Proxy7.value(Unknown Source)
>> at
>> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>>
>> at
>> org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>> at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>>
>> at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>>
>> at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>>
>> at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>
>> Caused by: java.lang.NoClassDefFoundError:
>> org/junit/runners/BlockJUnit4ClassRunner
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>> at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>> at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:247)
>> at
>> sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>>
>> at
>> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>>
>> at
>> sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>>
>> at
>> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>>
>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>> at java.lang.Class.getAnnotation(Class.java:3029)
>> at
>> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>>
>> ... 9 more
>> Caused by: java.lang.ClassNotFoundException:
>> org.junit.runners.BlockJUnit4ClassRunner
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>> ... 37 more
>>
>
> _________________________________________
>
> To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
> [hidden email] with "SIGNOFF openmrs-devel-l" in the body
> (not the subject) of your e-mail.
>
> [mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Rafal Korytkowski Rafal Korytkowski
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Ok, I've found the solution. I use Eclipse 3.4 with JUnit in version
org.junit4_4.3.1, which as it seems is too old. I downloaded the newest
version of JUnit i.e. junit-4.8.2.jar and added it to
Windows->Preferences->Java->Installed JREs->jdk. Now works fine, but
it's not nice to have it there. Why don't we put JUnit in libs in OpenMRS?

Best regards,
Rafal

On 2010-05-12 18:14, Rafal Korytkowski wrote:

> Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
> junit-report works fine, though one test fails right now:
> PatientDashboardGraphControllerTest
> shouldReturnJSONWithPatientObservationDetails. Anyway everything worked
> fine a moment ago before I synchronized with the trunk (I didn't do it
> for a week or so). I am wondering if any significant changes to the
> build path have been made recently? I see just checkstyle and nothing else.
>
> Best regards,
> Rafal
>
> On 2010-05-12 18:01, Ben Wolfe wrote:
>> Looks like an openjdk issue. I had to uninstall openjdk and install
>> sunjdk in ubuntu 10.04 to get the unit tests to work again. I couldn't
>> figure out why openjdk was failing and how to fix it.
>>
>> We have a continuous integration server that runs all the tests after
>> each commit, so if you want to see if its just your machine, you can
>> check: http://ci.openmrs.org
>>
>> Ben
>>
>> On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
>>> Hi,
>>>
>>> I updated a moment ago to the trunk and I can't run JUnits from Eclipse
>>> anymore. Is it just me? I get an exception at the very beginning:
>>>
>>> java.lang.TypeNotPresentException: Type [unknown] not present
>>> at
>>> sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>>>
>>>
>>> at $Proxy7.value(Unknown Source)
>>> at
>>> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>>>
>>>
>>> at
>>> org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>>> at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>>
>>>
>>> Caused by: java.lang.NoClassDefFoundError:
>>> org/junit/runners/BlockJUnit4ClassRunner
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>>> at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>>> at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Class.java:247)
>>> at
>>> sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>>>
>>>
>>> at
>>> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>>>
>>>
>>> at
>>> sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>>>
>>>
>>> at
>>> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>>>
>>>
>>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>>> at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>>> at java.lang.Class.getAnnotation(Class.java:3029)
>>> at
>>> org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>>>
>>>
>>> ... 9 more
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.junit.runners.BlockJUnit4ClassRunner
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>> ... 37 more
>>>
>>
>> _________________________________________
>>
>> To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
>> [hidden email] with "SIGNOFF openmrs-devel-l" in the body
>> (not the subject) of your e-mail.
>>
>> [mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

We do have junit-4.8.1.jar in openmrs/lib/junit.

-Darius

On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski <[hidden email]> wrote:
Ok, I've found the solution. I use Eclipse 3.4 with JUnit in version org.junit4_4.3.1, which as it seems is too old. I downloaded the newest version of JUnit i.e. junit-4.8.2.jar and added it to Windows->Preferences->Java->Installed JREs->jdk. Now works fine, but it's not nice to have it there. Why don't we put JUnit in libs in OpenMRS?

Best regards,
Rafal


On 2010-05-12 18:14, Rafal Korytkowski wrote:
Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
junit-report works fine, though one test fails right now:
PatientDashboardGraphControllerTest
shouldReturnJSONWithPatientObservationDetails. Anyway everything worked
fine a moment ago before I synchronized with the trunk (I didn't do it
for a week or so). I am wondering if any significant changes to the
build path have been made recently? I see just checkstyle and nothing else.

Best regards,
Rafal

On 2010-05-12 18:01, Ben Wolfe wrote:
Looks like an openjdk issue. I had to uninstall openjdk and install
sunjdk in ubuntu 10.04 to get the unit tests to work again. I couldn't
figure out why openjdk was failing and how to fix it.

We have a continuous integration server that runs all the tests after
each commit, so if you want to see if its just your machine, you can
check: http://ci.openmrs.org

Ben

On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
Hi,

I updated a moment ago to the trunk and I can't run JUnits from Eclipse
anymore. Is it just me? I get an exception at the very beginning:

java.lang.TypeNotPresentException: Type [unknown] not present
at
sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)


at
sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)


at $Proxy7.value(Unknown Source)
at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)


at
org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)


at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)


at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)


at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)


at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)


at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)


at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)


at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


Caused by: java.lang.NoClassDefFoundError:
org/junit/runners/BlockJUnit4ClassRunner
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)


at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)


at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)


at
sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)


at
sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)


at
sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)


at
sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)


at
sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)


at
sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)


at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
at java.lang.Class.getAnnotation(Class.java:3029)
at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)


... 9 more
Caused by: java.lang.ClassNotFoundException:
org.junit.runners.BlockJUnit4ClassRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 37 more


_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[hidden email] with "SIGNOFF openmrs-devel-l" in the body
(not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list
Rafal Korytkowski Rafal Korytkowski
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Hi Darius,

I've just noticed. Then entry in .classpath is wrong. It says:

<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

but should be:

<classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>

I'll add a ticket, is that ok?

Best regards,
Rafal

On 2010-05-12 18:40, Darius Jazayeri wrote:

> We do have junit-4.8.1.jar in openmrs/lib/junit.
>
> -Darius
>
> On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Ok, I've found the solution. I use Eclipse 3.4 with JUnit in version
>     org.junit4_4.3.1, which as it seems is too old. I downloaded the
>     newest version of JUnit i.e. junit-4.8.2.jar and added it to
>     Windows->Preferences->Java->Installed JREs->jdk. Now works fine, but
>     it's not nice to have it there. Why don't we put JUnit in libs in
>     OpenMRS?
>
>     Best regards,
>     Rafal
>
>
>     On 2010-05-12 18:14, Rafal Korytkowski wrote:
>
>         Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
>         junit-report works fine, though one test fails right now:
>         PatientDashboardGraphControllerTest
>         shouldReturnJSONWithPatientObservationDetails. Anyway everything
>         worked
>         fine a moment ago before I synchronized with the trunk (I didn't
>         do it
>         for a week or so). I am wondering if any significant changes to the
>         build path have been made recently? I see just checkstyle and
>         nothing else.
>
>         Best regards,
>         Rafal
>
>         On 2010-05-12 18:01, Ben Wolfe wrote:
>
>             Looks like an openjdk issue. I had to uninstall openjdk and
>             install
>             sunjdk in ubuntu 10.04 to get the unit tests to work again.
>             I couldn't
>             figure out why openjdk was failing and how to fix it.
>
>             We have a continuous integration server that runs all the
>             tests after
>             each commit, so if you want to see if its just your machine,
>             you can
>             check: http://ci.openmrs.org
>
>             Ben
>
>             On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
>
>                 Hi,
>
>                 I updated a moment ago to the trunk and I can't run
>                 JUnits from Eclipse
>                 anymore. Is it just me? I get an exception at the very
>                 beginning:
>
>                 java.lang.TypeNotPresentException: Type [unknown] not
>                 present
>                 at
>                 sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>
>
>                 at $Proxy7.value(Unknown Source)
>                 at
>                 org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>
>
>                 at
>                 org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>                 at
>                 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>
>
>                 at
>                 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
>
>                 Caused by: java.lang.NoClassDefFoundError:
>                 org/junit/runners/BlockJUnit4ClassRunner
>                 at java.lang.ClassLoader.defineClass1(Native Method)
>                 at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>                 at
>                 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>                 at
>                 java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>                 at
>                 java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>                 at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>                 at java.security.AccessController.doPrivileged(Native
>                 Method)
>                 at
>                 java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                 at
>                 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                 at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                 at
>                 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                 at java.lang.Class.forName0(Native Method)
>                 at java.lang.Class.forName(Class.java:247)
>                 at
>                 sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>
>
>                 at
>                 sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>
>
>                 at
>                 sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>
>
>                 at
>                 sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>
>
>                 at
>                 java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>                 at
>                 java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                 at
>                 java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                 at java.lang.Class.getAnnotation(Class.java:3029)
>                 at
>                 org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>
>
>                 ... 9 more
>                 Caused by: java.lang.ClassNotFoundException:
>                 org.junit.runners.BlockJUnit4ClassRunner
>                 at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>                 at java.security.AccessController.doPrivileged(Native
>                 Method)
>                 at
>                 java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                 at
>                 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                 at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                 at
>                 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                 ... 37 more
>
>
>             _________________________________________
>
>             To unsubscribe from OpenMRS Developers' mailing list, send
>             an e-mail to
>             [hidden email]
>             <mailto:[hidden email]> with "SIGNOFF
>             openmrs-devel-l" in the body
>             (not the subject) of your e-mail.
>
>             [mailto:[hidden email]
>             <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>
>
>     _________________________________________
>
>     To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
>     to [hidden email] <mailto:[hidden email]>
>     with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
>     your e-mail.
>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>
>
> ------------------------------------------------------------------------
> Click here to unsubscribe
> <mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
> OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Ben Wolfe Ben Wolfe
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

I think the problem is that when you run the tests in eclipse it uses
its own junit before it asks the .classpath for a junit.

The tests were passing at ant command line for you because it /only/
looks at the libs in /lib

Maybe removing that line will cause eclipse to ignore its own?

Ben

On 05/12/2010 12:43 PM, Rafal Korytkowski wrote:

> Hi Darius,
>
> I've just noticed. Then entry in .classpath is wrong. It says:
>
> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
>
> but should be:
>
> <classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
>
> I'll add a ticket, is that ok?
>
> Best regards,
> Rafal
>
> On 2010-05-12 18:40, Darius Jazayeri wrote:
>> We do have junit-4.8.1.jar in openmrs/lib/junit.
>>
>> -Darius
>>
>> On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
>> <[hidden email]<mailto:[hidden email]>>  wrote:
>>
>>      Ok, I've found the solution. I use Eclipse 3.4 with JUnit in version
>>      org.junit4_4.3.1, which as it seems is too old. I downloaded the
>>      newest version of JUnit i.e. junit-4.8.2.jar and added it to
>>      Windows->Preferences->Java->Installed JREs->jdk. Now works fine, but
>>      it's not nice to have it there. Why don't we put JUnit in libs in
>>      OpenMRS?
>>
>>      Best regards,
>>      Rafal
>>
>>
>>      On 2010-05-12 18:14, Rafal Korytkowski wrote:
>>
>>          Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
>>          junit-report works fine, though one test fails right now:
>>          PatientDashboardGraphControllerTest
>>          shouldReturnJSONWithPatientObservationDetails. Anyway everything
>>          worked
>>          fine a moment ago before I synchronized with the trunk (I didn't
>>          do it
>>          for a week or so). I am wondering if any significant changes to the
>>          build path have been made recently? I see just checkstyle and
>>          nothing else.
>>
>>          Best regards,
>>          Rafal
>>
>>          On 2010-05-12 18:01, Ben Wolfe wrote:
>>
>>              Looks like an openjdk issue. I had to uninstall openjdk and
>>              install
>>              sunjdk in ubuntu 10.04 to get the unit tests to work again.
>>              I couldn't
>>              figure out why openjdk was failing and how to fix it.
>>
>>              We have a continuous integration server that runs all the
>>              tests after
>>              each commit, so if you want to see if its just your machine,
>>              you can
>>              check: http://ci.openmrs.org
>>
>>              Ben
>>
>>              On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
>>
>>                  Hi,
>>
>>                  I updated a moment ago to the trunk and I can't run
>>                  JUnits from Eclipse
>>                  anymore. Is it just me? I get an exception at the very
>>                  beginning:
>>
>>                  java.lang.TypeNotPresentException: Type [unknown] not
>>                  present
>>                  at
>>                  sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>>
>>
>>                  at $Proxy7.value(Unknown Source)
>>                  at
>>                  org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>>
>>
>>                  at
>>                  org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>>                  at
>>                  org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>
>>
>>                  at
>>                  org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>
>>
>>                  Caused by: java.lang.NoClassDefFoundError:
>>                  org/junit/runners/BlockJUnit4ClassRunner
>>                  at java.lang.ClassLoader.defineClass1(Native Method)
>>                  at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>>                  at
>>                  java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>>                  at
>>                  java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>>                  at
>>                  java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>>                  at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>>                  at java.security.AccessController.doPrivileged(Native
>>                  Method)
>>                  at
>>                  java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>                  at
>>                  sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>                  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>                  at
>>                  java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>                  at java.lang.Class.forName0(Native Method)
>>                  at java.lang.Class.forName(Class.java:247)
>>                  at
>>                  sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>>
>>
>>                  at
>>                  sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>>
>>
>>                  at
>>                  sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>>
>>
>>                  at
>>                  sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>>
>>
>>                  at
>>                  java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>>                  at
>>                  java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>>                  at
>>                  java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>>                  at java.lang.Class.getAnnotation(Class.java:3029)
>>                  at
>>                  org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>>
>>
>>                  ... 9 more
>>                  Caused by: java.lang.ClassNotFoundException:
>>                  org.junit.runners.BlockJUnit4ClassRunner
>>                  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>                  at java.security.AccessController.doPrivileged(Native
>>                  Method)
>>                  at
>>                  java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>                  at
>>                  sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>                  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>                  at
>>                  java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>                  ... 37 more
>>
>>
>>              _________________________________________
>>
>>              To unsubscribe from OpenMRS Developers' mailing list, send
>>              an e-mail to
>>              [hidden email]
>>              <mailto:[hidden email]>  with "SIGNOFF
>>              openmrs-devel-l" in the body
>>              (not the subject) of your e-mail.
>>
>>              [mailto:[hidden email]
>>              <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>>
>>
>>      _________________________________________
>>
>>      To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
>>      to [hidden email]<mailto:[hidden email]>
>>      with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
>>      your e-mail.
>>
>>      [mailto:[hidden email]
>>      <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>>
>>
>> ------------------------------------------------------------------------
>> Click here to unsubscribe
>> <mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l>  from
>> OpenMRS Developers' mailing list
>
> _________________________________________
>
> To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.
>
> [mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

In 5685 (merging concept-name-tag) akolleger changed the .classpath to use eclipse's junit rather than the included one. That seems like a mistake, and I believe it should be switched back.

We should test to make sure that this doesn't break Run As -> Junit Test in eclipse.

Rafal, can you do this?

-Darius

On Wed, May 12, 2010 at 9:44 AM, Ben Wolfe <[hidden email]> wrote:
I think the problem is that when you run the tests in eclipse it uses its own junit before it asks the .classpath for a junit.

The tests were passing at ant command line for you because it /only/ looks at the libs in /lib

Maybe removing that line will cause eclipse to ignore its own?

Ben


On 05/12/2010 12:43 PM, Rafal Korytkowski wrote:
Hi Darius,

I've just noticed. Then entry in .classpath is wrong. It says:

<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

but should be:

<classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>

I'll add a ticket, is that ok?

Best regards,
Rafal

On 2010-05-12 18:40, Darius Jazayeri wrote:
We do have junit-4.8.1.jar in openmrs/lib/junit.

-Darius

On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
<[hidden email]<mailto:[hidden email]>>  wrote:

    Ok, I've found the solution. I use Eclipse 3.4 with JUnit in version
    org.junit4_4.3.1, which as it seems is too old. I downloaded the
    newest version of JUnit i.e. junit-4.8.2.jar and added it to
    Windows->Preferences->Java->Installed JREs->jdk. Now works fine, but
    it's not nice to have it there. Why don't we put JUnit in libs in
    OpenMRS?

    Best regards,
    Rafal


    On 2010-05-12 18:14, Rafal Korytkowski wrote:

        Thanks Ben for the reply. I'm on windows and sunjdk. Ant task
        junit-report works fine, though one test fails right now:
        PatientDashboardGraphControllerTest
        shouldReturnJSONWithPatientObservationDetails. Anyway everything
        worked
        fine a moment ago before I synchronized with the trunk (I didn't
        do it
        for a week or so). I am wondering if any significant changes to the
        build path have been made recently? I see just checkstyle and
        nothing else.

        Best regards,
        Rafal

        On 2010-05-12 18:01, Ben Wolfe wrote:

            Looks like an openjdk issue. I had to uninstall openjdk and
            install
            sunjdk in ubuntu 10.04 to get the unit tests to work again.
            I couldn't
            figure out why openjdk was failing and how to fix it.

            We have a continuous integration server that runs all the
            tests after
            each commit, so if you want to see if its just your machine,
            you can
            check: http://ci.openmrs.org

            Ben

            On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:

                Hi,

                I updated a moment ago to the trunk and I can't run
                JUnits from Eclipse
                anymore. Is it just me? I get an exception at the very
                beginning:

                java.lang.TypeNotPresentException: Type [unknown] not
                present
                at
                sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)


                at
                sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)


                at $Proxy7.value(Unknown Source)
                at
                org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)


                at
                org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
                at
                org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)


                at
                org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)


                at
                org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)


                at
                org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)


                at
                org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)


                at
                org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)


                at
                org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)


                at
                org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


                Caused by: java.lang.NoClassDefFoundError:
                org/junit/runners/BlockJUnit4ClassRunner
                at java.lang.ClassLoader.defineClass1(Native Method)
                at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
                at
                java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
                at
                java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
                at
                java.net.URLClassLoader.access$000(URLClassLoader.java:56)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
                at java.security.AccessController.doPrivileged(Native
                Method)
                at
                java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                at
                sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                at
                java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:247)
                at
                sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)


                at
                sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)


                at
                sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)


                at
                sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)


                at
                sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)


                at
                sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)


                at
                sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)


                at
                sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)


                at
                sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)


                at
                java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
                at
                java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
                at
                java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
                at java.lang.Class.getAnnotation(Class.java:3029)
                at
                org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)


                ... 9 more
                Caused by: java.lang.ClassNotFoundException:
                org.junit.runners.BlockJUnit4ClassRunner
                at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                at java.security.AccessController.doPrivileged(Native
                Method)
                at
                java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                at
                sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                at
                java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                ... 37 more


            _________________________________________

            To unsubscribe from OpenMRS Developers' mailing list, send
            an e-mail to
            [hidden email]
            <mailto:[hidden email]>  with "SIGNOFF
            openmrs-devel-l" in the body
            (not the subject) of your e-mail.

            [mailto:[hidden email]
            <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]


    _________________________________________

    To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
    to [hidden email]<mailto:[hidden email]>
    with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
    your e-mail.

    [mailto:[hidden email]
    <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]


------------------------------------------------------------------------
Click here to unsubscribe
<mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l>  from
OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list
Rafal Korytkowski Rafal Korytkowski
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

works, but two lines are needed:

<classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
<classpathentry kind="lib" path="lib/junit/junit-dep-4.8.1.jar"/>

instead of:

<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

Best regards,
Rafal

On 2010-05-12 18:51, Darius Jazayeri wrote:

> In 5685 (merging concept-name-tag) akolleger changed the .classpath to
> use eclipse's junit rather than the included one. That seems like a
> mistake, and I believe it should be switched back.
>
> We should test to make sure that this doesn't break Run As -> Junit Test
> in eclipse.
>
> Rafal, can you do this?
>
> -Darius
>
> On Wed, May 12, 2010 at 9:44 AM, Ben Wolfe <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I think the problem is that when you run the tests in eclipse it
>     uses its own junit before it asks the .classpath for a junit.
>
>     The tests were passing at ant command line for you because it /only/
>     looks at the libs in /lib
>
>     Maybe removing that line will cause eclipse to ignore its own?
>
>     Ben
>
>
>     On 05/12/2010 12:43 PM, Rafal Korytkowski wrote:
>
>         Hi Darius,
>
>         I've just noticed. Then entry in .classpath is wrong. It says:
>
>         <classpathentry kind="con"
>         path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
>
>         but should be:
>
>         <classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
>
>         I'll add a ticket, is that ok?
>
>         Best regards,
>         Rafal
>
>         On 2010-05-12 18:40, Darius Jazayeri wrote:
>
>             We do have junit-4.8.1.jar in openmrs/lib/junit.
>
>             -Darius
>
>             On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
>             <[hidden email]
>             <mailto:[hidden email]><mailto:[hidden email]
>             <mailto:[hidden email]>>>  wrote:
>
>                  Ok, I've found the solution. I use Eclipse 3.4 with
>             JUnit in version
>                  org.junit4_4.3.1, which as it seems is too old. I
>             downloaded the
>                  newest version of JUnit i.e. junit-4.8.2.jar and added
>             it to
>                  Windows->Preferences->Java->Installed JREs->jdk. Now
>             works fine, but
>                  it's not nice to have it there. Why don't we put JUnit
>             in libs in
>                  OpenMRS?
>
>                  Best regards,
>                  Rafal
>
>
>                  On 2010-05-12 18:14, Rafal Korytkowski wrote:
>
>                      Thanks Ben for the reply. I'm on windows and
>             sunjdk. Ant task
>                      junit-report works fine, though one test fails
>             right now:
>                      PatientDashboardGraphControllerTest
>                      shouldReturnJSONWithPatientObservationDetails.
>             Anyway everything
>                      worked
>                      fine a moment ago before I synchronized with the
>             trunk (I didn't
>                      do it
>                      for a week or so). I am wondering if any
>             significant changes to the
>                      build path have been made recently? I see just
>             checkstyle and
>                      nothing else.
>
>                      Best regards,
>                      Rafal
>
>                      On 2010-05-12 18:01, Ben Wolfe wrote:
>
>                          Looks like an openjdk issue. I had to uninstall
>             openjdk and
>                          install
>                          sunjdk in ubuntu 10.04 to get the unit tests to
>             work again.
>                          I couldn't
>                          figure out why openjdk was failing and how to
>             fix it.
>
>                          We have a continuous integration server that
>             runs all the
>                          tests after
>                          each commit, so if you want to see if its just
>             your machine,
>                          you can
>                          check: http://ci.openmrs.org
>
>                          Ben
>
>                          On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:
>
>                              Hi,
>
>                              I updated a moment ago to the trunk and I
>             can't run
>                              JUnits from Eclipse
>                              anymore. Is it just me? I get an exception
>             at the very
>                              beginning:
>
>                              java.lang.TypeNotPresentException: Type
>             [unknown] not
>                              present
>                              at
>
>             sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>
>
>                              at $Proxy7.value(Unknown Source)
>                              at
>
>             org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>
>
>                              at
>
>             org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>                              at
>
>             org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>
>
>                              at
>
>             org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
>
>                              Caused by: java.lang.NoClassDefFoundError:
>                              org/junit/runners/BlockJUnit4ClassRunner
>                              at
>             java.lang.ClassLoader.defineClass1(Native Method)
>                              at
>             java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>                              at
>
>             java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>                              at
>
>             java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>                              at
>
>             java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>                              at
>             java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>                              at
>             java.security.AccessController.doPrivileged(Native
>                              Method)
>                              at
>
>             java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                              at
>             java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                              at
>
>             sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                              at
>             java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                              at
>
>             java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                              at java.lang.Class.forName0(Native Method)
>                              at java.lang.Class.forName(Class.java:247)
>                              at
>
>             sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>
>
>                              at
>
>             sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>
>
>                              at
>
>             sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>
>
>                              at
>
>             sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>
>
>                              at
>
>             java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>                              at
>
>             java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                              at
>
>             java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                              at
>             java.lang.Class.getAnnotation(Class.java:3029)
>                              at
>
>             org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>
>
>                              ... 9 more
>                              Caused by: java.lang.ClassNotFoundException:
>                              org.junit.runners.BlockJUnit4ClassRunner
>                              at
>             java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>                              at
>             java.security.AccessController.doPrivileged(Native
>                              Method)
>                              at
>
>             java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                              at
>             java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                              at
>
>             sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                              at
>             java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                              at
>
>             java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                              ... 37 more
>
>
>                          _________________________________________
>
>                          To unsubscribe from OpenMRS Developers' mailing
>             list, send
>                          an e-mail to
>             [hidden email] <mailto:[hidden email]>
>             <mailto:[hidden email]
>             <mailto:[hidden email]>>  with "SIGNOFF
>                          openmrs-devel-l" in the body
>                          (not the subject) of your e-mail.
>
>                          [mailto:[hidden email]
>             <mailto:[hidden email]>
>             <mailto:[hidden email]
>             <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>                  _________________________________________
>
>                  To unsubscribe from OpenMRS Developers' mailing list,
>             send an e-mail
>                  to [hidden email]
>             <mailto:[hidden email]><mailto:[hidden email]
>             <mailto:[hidden email]>>
>                  with "SIGNOFF openmrs-devel-l" in the  body (not the
>             subject) of
>                  your e-mail.
>
>                  [mailto:[hidden email]
>             <mailto:[hidden email]>
>             <mailto:[hidden email]
>             <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>             ------------------------------------------------------------------------
>             Click here to unsubscribe
>             <mailto:[hidden email]
>             <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l>
>               from
>             OpenMRS Developers' mailing list
>
>
>         _________________________________________
>
>         To unsubscribe from OpenMRS Developers' mailing list, send an
>         e-mail to [hidden email]
>         <mailto:[hidden email]> with "SIGNOFF
>         openmrs-devel-l" in the  body (not the subject) of your e-mail.
>
>         [mailto:[hidden email]
>         <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>
>
>     _________________________________________
>
>     To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
>     to [hidden email] <mailto:[hidden email]>
>     with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
>     your e-mail.
>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>
>
> ------------------------------------------------------------------------
> Click here to unsubscribe
> <mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
> OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Ben, I'll commit this fix if you agree.

-Darius

On Wed, May 12, 2010 at 9:53 AM, Rafal Korytkowski <[hidden email]> wrote:
works, but two lines are needed:


<classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
<classpathentry kind="lib" path="lib/junit/junit-dep-4.8.1.jar"/>

instead of:


<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

Best regards,
Rafal


On 2010-05-12 18:51, Darius Jazayeri wrote:
In 5685 (merging concept-name-tag) akolleger changed the .classpath to
use eclipse's junit rather than the included one. That seems like a
mistake, and I believe it should be switched back.

We should test to make sure that this doesn't break Run As -> Junit Test
in eclipse.

Rafal, can you do this?

-Darius

On Wed, May 12, 2010 at 9:44 AM, Ben Wolfe <[hidden email]
<mailto:[hidden email]>> wrote:

   I think the problem is that when you run the tests in eclipse it
   uses its own junit before it asks the .classpath for a junit.

   The tests were passing at ant command line for you because it /only/
   looks at the libs in /lib

   Maybe removing that line will cause eclipse to ignore its own?

   Ben


   On 05/12/2010 12:43 PM, Rafal Korytkowski wrote:

       Hi Darius,

       I've just noticed. Then entry in .classpath is wrong. It says:

       <classpathentry kind="con"
       path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

       but should be:

       <classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>

       I'll add a ticket, is that ok?

       Best regards,
       Rafal

       On 2010-05-12 18:40, Darius Jazayeri wrote:

           We do have junit-4.8.1.jar in openmrs/lib/junit.

           -Darius

           On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
           <[hidden email]
           <mailto:[hidden email]><mailto:[hidden email]

           <mailto:[hidden email]>>>  wrote:

                Ok, I've found the solution. I use Eclipse 3.4 with
           JUnit in version
                org.junit4_4.3.1, which as it seems is too old. I
           downloaded the
                newest version of JUnit i.e. junit-4.8.2.jar and added
           it to
                Windows->Preferences->Java->Installed JREs->jdk. Now
           works fine, but
                it's not nice to have it there. Why don't we put JUnit
           in libs in
                OpenMRS?

                Best regards,
                Rafal


                On 2010-05-12 18:14, Rafal Korytkowski wrote:

                    Thanks Ben for the reply. I'm on windows and
           sunjdk. Ant task
                    junit-report works fine, though one test fails
           right now:
                    PatientDashboardGraphControllerTest
                    shouldReturnJSONWithPatientObservationDetails.
           Anyway everything
                    worked
                    fine a moment ago before I synchronized with the
           trunk (I didn't
                    do it
                    for a week or so). I am wondering if any
           significant changes to the
                    build path have been made recently? I see just
           checkstyle and
                    nothing else.

                    Best regards,
                    Rafal

                    On 2010-05-12 18:01, Ben Wolfe wrote:

                        Looks like an openjdk issue. I had to uninstall
           openjdk and
                        install
                        sunjdk in ubuntu 10.04 to get the unit tests to
           work again.
                        I couldn't
                        figure out why openjdk was failing and how to
           fix it.

                        We have a continuous integration server that
           runs all the
                        tests after
                        each commit, so if you want to see if its just
           your machine,
                        you can
                        check: http://ci.openmrs.org

                        Ben

                        On 05/12/2010 11:51 AM, Rafal Korytkowski wrote:

                            Hi,

                            I updated a moment ago to the trunk and I
           can't run
                            JUnits from Eclipse
                            anymore. Is it just me? I get an exception
           at the very
                            beginning:

                            java.lang.TypeNotPresentException: Type
           [unknown] not
                            present
                            at

           sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)


                            at

           sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)


                            at $Proxy7.value(Unknown Source)
                            at

           org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)


                            at

           org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
                            at

           org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)


                            at

           org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)


                            at

           org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)


                            at

           org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)


                            at

           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)


                            at

           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)


                            at

           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)


                            at

           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


                            Caused by: java.lang.NoClassDefFoundError:
                            org/junit/runners/BlockJUnit4ClassRunner
                            at
           java.lang.ClassLoader.defineClass1(Native Method)
                            at
           java.lang.ClassLoader.defineClass(ClassLoader.java:621)
                            at

           java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
                            at

           java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
                            at

           java.net.URLClassLoader.access$000(URLClassLoader.java:56)
                            at
           java.net.URLClassLoader$1.run(URLClassLoader.java:195)
                            at
           java.security.AccessController.doPrivileged(Native
                            Method)
                            at

           java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                            at
           java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                            at

           sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                            at
           java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                            at

           java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                            at java.lang.Class.forName0(Native Method)
                            at java.lang.Class.forName(Class.java:247)
                            at

           sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)


                            at

           sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)


                            at

           sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)


                            at

           sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)


                            at

           sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)


                            at

           sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)


                            at

           sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)


                            at

           sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)


                            at

           sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)


                            at

           java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
                            at

           java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
                            at

           java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
                            at
           java.lang.Class.getAnnotation(Class.java:3029)
                            at

           org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)


                            ... 9 more
                            Caused by: java.lang.ClassNotFoundException:
                            org.junit.runners.BlockJUnit4ClassRunner
                            at
           java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                            at
           java.security.AccessController.doPrivileged(Native
                            Method)
                            at

           java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                            at
           java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                            at

           sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                            at
           java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                            at

           java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                            ... 37 more


                        _________________________________________

                        To unsubscribe from OpenMRS Developers' mailing
           list, send
                        an e-mail to
           [hidden email] <mailto:[hidden email]>
           <mailto:[hidden email]
           <mailto:[hidden email]>>  with "SIGNOFF
                        openmrs-devel-l" in the body
                        (not the subject) of your e-mail.

                        [mailto:[hidden email]
           <mailto:[hidden email]>
           <mailto:[hidden email]
           <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]


                _________________________________________

                To unsubscribe from OpenMRS Developers' mailing list,
           send an e-mail
                to [hidden email]
           <mailto:[hidden email]><mailto:[hidden email]

           <mailto:[hidden email]>>
                with "SIGNOFF openmrs-devel-l" in the  body (not the
           subject) of
                your e-mail.

                [mailto:[hidden email]
           <mailto:[hidden email]>
           <mailto:[hidden email]
           <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]


           ------------------------------------------------------------------------
           Click here to unsubscribe
           <mailto:[hidden email]
           <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l>
             from
           OpenMRS Developers' mailing list


       _________________________________________

       To unsubscribe from OpenMRS Developers' mailing list, send an
       e-mail to [hidden email]
       <mailto:[hidden email]> with "SIGNOFF
       openmrs-devel-l" in the  body (not the subject) of your e-mail.

       [mailto:[hidden email]
       <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]


   _________________________________________

   To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
   to [hidden email] <mailto:[hidden email]>
   with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
   your e-mail.

   [mailto:[hidden email]
   <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]


------------------------------------------------------------------------
Click here to unsubscribe
<mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list
Ben Wolfe Ben Wolfe
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

Yeah, sounds right. Go ahead and backport to 1.5.x and 1.6.x (different
junit libs though) so that those build right in the newest eclipse too.

Ben

On 05/12/2010 01:04 PM, Darius Jazayeri wrote:

> Ben, I'll commit this fix if you agree.
>
> -Darius
>
> On Wed, May 12, 2010 at 9:53 AM, Rafal Korytkowski
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     works, but two lines are needed:
>
>
>     <classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
>     <classpathentry kind="lib" path="lib/junit/junit-dep-4.8.1.jar"/>
>
>     instead of:
>
>
>     <classpathentry kind="con"
>     path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
>
>     Best regards,
>     Rafal
>
>
>     On 2010-05-12 18:51, Darius Jazayeri wrote:
>
>         In 5685 (merging concept-name-tag) akolleger changed the
>         .classpath to
>         use eclipse's junit rather than the included one. That seems like a
>         mistake, and I believe it should be switched back.
>
>         We should test to make sure that this doesn't break Run As ->
>         Junit Test
>         in eclipse.
>
>         Rafal, can you do this?
>
>         -Darius
>
>         On Wed, May 12, 2010 at 9:44 AM, Ben Wolfe
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>>
>         wrote:
>
>             I think the problem is that when you run the tests in eclipse it
>             uses its own junit before it asks the .classpath for a junit.
>
>             The tests were passing at ant command line for you because
>         it /only/
>             looks at the libs in /lib
>
>             Maybe removing that line will cause eclipse to ignore its own?
>
>             Ben
>
>
>             On 05/12/2010 12:43 PM, Rafal Korytkowski wrote:
>
>                 Hi Darius,
>
>                 I've just noticed. Then entry in .classpath is wrong. It
>         says:
>
>         <classpathentry kind="con"
>                 path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
>
>                 but should be:
>
>         <classpathentry kind="lib" path="lib/junit/junit-4.8.1.jar"/>
>
>                 I'll add a ticket, is that ok?
>
>                 Best regards,
>                 Rafal
>
>                 On 2010-05-12 18:40, Darius Jazayeri wrote:
>
>                     We do have junit-4.8.1.jar in openmrs/lib/junit.
>
>                     -Darius
>
>                     On Wed, May 12, 2010 at 9:38 AM, Rafal Korytkowski
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>><mailto:[hidden email]
>         <mailto:[hidden email]>
>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>>  wrote:
>
>                          Ok, I've found the solution. I use Eclipse 3.4 with
>                     JUnit in version
>                          org.junit4_4.3.1, which as it seems is too old. I
>                     downloaded the
>                          newest version of JUnit i.e. junit-4.8.2.jar
>         and added
>                     it to
>                          Windows->Preferences->Java->Installed
>         JREs->jdk. Now
>                     works fine, but
>                          it's not nice to have it there. Why don't we
>         put JUnit
>                     in libs in
>                          OpenMRS?
>
>                          Best regards,
>                          Rafal
>
>
>                          On 2010-05-12 18:14, Rafal Korytkowski wrote:
>
>                              Thanks Ben for the reply. I'm on windows and
>                     sunjdk. Ant task
>                              junit-report works fine, though one test fails
>                     right now:
>                              PatientDashboardGraphControllerTest
>                              shouldReturnJSONWithPatientObservationDetails.
>                     Anyway everything
>                              worked
>                              fine a moment ago before I synchronized
>         with the
>                     trunk (I didn't
>                              do it
>                              for a week or so). I am wondering if any
>                     significant changes to the
>                              build path have been made recently? I see just
>                     checkstyle and
>                              nothing else.
>
>                              Best regards,
>                              Rafal
>
>                              On 2010-05-12 18:01, Ben Wolfe wrote:
>
>                                  Looks like an openjdk issue. I had to
>         uninstall
>                     openjdk and
>                                  install
>                                  sunjdk in ubuntu 10.04 to get the unit
>         tests to
>                     work again.
>                                  I couldn't
>                                  figure out why openjdk was failing and
>         how to
>                     fix it.
>
>                                  We have a continuous integration server
>         that
>                     runs all the
>                                  tests after
>                                  each commit, so if you want to see if
>         its just
>                     your machine,
>                                  you can
>                                  check: http://ci.openmrs.org
>
>                                  Ben
>
>                                  On 05/12/2010 11:51 AM, Rafal
>         Korytkowski wrote:
>
>                                      Hi,
>
>                                      I updated a moment ago to the trunk
>         and I
>                     can't run
>                                      JUnits from Eclipse
>                                      anymore. Is it just me? I get an
>         exception
>                     at the very
>                                      beginning:
>
>                                      java.lang.TypeNotPresentException: Type
>                     [unknown] not
>                                      present
>                                      at
>
>
>           sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
>
>
>                                      at $Proxy7.value(Unknown Source)
>                                      at
>
>
>           org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
>
>
>                                      at
>
>
>           org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>                                      at
>
>
>           org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>
>
>                                      at
>
>
>           org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
>
>                                      Caused by:
>         java.lang.NoClassDefFoundError:
>
>         org/junit/runners/BlockJUnit4ClassRunner
>                                      at
>                     java.lang.ClassLoader.defineClass1(Native Method)
>                                      at
>                     java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>                                      at
>
>
>           java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>                                      at
>
>
>           java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>                                      at
>
>
>           java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>                                      at
>                     java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>                                      at
>                     java.security.AccessController.doPrivileged(Native
>                                      Method)
>                                      at
>
>
>           java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                                      at
>                     java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                                      at
>
>
>           sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                                      at
>                     java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                                      at
>
>
>           java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                                      at java.lang.Class.forName0(Native
>         Method)
>                                      at
>         java.lang.Class.forName(Class.java:247)
>                                      at
>
>
>           sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>
>
>                                      at
>
>
>           sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>
>
>                                      at
>
>
>           sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>
>
>                                      at
>
>
>           sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>
>
>                                      at
>
>
>           java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
>                                      at
>
>
>           java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                                      at
>
>
>           java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
>                                      at
>                     java.lang.Class.getAnnotation(Class.java:3029)
>                                      at
>
>
>           org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
>
>
>                                      ... 9 more
>                                      Caused by:
>         java.lang.ClassNotFoundException:
>
>         org.junit.runners.BlockJUnit4ClassRunner
>                                      at
>                     java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>                                      at
>                     java.security.AccessController.doPrivileged(Native
>                                      Method)
>                                      at
>
>
>           java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>                                      at
>                     java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>                                      at
>
>
>           sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>                                      at
>                     java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>                                      at
>
>
>           java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>                                      ... 37 more
>
>
>                                  _________________________________________
>
>                                  To unsubscribe from OpenMRS Developers'
>         mailing
>                     list, send
>                                  an e-mail to
>         [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>  with "SIGNOFF
>                                  openmrs-devel-l" in the body
>                                  (not the subject) of your e-mail.
>
>                                  [mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>                          _________________________________________
>
>                          To unsubscribe from OpenMRS Developers' mailing
>         list,
>                     send an e-mail
>                          to [hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>><mailto:[hidden email]
>         <mailto:[hidden email]>
>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>
>                          with "SIGNOFF openmrs-devel-l" in the  body
>         (not the
>                     subject) of
>                          your e-mail.
>
>                          [mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>
>           ------------------------------------------------------------------------
>                     Click here to unsubscribe
>         <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l>
>                       from
>                     OpenMRS Developers' mailing list
>
>
>                 _________________________________________
>
>                 To unsubscribe from OpenMRS Developers' mailing list,
>         send an
>                 e-mail to [hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>> with "SIGNOFF
>                 openmrs-devel-l" in the  body (not the subject) of your
>         e-mail.
>
>                 [mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>             _________________________________________
>
>             To unsubscribe from OpenMRS Developers' mailing list, send
>         an e-mail
>             to [hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>             with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
>             your e-mail.
>
>             [mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>?body=SIGNOFF%20openmrs-devel-l]
>
>
>         ------------------------------------------------------------------------
>         Click here to unsubscribe
>         <mailto:[hidden email]
>         <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l>
>         from
>         OpenMRS Developers' mailing list
>
>
>     _________________________________________
>
>     To unsubscribe from OpenMRS Developers' mailing list, send an e-mail
>     to [hidden email] <mailto:[hidden email]>
>     with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of
>     your e-mail.
>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>?body=SIGNOFF%20openmrs-devel-l]
>
>
> ------------------------------------------------------------------------
> Click here to unsubscribe
> <mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
> OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Wyclif Luyima Wyclif Luyima
Reply | Threaded
Open this post in threaded view
|

Re: JUnits fail to start [Eclipse - Run As JUnit Test]

In reply to this post by Rafal Korytkowski
Hey Rafal,
I ran into that problem and I noticed the problem is with eclipse most probably, it comes bundled with an old version of junit, you need to get I think version 4.8.x. In case you are still having trouble try this, first you will need to look at your referenced jars for your openmrs project in eclipse, find the one for junit and see where  eclipse is looking up the junit jar file, replace that jar file with the latest and make sure to maintain the name of the jar file 'junit.jar', this way you will avoid changing the '.classpath' file for openmrs which might cause problems to others who upgrade after you have committed.

Wyclif

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Rafal Korytkowski
Sent: Wednesday, May 12, 2010 11:52
To: [hidden email]
Subject: [OPENMRS-DEV] JUnits fail to start [Eclipse - Run As JUnit Test]

Hi,

I updated a moment ago to the trunk and I can't run JUnits from Eclipse
anymore. Is it just me? I get an exception at the very beginning:

java.lang.TypeNotPresentException: Type [unknown] not present
        at
sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27)
        at
sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56)
        at $Proxy7.value(Unknown Source)
        at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:49)
        at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:28)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:24)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NoClassDefFoundError:
org/junit/runners/BlockJUnit4ClassRunner
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at
sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
        at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
        at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
        at
sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
        at
sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
        at
sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at
sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
        at java.lang.Class.getAnnotation(Class.java:3029)
        at
org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:45)
        ... 9 more
Caused by: java.lang.ClassNotFoundException:
org.junit.runners.BlockJUnit4ClassRunner
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 37 more

--
Best regards,
Rafal

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]