jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhang, Li" <Li.Zh...@eal.ab.ca>
Subject RE: Cannot use "runservertest" in an Ant build.xml to start JRun 3.1
Date Mon, 04 Feb 2002 17:40:15 GMT
Hi, Vincent,

Thank you. Your email reminded me something I did in the Apache http.conf
file. When I set up the JRun connector with Apache, I put "JRunConfig
errorurl /unavailable" in the http.conf which means if JRun is not started,
the connector will redirect to "unavailable.html" in the web server's
document root. That's why "runservertests" thought the JRun was already
started by testing the connection to the "testURL" (but actually it was
not). That probably explains why Ant does not complain if I remove
"startTarget" tag from "runservertests" (I haven't yet downloaded the source
code so don't know exactly the call sequence).

Now the "runservertests" works very well after I removed the "JRunConfig
errorurl" setting in the http.conf.

The reason why I call "sleep" is my application needs to pre-load a servlet
before I can do the tests. The pre-loaded servlet will load the config
information of the application, set up logging system, and do other
initialization tasks. Other servlets will use the config info later. The
"runservertests" invokes the tests after it starts the application server
(but at that time the preloaded servlet may not be started yet). It is good
to have an attribute like "wait" in the "runservertests" which specifies the
idle time between the time Ant starts doing tests and the time Ant finishes
starting the application server so the application can do some necessary
initialization.

Thank you again for your time to help me out of this.

Li


-----Original Message-----
From: Vincent Massol [mailto:vmassol@octo.com]
Sent: Saturday, February 02, 2002 4:04 AM
To: 'Cactus Users List'
Subject: RE: Cannot use "runservertest" in an Ant build.xml to start
JRun 3.1 


Li,

I've looked at your scripts and they look fine (although there is no
need to sleep with the runservertests task - which is why it is better
than the parallel/sequential stuff).

Indeed, it appears that start_jrun is not called by runservertests ...
The only case when it would not be called is if the testURL URL succeeds
in connecting to a server. The rationale behing this is : if the server
is already started, runservertests will not start it again nor will it
stop it after the tests have run. This is to allow the use of dynamic
reloading of containers and thus shorten the time to test.

Prior to starting the Ant, can you verify with a browser that connection
to http://localhost/asp fails (404 error) ?

Something I don't understand : you said earlier that if you removed
"startTarget=xxx" then stop_jrun was executed... I don't understand this
as internally the code is :

        // Verify that a test URL has been specified
        if (this.testURL == null) {
            throw new BuildException("A testURL attribute must be
specified");
        }

        // Verify that a start target has been specified
        if (this.startTarget == null) {
            throw new BuildException("A startTarget Ant target name must
" +
                "be specified");
        }

which means Ant will report an error if you start to run the
runservertests without a startTarget attribute.

Something wrong here...
-Vincent

> -----Original Message-----
> From: Zhang, Li [mailto:Li.Zhang@eal.ab.ca]
> Sent: 01 February 2002 23:29
> To: 'Cactus Users List'
> Subject: RE: Cannot use "runservertest" in an Ant build.xml to start
JRun
> 3.1
> 
> 
> 
> Hi, Vincent and other cactus/Ant gurus:
> 
> I have attached the ant build files and ant console output here. The
> bad-build.xml uses runservertests and generated bad-output.txt. The
> good-build.xml uses Ant tasks to start/stop JRun and generated
> good-output.txt.
> 
> Thank you.
> 
> Li
> 
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: Friday, February 01, 2002 12:25 PM
> To: 'Cactus Users List'
> Subject: RE: Cannot use "runservertest" in an Ant build.xml to start
> JRun 3.1
> 
> 
> Li,
> 
> Have you had a look at the example build files in the sample/build
> directory of the cactus distribution. They may help you.
> 
> Are you sure the testURL is valid (can you manually start JRun and use
a
> browser to connect to http://localhost/myapp ?
> 
> Can you send us your build.xml file and the ant console output ?
> 
> Thanks
> -Vincent
> 
> P.S.: testTarget="tests" but the target you define below is "test"
> 
> > -----Original Message-----
> > From: Zhang, Li [mailto:Li.Zhang@eal.ab.ca]
> > Sent: 30 January 2002 17:46
> > To: 'Cactus Users List'
> > Subject: Cannot use "runservertest" in an Ant build.xml to start
JRun
> 3.1
> >
> > Have anyone experienced problem to start the application server with
> > "runservertests" cactus ant task?
> >
> > I first define the task useing "taskdef" and map "runservertests" to
> > org.apache.cactus.ant.RunServerTestsTask; then I define a task which
> calls
> > the "runservertests" as follows:
> >
> > <target name="tests_jrun">
> >   <runservertests testURL="http://localhost/myapp"
> > startTarget="start_jrun"
> > stopTarget="stop_jrun" testTarget="tests"/>
> > </target>
> >
> > <target name="start_jrun">
> >  ...
> > </target>
> > <target name="stop_jrun">
> >  ...
> > </target>
> > <target name="test">
> >  ...
> > </target>
> >
> > It looks like Ant ignores the "startTarget" attribute of the cactus
> ant
> > customized task because jRun is never started. If I remove
> > "startTarget="start_jrun" then Ant does invoke the "stop_jrun"
target.
> But
> > if I run "ant start_jrun", this time jRun will start as expected
> (which
> > means there's no problem with my "start_jrun" target).
> >
> > Any ideas?
> >
> > I'm using Ant 1.4 + cactus 1.2 + JRun 3.1 on Windows 2000.
> >
> > BTW: If I use "parallel","sequential","junit","java" tasks in the
> > "tests_jrun" target, I have no problem to start JRun, run tests, and
> stop
> > JRun.
> >
> > Thanks.
> >
> > Li
> >
> > --
> > 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