You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ma...@quick.co.jp on 2006/12/27 11:37:47 UTC

how to make effective use of AntUnit

Hi, List.

I am trying the AntUnit 1.0Beta2 with Ant1.7.0RC1.

I want to know how to get access to the log messages emitted by tasks under
the test especially when they terminated with BuildException.

I made a test case build.xml which includes a fragment like the following:

    <macrodef name="testingMacro">
        <attribute name="testcaseName"/>
        <attribute name="param0"/>
        <sequential>
            <property name="wdir" location="${testdir}/@{testcaseName}"/>
            <mkdir dir="${wdir}"/>
            <get src="http://somehost/somepath.do?arg0=@{param0}" dest=
"${wdir}/source.xml"/>
            <au:assertFileExists file="${wdir}/source.xml"/>
            <xslt style="${transformHome}/myFaulty.xsl"
                in="${wdir}/source.xml" out="${wdir}/result.xml"/>
            <au:assertFileExists file="${wdir}/result.xml"/><!-- success?
-->
            <copy destdir="${wdir}" outputencoding="UTF-8">
                <au:logcontent/>
            </copy>
        </sequential>
    </macrodef>
    <target name="testOne">
        <testingMacro testcaseName="testOne" param0="foo"/>
    </target>
    <target name="testTwo">
        <testingMacro testcaseName="testTwo" param0="bar"/>
    </target>


I wanted the <copy> task invocation with <au:logcontent> child element to
redirect all of messages to the console. When the <xslt> task failed with
BuildException (due to silliness in the myFaulty.xsl), <copy> task
invocation is always skipped and therefore I can not read the
<au:logcontent>. Unfortunately the documentation on the <au:logcontent>
doesn't clarify how to make best use of it.

Would anyone show me how to utilize <au:logcontent> effectively ?


      MATSUHASHI,kazuaki




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