ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject how to make effective use of AntUnit <au:logcontent>
Date Wed, 27 Dec 2006 10:37:47 GMT
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"/>
            <property name="wdir" location="${testdir}/@{testcaseName}"/>
            <mkdir dir="${wdir}"/>
            <get src="http://somehost/{param0}" dest=
            <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">
    <target name="testOne">
        <testingMacro testcaseName="testOne" param0="foo"/>
    <target name="testTwo">
        <testingMacro testcaseName="testTwo" param0="bar"/>

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 ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message