jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Collison <kcolli...@spamcop.net>
Subject Problem using runservertests & failureproperty
Date Fri, 01 Jul 2005 20:29:44 GMT
Hello,

In my current environment, I manually create a "cactified" war file and 
use runservertests to execute the tests.  Everything happens as 
expected, with one important hitch -- my "failureproperty" is not 
getting set as expected.

Here are my two relevant targets:

<target name="run.server.tests" depends="init">
       <runservertests
           testurl="${cactus.test.url}"
           starttarget="start.tomcat"
           stoptarget="stop.cactus"
           testtarget="test.server"
               />
       <echo message="within run.server.tests, test 
failed=[${test.failed}]"/>
   </target>
<target name="test.server"
    description="Runs junit on test cases.">
    <delete dir="${test.result.dir}"/>
    <mkdir dir="${test.result.dir}"/>
    <property name="test" value="Test*"/>
    <junit printsummary="true"
           haltonerror="false"
               haltonfailure="false"
           failureproperty="test.failed"
       >
       <classpath>
         <path refid="cactus.classpath"/>
         <pathelement location="${cactus.classes.dir}"/>
       </classpath>

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

       <batchtest todir="${test.result.dir}" >
         <fileset dir="${test.web.dir}">
               <include name="**/${test}.java"/>
               <exclude name="**/Base*.java"/>
               <exclude name="**Abstract**"/>
         </fileset>
       </batchtest>
    </junit>
       <echo message="test failed:[${test.failed}]"/>
   </target>

Note the echo tasks I have.  When I run the tests and there are test 
failures, my output is:

[echo] within test.server target, test failed=[true]
[echo] within run.server.tests, test failed=[${test.failed}]

Obviously the failure property is not being permanently set by the 
test.server target  Am I misunderstanding how this is supposed to work?  
Are there other ways of accomplishing the same goal (without use of the 
<cactus> task)?

Thank you in advance.

Keith



Mime
View raw message