Classpath used to run unit tests?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Classpath used to run unit tests?

Marc Guillemot
Hi,

how is computed the classpath used for running unit tests?

My code relies on an old asm version that I have configured in my
dependencies. When running the tests with -d I can see

Using application classpath [...
file:/home/marc/.gradle/cache/asm/asm/jars/asm-3.1.jar
...]
Using implementation classpath [...
file:/home/marc/misc/gradle/gradle-0.9-preview-1/lib/asm-all-3.2.jar
...]

and then I get a:
java.lang.NoSuchMethodError:
org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;Z)V

what seems to indicate that the wrong asm version is used: one added by
gradle for its own purpose and not the one that I've configured.

Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Classpath used to run unit tests?

Adam Murdoch-2


On 30/04/10 12:44 AM, Marc Guillemot wrote:

> Hi,
>
> how is computed the classpath used for running unit tests?
>
> My code relies on an old asm version that I have configured in my
> dependencies. When running the tests with -d I can see
>
> Using application classpath [...
> file:/home/marc/.gradle/cache/asm/asm/jars/asm-3.1.jar
> ...]
> Using implementation classpath [...
> file:/home/marc/misc/gradle/gradle-0.9-preview-1/lib/asm-all-3.2.jar
> ...]

Application classpath contains the tests and classes under test and
their dependencies. Implementation classpath contains the classes for
the Gradle junit runner. They are loaded in separate, isolated
ClassLoaders, so in theory the classpath for one should not affect the
classpath for the other.

>
> and then I get a:
> java.lang.NoSuchMethodError:
> org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;Z)V
>

Can you send in the stack trace for this exception? Also, which version
of Gradle are you using?

When I try a test project that uses this method with asm 3.1, it all
works fine.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Classpath used to run unit tests?

Marc Guillemot
Adam Murdoch wrote:
>...
>>
>> and then I get a:
>> java.lang.NoSuchMethodError:
>> org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;Z)V
>>
>
> Can you send in the stack trace for this exception? Also, which version
> of Gradle are you using?

in the mean time I have hacked the library to use the latest asm vesion
and don't have the problem anymore. I'll provide a stack trace if I
encounter it again.

This is with Gradle 0.9-preview-1

Cheers,
Marc.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email