Title: RE: Can't find test problem
I believe I understand the architecture, I'm just not sure how to implement a solution to this problem. No Classpath entry that I try, even manually modifying the system class path seems to work. Wouldn't it be here that the ${out.classes.dir} below should handle this? Any other strategies would be greatly appreciated. Thanks.
 
<target name="tests">
        <echo message="${java.class.path}"/>
        <junit printsummary="yes" haltonfailure="yes" haltonerror="yes" fork="yes">
 
            <classpath>
                <pathelement path="${java.class.path}"/>
                <pathelement location="${servlet.jar}"/>
                <pathelement location="${log4j.jar}"/>
                <pathelement location="${cactus.jar}"/>
                <pathelement location="${out.classes.dir}"/>
                <pathelement location="${basedir}"/>
            </classpath>
 
            <formatter type="plain" usefile="false"/>
            <!-- Functional tests -->
            <test name="TestSimpleServlet"/>
        </junit>
 
    </target>
-----Original Message-----
From: Vincent Massol [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Can't find test problem

Hi Steve,
 
Please have a look at the architecture page, it should give a good understanding of how everything works : http://jakarta.apache.org/commons/cactus/architecture.html
Tell me if there are still things that you don't understand.
Thanks
-Vincent
----- Original Message -----
Sent: Wednesday, August 01, 2001 10:17 PM
Subject: RE: Can't find test problem

What do you mean by the _server_ classpath? I'm still a little confused as to what to do here.

-----Original Message-----
From: Jari Worsley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 12:53 PM
To: [EMAIL PROTECTED]
Subject: Re: Can't find test problem


Steve Grant wrote:
>
> I'm always getting this when running the sample ant scripts - is there
> some kind of class path modification I need to do. Sorry if this is
> posted twice.
>
> [junit] Running
> org.apache.commons.cactus.sample.unit.TestServletTestCase_TestResult
>      [java] 2001-07-31 12:15:06 - path="/test" :ServletRedirector:
> init
>      [java] java.lang.ClassNotFoundException:
> org.apache.commons.cactus.sample.unit.TestServletTestCase_TestResult
>      [java]  at java.net.URLClassLoader$1.run(URLClassLoader.java,
> Compiled Code)
>      [java]  at java.lang.Exception.<init>(Exception.java, Compiled
> Code)
>      [java]  at
> java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java,
> Compiled Code)
>      [java]  at java.net.URLClassLoader$1.run(URLClassLoader.java,
> Compiled Code)
>      [java]  at java.security.AccessController.doPrivileged(Native
> Method)
>      [java]  at java.net.URLClassLoader.findClass(URLClassLoader.java,
> Compiled Code)
>      [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java,
> Compiled Code)


your test classes need to be available to both client side and server
side.

that means that if you have some tests compiled and running in
container, say under a WEB-INF/classes directory, then you need to make
sure those are available to whatever client side program you are running
the tests from - say ant running the optional task, or even directly
from the junit.swingui.TestRunner class. (or vice versa)

From the above trace it looks like your server can't find the test
classes - check they are in the _server_ classpath.

Jari

--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd

Reply via email to