jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Joschko" <joc...@phreaker.net>
Subject AW: Where to find org.apache.cactus.unit.TestAll ?
Date Fri, 16 Aug 2002 09:37:27 GMT
Hi,
still trying to get a test to work. Here is my corrected ant task and the
output. Why can't it find the TestSampleServlet class? It's the one to be
downloaded in "quickstart". And I'm 100% sure it's under the given
pathelement location name.

   <junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
fork="yes">
       <classpath>
            <pathelement
location="/home/markus/downloads/jakarta-cactus-13-1.4b1/test/cactus.propert
ies"/>

 --here-->  <pathelement
location="/home/markus/downloads/jakarta-cactus-13-1.4b1/test/WEB-INF/classe
s/TestSampleServlet.class"/>

		<fileset
dir="/home/markus/downloads/jakarta-cactus-13-1.4b1/test/WEB-INF/classes">
			<include name="**/*.class"/>
		</fileset>

		<path refid="project.class.path"/>
         </classpath>

         <formatter type="plain" usefile="false"/>

         <test name="TestSampleServlet.TestAll"/>
    </junit>

Output is:

test:
    [junit] Running TestSampleServlet.TestAll
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Testsuite: TestSampleServlet.TestAll
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit]
    [junit]     Caused an ERROR
    [junit] TestSampleServlet.TestAll
    [junit] java.lang.ClassNotFoundException: TestSampleServlet.TestAll
    [junit]     at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    [junit]     at java.security.AccessController.doPrivileged(Native
Method)
    [junit]     at
java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [junit]     at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    [junit]     at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
    [junit]     at java.lang.Class.forName0(Native Method)
    [junit]     at java.lang.Class.forName(Class.java:130)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTes
tRunner.java:171)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTes
tRunner.java:156)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestR
unner.java:407)

Why?
 Thx,
  MArkus


-----Ursprüngliche Nachricht-----
Von: Vincent Massol [mailto:vmassol@octo.com]
Gesendet: Donnerstag, 15. August 2002 19:20
An: 'Cactus Users List'
Betreff: RE: Where to find org.apache.cactus.unit.TestAll ?


Hi Markus,

I think reading http://jakarta.apache.org/cactus/howto_config.html will
help. It explains clearly (I hope) how your classpath must look like.

JUnit does know anything about the container. Cactus does. JUnit is just
there to provide the TestRunner, Cactus does the rest.

Thanks
-Vincent

