What about block.xml? Remove all classloader entries?
Jarek
----- Original Message -----
From: "Stephen McConnell" <[EMAIL PROTECTED]>
To: "Avalon framework users" <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 2:49 PM
Subject: Re: Ant,JUnit and AbstractMerlinTestCase
Jarosław Pałka wrote:
> It's me again :))
Hi! Guess what - I figured out your problem. You defining a
classloader using junit which contains a bunch of classes that are
dependent on resources you have registered in merlin. Here is the graph:
0. system classloader
1. ant classloader
2. junit classloader <------ contains your test classes which
are presumably dependent on your
build classes
3. merlin api classloader <- contains abstract log enabled
When the JVM loads you test class or a build class it looks for
dependent classes up the hierarchy. In the above scenario the classes
are actually in a classloader below the location of the test and build
classes. To resolve this you should add the resources that are declared
in the container classloader definition to the junit classpath.
> I'am almost at the end of the road. Here is my ant target:
>
> <target name="unittest">
> <junit showoutput="true" fork="true" printsummary="yes">
> <classpath>
> <pathelement path="${build.tests.dir}"/>
> <pathelement path="${libs.dir}/merlin-kernel-unit-3.2.5.jar"/>
> <pathelement
path="${libs.dir}/avalon-repository-main-1.2.jar"/>
> <pathelement path="${libs.dir}/junit-3.8.1.jar"/>
Add all of the resources referenced in the container classloader
definition here (and your build directory as well).
> </classpath>
Adding the following line is also a good idea:
<sysproperty key="basedir" value="${basedir}"/>
> <batchtest fork="true" todir="${build.tests.dir}">
> <formatter type="xml"/>
> <fileset dir="${build.tests.dir}">
> <include name="com/mrt/vend/impl/tests/**"/>
> </fileset>
> </batchtest>
> </junit>
> </target>
I'm keeping my fingers crossed but my guess is the above changes should
solve the problem.
Stephen.
--
|------------------------------------------------|
| Magic by Merlin |
| Production by Avalon |
| |
| http://avalon.apache.org/merlin |
| http://dpml.net/merlin/distributions/latest |
|------------------------------------------------|
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
Najwiekszy serwis aukcyjny w Internecie? Sprawdz!
>>> http://www.aukcje.interia.pl/ <<<
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]