jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro" <ma-rami...@wiu.edu>
Subject Re: Setting up Cactus Tests with NetBeans IDE 3.5, Tomcat 4.1.24, and CactusStrutsTest 1.9.6
Date Mon, 30 Jun 2003 16:15:53 GMT
Actually, take that back. I was using MockStrutsTestCase (which doesn't use
Cactus), by mistake. I changed the extends class and the import lines in
both the Client and Container, to use CactusStrutsTestCase.

Here's my new configuration:
Client Side:
c:\subversion\argyle\trunk\qa\test\org\cait\argyle\module\bulletinBoard\stru
ts\action\TestAddTopicAction.class
c:\subversion\argyle\trunk\qa\test\org\cait\argyle\module\bulletinBoard\stru
ts\action\cactus.properties
c:\subversion\argyle\trunk\qa\test\org\cait\argyle\module\bulletinBoard\stru
ts\action\log4j.properties

Container Side:
c:\TOMCAT\webapps\bulletinBoard\WEB-INF\classes\TestAddTopicAction.class
c:\TOMCAT\webapps\bulletinBoard\WEB-INF\classes\cactus.properties
c:\TOMCAT\webapps\bulletinBoard\WEB-INF\classes\log4j.properties
c:\TOMCAT\webapps\bulletinBoard\WEB-INF\lib\argyle.jar (with my classes
under test here)


When I run the Client Side class, I get the error below
Questions:
1) My cactus.properties file includes only the required cactus.setContextURL
parameter, do I need to add the other ones?
2) Where do I need to put the CACTUS jar files? I currently have them in
TOMCAT\common\lib
3) Is this correct?: The IMPORT line in both my Client Side and Container
Side java classes is the same:
        import qa.test.org.cait.argyle.module.bulletinBoard.struts.action;


Apparently everything's in place.


----ERROR-------------------------------------------------------------------
-----------------------
.log4j:WARN No appenders could be found for logger
(org.apache.cactus.util.JUnitVersionHelper).
log4j:WARN Please initialize the log4j system properly.
E
Time: 0.07
There was 1 error:
1)
testSuccessfulAddTopic(qa.test.org.cait.argyle.module.bulletinBoard.struts.a
ction.TestAddTopicAction)org.apache.cactus.util.ChainedRuntimeException:
Missing Cactus property [cactus.contextURL]
        at
org.apache.cactus.util.Configuration.getContextURL(Configuration.java:185)
        at
org.apache.cactus.util.ServletConfiguration.getServletRedirectorURL(ServletC
onfiguration.java:94)
        at
org.apache.cactus.client.ServletHttpClient.getRedirectorURL(ServletHttpClien
t.java:87)
        at
org.apache.cactus.client.AbstractHttpClient.callRunTest(AbstractHttpClient.j
ava;org/apache/cactus/util/log/LogAspect.aj(1k):184)
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(AbstractHttpCli
ent.java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
        at
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHttpClien
t.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java;o
rg/apache/cactus/util/log/LogAspect.aj(1k):104)
        at
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase.jav
a:260)
        at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
        at
qa.test.org.cait.argyle.module.bulletinBoard.struts.action.TestAddTopicActio
n.main(TestAddTopicAction.java:96)
FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1

----ERROR-------------------------------------------------------------------
-----------------------





----- Original Message ----- 
From: "Christopher Lenz" <cmlenz@gmx.de>
To: "Cactus Users List" <cactus-user@jakarta.apache.org>
Sent: Monday, June 30, 2003 10:14 AM
Subject: Re: Setting up Cactus Tests with NetBeans IDE 3.5, Tomcat 4.1.24,
and CactusStrutsTest 1.9.6


Hi Alejandro,

Alejandro wrote:
> Hello,
>
>     I am using the *CactusStrutsTestCase* class to test Struts Actions
> using Cactus. I am all confused by the configuration. This is my current
> setup:
>
> - NetBeans IDE v3.5
> - Tomcat 4.1.24
> - Cactus 1.4.1
> - Struts 1.0
> - StrutsTest 1.9.6
> --------------------------------------------------------------------------
----------------------------------
> *1. Web App (Classes under Test - http:\\localhost:8080\bulletinBoard):*
> c:\jakarta-tomcat-4.1.24\webapps\bulletinBoard\WEB-INF\lib\argyle.jar
> (this JAR includes:
>     org.cait.argyle.module.bulletinBoard.struts.action.AddTopicAction
>
> *2. Test Files (Cactus):*
> c:\jakarta-tomcat-4.1.24\webapps\bulletinBoard\TestAddTopicAction

Hmm, that looks wrong. That should be

   ...\webapps\bulletinBoard\WEB-INF\classes\TestAddTopicAction.class

IIUC

> --------------------------------------------------------------------------
----------------------------------
> 1) Is this setup correct?
> 2) According to the documentation I put the Cactus' properties files as
> follows:
>
> "Client Side":
>     I added the cactus.properties and log4j.properties to my CLASSPATH
> in NetBeans by right-clicking and set "Add to Project".

That didn't seem to do the trick, otherwise you wouldn't get the exception
below. I don't know NetBeans, but there must be some other way to add the
cactus.properties file to the classpath.

> "Container Side":
>     - cactus.properties and log4j at:    ...\webapps\bulletinBoard\

Again, that should be ...\webapps\bulletinBoard\WEB-INF\classes

-chris

> but every time I try to run my tests, Cactus complains with the
> following errors:
>
> .E
> Time: 0.07
> There was 1 error:
> 1)
>
testFailedAddTopic(bulletinBoard.TestAddTopicAction)org.apache.cactus.util.C
hainedRuntimeException:
> Missing Cactus property [cactus.contextURL]
>         at
> org.apache.cactus.util.Configuration.getContextURL(Configuration.java:185)
>         at
>
org.apache.cactus.util.ServletConfiguration.getServletRedirectorURL(ServletC
onfiguration.java:94)
>         at
>
org.apache.cactus.client.ServletHttpClient.getRedirectorURL(ServletHttpClien
t.java:87)
>         at
>
org.apache.cactus.client.AbstractHttpClient.callRunTest(AbstractHttpClient.j
ava;org/apache/cactus/util/log/LogAspect.aj(1k):184)
>         at
>
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(AbstractHttpCli
ent.java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
>         at
>
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHttpClien
t.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
>         at
>
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java;o
rg/apache/cactus/util/log/LogAspect.aj(1k):104)
>         at
>
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase.jav
a:260)
>         at
> org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
>         at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
>         at
bulletinBoard.TestAddTopicAction.main(TestAddTopicAction.java:96)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
> log4j:WARN No appenders could be found for logger
> (org.apache.cactus.util.JUnitVersionHelper).
> log4j:WARN Please initialize the log4j system properly.


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



Mime
View raw message