> -----Original Message-----
> From: Markus Joschko [mailto:jocsch@phreaker.net]
> Sent: 15 August 2002 18:23
> To: Cactus Users List
> Subject: AW: Where to find org.apache.cactus.unit.TestAll ?
>
> Hi Vincent,
> ok, I'm sorry for bothering you with the test value. I didn't know
that I
> have to provide the TestAll method. Reading the junit task doc could
have
> helped me :-(
> The mess with the <pathelement> is just because of the fast
> developing/trying and I wanted to be on the save side ;-) (my ant is a
> little bit rosty) I will fix it.
>
> But two questions are still there: Why shouldn't I pack the jars into
the
> classpath? I thougt the jars are neccessary for the client. Isn't the
> junit
> task the client?
>
> Second: How will junit know how to call the xx.TestAll inside the
> container?
> Which name would be the "suite" parameter for the ServletRedirector?
> Haven't
> found anything in the how-tos about that.
>
> Sorry for having such a poor understanding about the process. Hope I
will
> understand the whole process soon.
>
> Cu,
>  MArkus
>
> -----Ursprüngliche Nachricht-----
> Von: Vincent Massol [mailto:vmassol@octo.com]
> Gesendet: Donnerstag, 15. August 2002 18:48
> An: 'Cactus Users List'
> Betreff: RE: Where to find org.apache.cactus.unit.TestAll ?
>
>
> Hi Markus,
>
> Yes, you're right. I read too fast the exception ... Ok, several
points,
> see below.
>
> > -----Original Message-----
> > From: Markus Joschko [mailto:jocsch@phreaker.net]
> > Sent: 15 August 2002 17:46
> > To: Cactus Users List
> > Subject: AW: Where to find org.apache.cactus.unit.TestAll ?
> >
> > Which <classpath> elements do you mean? The one of the junit task?
> > Shouldn't
> > this be more than sufficient ? But why should I look for the
> junit.jar?
> > There is the org.apache.cactus.unit.TestAll class not included ...
> >
>
> ??
>
> TestAll is to be provided by you ... Actually you don’t even need one,
> it's up to you really. In any case, it has nothing to do with the
Cactus
> framework. Cactus Sample provides one but that's for its sample; it is
> not a feature of the core.
>
> > <junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
> >             fork="yes">
> >
> >             <classpath>
> >                 <!-- Cactus.propertie and log_client.properties need
> to be
> > in
> >                      the classpath -->
> >                 <pathelement
> > location="/xxx/jakarta-cactus-13-1.4b1/test/cactus.properties"/>
>
> ??
>
> This is wrong. Putting a file in the classpath means putting the
> directory where it is located in the classpath or the file name *if*
it
> is a jar or zip.
>
> >                 <pathelement
> > location="/xxx/jakarta-cactus-13-1.4b1/test/WEB-INF/classes"/>
> >                 <pathelement
> location="/xxx/jakarta-cactus-13-1.4b1/lib"/>
>
> ??
>
> What's inside lib/ ? Jars ? If so, you should know that you need to
> explicitely put the jar name in the classpath ...
>
> >                 <pathelement
> > location="/xxx/jakarta-cactus-13-1.4b1/test/cactus.properties"/>
>
> Why do you add it twice ?
>
> >                 <pathelement
> location="{$ANT_HOME}/lib/junit-3.7.jar"/>
>
> I believe this is a typo. {$ANT_HOME) <--> ${ANT_HOME} ...
>
> >
> >                  <fileset dir="/xxx/jakarta-cactus-13-1.4b1/lib">
> > 		     		<include name="**/*.jar"/>
> > 		 	</fileset>
>
> ahhh. That's better ... But why do you put lib/ in the classpath ? It
is
> very unusual.
>
> >
> >                 <path refid="project.class.path"/>
> >             </classpath>
> >
> >             <formatter type="plain" usefile="false"/>
> >
> >             <!-- Note: The unit tests must be run first. See
> >                  org.apache.cactus.unit.TestAll for details -->
> >             <test name="org.apache.cactus.unit.TestAll"/>
> >             <test name="org.apache.cactus.sample.TestAll"/>
>
> Are you running the Cactus samples ? If so, everything is ready and
> packages in the Cactus distribution you have downloaded.
>
> >
> >         </junit>
> >
> > ??
>
> -Vincent
>
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Vincent Massol [mailto:vmassol@octo.com]
> > Gesendet: Donnerstag, 15. August 2002 18:19
> > An: 'Cactus Users List'
> > Betreff: RE: Where to find org.apache.cactus.unit.TestAll ?
> >
> >
> > Ok. Second possibility then:
> >
> > Do you have junit.jar in your client side classpath (i.e. in the
> > <classpath> elements in your build.xml) ? I would bet that you use
> > 'fork="true"' for the <junit> task, right ? :-) If so, a new JVM a
> > started and thus you need to put junit.jar in your classpath.
> >
> > Cheers,
> > -Vincent
> >
> > > -----Original Message-----
> > > From: Markus Joschko [mailto:jocsch@phreaker.net]
> > > Sent: 15 August 2002 17:23
> > > To: Cactus Users List
> > > Subject: AW: Where to find org.apache.cactus.unit.TestAll ?
> > >
> > > I put junit-3.7.jar delivered with cactus in my $ANT_HOME/lib.
> > Elsewhere
> > > the
> > > junit task wouldn't run....
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Vincent Massol [mailto:vmassol@octo.com]
> > > Gesendet: Donnerstag, 15. August 2002 16:44
> > > An: 'Cactus Users List'
> > > Betreff: RE: Where to find org.apache.cactus.unit.TestAll ?
> > >
> > >
> > > Markus,
> > >
> > > You need junit.jar in your ANT_HOME/lib directory.
> > >
> > > -Vincent
> > >
> > > > -----Original Message-----
> > > > From: markus.joschko@web.de [mailto:markus.joschko@web.de]
> > > > Sent: 15 August 2002 15:09
> > > > To: cactus-user@jakarta.apache.org
> > > > Subject: Where to find org.apache.cactus.unit.TestAll ?
> > > >
> > > > Hi,
> > > > I hope that's one of the easier questions for you. I'm new to
> cactus
> > > and
> > > > tried to test a sample servlet with the ant junit task (ant1.4).
I
> > > didn't
> > > > use a provided sampleconfiguration because my web container is
> jetty
> > > build
> > > > in into jboss. During my test following error occurs:
> > > >
> > > > test:
> > > >     [junit] Running org.apache.cactus.unit.TestAll
> > > >     [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed:
0
> > sec
> > > >     [junit] Testsuite: org.apache.cactus.unit.TestAll
> > > >     [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed:
0
> > sec
> > > >     [junit]
> > > >     [junit]     Caused an ERROR
> > > >     [junit] org.apache.cactus.unit.TestAll
> > > >     [junit] java.lang.ClassNotFoundException:
> > > > org.apache.cactus.unit.TestAll
> > > >     [junit]     at
> > > java.net.URLClassLoader$1.run(URLClassLoader.java:198)
> > > >     [junit]     at
> > java.security.AccessController.doPrivileged(Native
> > > > Method)
> > > >     [junit]     at
> > > > java.net.URLClassLoader.findClass(URLClassLoader.java:186)
> > > >     [junit]     at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > > >     [junit]     at
> > > > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
> > > >     [junit]     at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:262)
> > > >     [junit]     at
> > > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
> > > >     [junit]     at java.lang.Class.forName0(Native Method)
> > > >     [junit]     at java.lang.Class.forName(Class.java:130)
> > > >     [junit]     at
> > > >
> > >
> >
>
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUni
> > > tT
> > > > es
> > > > tRunner.java:171)
> > > >     [junit]     at
> > > >
> > >
> >
>
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUni
> > > tT
> > > > es
> > > > tRunner.java:156)
> > > >     [junit]     at
> > > >
> > >
> >
>
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitT
> > > es
> > > > tR
> > > > unner.java:407)
> > > >     [junit]
> > > >
> > > > BUILD FAILED
> > > >
> > > > OK, no problem. I think it's a typical classpath problem and so
I
> > > tried to
> > > > find the jar in which the class is included (because I thought
> that
> > I
> > > have
> > > > included every delivered jar file) ..... but I can't find
anyone.
> > > Maybe
> > > > I'm
> > > > blind or to dump. Can you please tell me the jar in which the
> class
> > is
> > > > included?
> > > >
> > > > Thanks,
> > > >  Markus
> > > >
> > > > P.S.: That's my junit task:test:
> > > >
> > > >  <target name="test">
> > > >         <junit printsummary="yes" haltonfailure="yes"
> > > haltonerror="yes"
> > > >             fork="yes">
> > > >
> > > >             <classpath>
> > > >                 <!-- Cactus.propertie and log_client.properties
> need
> > > to be
> > > > in
> > > >                      the classpath -->
> > > >                 <pathelement
> > > > location="/home/markus/downloads/jakarta-cactus-13-
> > > > 1.4b1/test/cactus.propert
> > > > ies"/>
> > > >                 <pathelement
> > > >
location="/home/markus/downloads/jakarta-cactus-13-1.4b1/test/WEB-
> > > > INF/classe
> > > > s"/>
> > > >                 <pathelement
> > > > location="/home/markus/downloads/jakarta-cactus-13-1.4b1/lib"/>
> > > >
> > > >           <!-- <fileset
> > > >
> > >
> >
>
dir="/home/markus/downloads/jakarta-cactus-13-1.4b1/test/WEB-INF/classes
> > > ">
> > > > 		     		<include name="**/*"/>
> > > > 		 		</fileset>
> > > >
> > > > 	 		    <fileset
> > > dir="/home/markus/downloads/jakarta-cactus-
> > > > 13-1.4b1/lib">
> > > > 		     		<include name="**/*.jar"/>
> > > > 		 		</fileset>-->
> > > >
> > > >                 <path refid="project.class.path"/>
> > > >             </classpath>
> > > >
> > > >             <formatter type="plain" usefile="false"/>
> > > >
> > > >             <!-- Note: The unit tests must be run first. See
> > > >                  org.apache.cactus.unit.TestAll for details -->
> > > >             <test name="org.apache.cactus.unit.TestAll"/>
> > > >             <test name="org.apache.cactus.sample.TestAll"/>
> > > >
> > > >         </junit>
> > > >
> > > >     </target>
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:   <mailto:cactus-user-
> > > > unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail: <mailto:cactus-user-
> > > > help@jakarta.apache.org>
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:cactus-user-help@jakarta.apache.org>
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <mailto:cactus-user-
> > > unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: <mailto:cactus-user-
> > > help@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:cactus-user-help@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:cactus-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:cactus-user-
> > help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:cactus-user-help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:
<mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:cactus-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message