jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: using cactus and ant tasks
Date Wed, 02 Apr 2003 10:31:54 GMT
Hello Jason,

the cactus.contextURL property needs to be set on the client side. You 
didn't include the 'test' target in the build fragments you posted, so 
we can't really see what may be going wrong. However, a procedure that 
works fairly well is to just pass the property as <sysproperty> nested 
element to the <junit> task.

-chris

Jason Novotny wrote:
> 
> Hi,
> 
>    It seems downloading a nightly build fixed my problems with the 
> cactus.properties and the HTML generation from the junit XSL stylesheet. 
> It all works fine when I invoke the tests from my browser after manually 
> starting TYomcat 4.1.18. Now I want to automate it all with Ant and I 
> have the following:
> 
> 
>    <target name="test.tomcat" depends="deploy"
>        if="catalina.exists" description="Run tests on Tomcat">
> 
>        <!-- Start the servlet engine, wait for it to be started, run the
>        unit tests, stop the servlet engine, wait for it to be stopped.
>        The servlet engine is stopped if the tests fail for any reason -->
> 
>        <runservertests
>            
> testURL="http://127.0.0.1:8080/gridsphere/ServletRedirector?Cactus_Service=RUN_TEST"

> 
>            startTarget="start.tomcat"
>            stopTarget="stop.tomcat"
>            testTarget="test"/>
> 
>    </target>
> 
> 
>    <!--
>       
> ========================================================================
>         Start Tomcat 4.0
>       
> ========================================================================
>    -->
>    <target name="start.tomcat">
> 
>        <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
>            <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}"/>
>            <arg value="start"/>
>            <classpath>
>                <pathelement path="${java.home}/../lib/tools.jar"/>
>                <fileset dir="${env.CATALINA_HOME}">
>                    <include name="bin/bootstrap.jar"/>
>                </fileset>
>            </classpath>
>        </java>
> 
>    </target>
> 
>    <!--
>    ========================================================================
>    Stop Tomcat
>    ========================================================================
>    -->
>    <target name="stop.tomcat">
>        <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
>            <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}"/>
>            <arg value="stop"/>
>            <classpath>
>                <fileset dir="${env.CATALINA_HOME}">
>                    <include name="bin/bootstrap.jar"/>
>                </fileset>
>            </classpath>
>        </java>
>    </target>
> 
> But now after starting up I get this error:
> 
> test:
>    [junit] Running org.gridlab.gridsphere.GridSphereTest
> 
> 
> 
>    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.598 sec
>    [junit] Testsuite: org.gridlab.gridsphere.GridSphereTest
>    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.598 sec
> 
> 
>    [junit] Testcase: testPortletDescriptor took 0.551 sec
>    [junit]     Caused an ERROR
>    [junit] Missing Cactus property [cactus.contextURL]
>    [junit] org.apache.cactus.util.ChainedRuntimeException: Missing 
> Cactus property [cactus.contextURL]
>    [junit]     at 
> org.apache.cactus.configuration.BaseConfiguration.getContextURL(BaseConfiguration.java:208)

> 
>    [junit]     at 
> org.apache.cactus.configuration.AbstractWebConfiguration.getRedirectorURL$ajcPostAround6(AbstractWebConfiguration.java;org/apache/cactus/util/log/LogAspect.aj(1k):85)

> 
> 
> 
>    I also put cactus.properties in my WEB-INF/classes directory of my 
> webapp but that doesn't help I guess.
> 
>    Thanks very much, Jason



Mime
View raw message