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:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]]
> 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-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>
> 




--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Attachment: bad-build.xml
Description: Binary data

Buildfile: build.xml

init:
     [echo] --------- Unit Tests 1.2 ---------
     [echo] 
     [echo] java.class.path = c:\jdk1.3.1\lib\tools.jar;C:\Program Files\Apache 
Group\Ant\lib\junit.jar;C:\Program Files\Apache Group\Ant\lib\jaxp.jar;C:\Program 
Files\Apache Group\Ant\lib\jakarta-ant-1.4.1-optional.jar;C:\Program Files\Apache 
Group\Ant\lib\crimson.jar;C:\Program Files\Apache Group\Ant\lib\ant.jar;C:\Program 
Files\Apache Group\soap\lib\soap.jar;C:\Program Files\Apache 
Group\soap\lib\xerces.jar;C:\Program 
Files\Allaire\JRun\lib\ext\activation.jar;C:\Program 
Files\Allaire\JRun\lib\ext\mail.jar;C:\Program Files\Apache Group\soap;C:\Program 
Files\Apache Group\jmeter\bin\ApacheJMeter.jar;C:\Program Files\Apache 
Group\jmeter\lib\xerces.jar
     [echo] 
     [echo] java.home = c:\jdk1.3.1\jre
     [echo] user.home = C:\Documents and Settings\lzhang
     [echo] 
     [echo] basedir = H:\Projects\Asp
     [echo] 
     [echo] cactus.jar = C:/Program Files/Apache Group/Cactus/lib/cactus.jar
     [echo] cactus.ant.jar = C:/Program Files/Apache Group/Cactus/lib/cactus-ant.jar
     [echo] servlet.jar = C:/Program Files/Apache Group/Tomcat/common/lib/servlet.jar
     [echo] junit.jar = C:/Program Files/Apache Group/Cactus/lib/junit.jar
     [echo] httpclient.jar = C:/Program Files/Apache Group/Cactus/lib/httpclient.jar
     [echo] jrun.home = C:/Program Files/Allaire/JRun
     [echo] cactus.properties.home = h:/Projects/Asp
     [echo] asp.class.path = h:/Projects/Asp/classes

tests:

aspinit:
     [echo] Waiting for the servlet engine to preload the AspInit servlet

asptests:
    [junit] Running com.eal.asp.test.TestAll
    [junit] log4j:ERROR No appenders could be found for category 
(com.eal.asp.test.ejb.UnitAgentTest).
    [junit] log4j:ERROR Please initialize the log4j system properly.
    [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 36.583 sec
    [junit] Testsuite: com.eal.asp.test.TestAll
    [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 36.583 sec
    [junit] 
    [junit] Testcase: testUnitAgent took 18.557 sec
    [junit]     Caused an ERROR
    [junit] Caught EOFException while reading the stream header
    [junit] java.io.StreamCorruptedException: Caught EOFException while reading the 
stream header
    [junit]     at 
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:845)
    [junit]     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:168)
    [junit]     at 
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java:148)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.java:422)
    [junit]     at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:130)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:371)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:231)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:409)
    [junit] 
    [junit] Testcase: testForceMajeureAgent took 18.016 sec
    [junit]     Caused an ERROR
    [junit] Caught EOFException while reading the stream header
    [junit] java.io.StreamCorruptedException: Caught EOFException while reading the 
stream header
    [junit]     at 
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:845)
    [junit]     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:168)
    [junit]     at 
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java:148)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.java:422)
    [junit]     at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:130)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:371)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:231)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:409)
    [junit] 

BUILD SUCCESSFUL

Total time: 1 minute 11 seconds

Attachment: good-build.xml
Description: Binary data

Buildfile: build.xml

init:
     [echo] --------- ASP.jpr 1.2 ---------
     [echo] 
     [echo] java.class.path = c:\jdk1.3.1\lib\tools.jar;C:\Program Files\Apache 
Group\Ant\lib\junit.jar;C:\Program Files\Apache Group\Ant\lib\jaxp.jar;C:\Program 
Files\Apache Group\Ant\lib\jakarta-ant-1.4.1-optional.jar;C:\Program Files\Apache 
Group\Ant\lib\crimson.jar;C:\Program Files\Apache Group\Ant\lib\ant.jar;C:\Program 
Files\Apache Group\soap\lib\soap.jar;C:\Program Files\Apache 
Group\soap\lib\xerces.jar;C:\Program 
Files\Allaire\JRun\lib\ext\activation.jar;C:\Program 
Files\Allaire\JRun\lib\ext\mail.jar;C:\Program Files\Apache Group\soap;C:\Program 
Files\Apache Group\jmeter\bin\ApacheJMeter.jar;C:\Program Files\Apache 
Group\jmeter\lib\xerces.jar
     [echo] 
     [echo] java.home = c:\jdk1.3.1\jre
     [echo] user.home = C:\Documents and Settings\lzhang
     [echo] 
     [echo] basedir = H:\Projects\Asp
     [echo] 
     [echo] cactus.jar = C:/Program Files/Apache Group/Cactus/lib/cactus.jar
     [echo] cactus.ant.jar = C:/Program Files/Apache Group/Cactus/lib/cactus-ant.jar
     [echo] servlet.jar = C:/Program Files/Apache Group/Tomcat/common/lib/servlet.jar
     [echo] junit.jar = C:/Program Files/Apache Group/Cactus/lib/junit.jar
     [echo] httpclient.jar = C:/Program Files/Apache Group/Cactus/lib/httpclient.jar
     [echo] jrun.home = C:/Program Files/Allaire/JRun
     [echo] cactus.properties.home = h:/Projects/Asp
     [echo] asp.class.path = h:/Projects/Asp/classes

tests:
     [java] Operating System: Windows 2000 Version 5.0
     [java] Java Virtual Machine: mixed mode from Sun Microsystems Inc.
     [java] JRun 3.1 3.1.26414 Starting default...
     [java] Current Locale: en_US
     [java] Loading scheduler
     [java] Loading logging
    [junit] Running com.eal.asp.test.TestAll
    [junit] log4j:ERROR No appenders could be found for category 
(com.eal.asp.test.ejb.UnitAgentTest).
    [junit] log4j:ERROR Please initialize the log4j system properly.
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 3.315 sec
    [junit] Testsuite: com.eal.asp.test.TestAll
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 3.315 sec
    [junit] 
    [junit] Testcase: testUnitAgent took 1.903 sec
    [junit] Testcase: testForceMajeureAgent took 1.412 sec
     [java] Forcing shutdown.

BUILD SUCCESSFUL

Total time: 47 seconds

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to