ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Berry <christopher.be...@etrade.com>
Subject log4j + JUnit + Ant 1.4
Date Thu, 15 Nov 2001 21:58:35 GMT
Greetings,
I am trying to get the junit task to run properly with log4j. Has anyone
else been successful with this??
If I print to System.out in my JUnit Tests, the output is properly created.
But when I use log4j to a ConsoleAppender, it is not.
I am using the following Target definition::
 
  <target name="run_junit" description="Run Single JUnit test" if="testcase"
depends="quick" >
    <junit printsummary="withOutAndErr" haltonfailure="yes" fork="true" >
      <classpath>
        <pathelement location="${efc.pkgs.unpacked}" />   
        <fileset dir="${efc.pkgs.lib}">
          <include name="**/*.jar" />
        </fileset>
        <pathelement location="${efc.pkgs.unpacked.classes}" />
      </classpath>
      <formatter type="plain" usefile="true" />
      <test name="${testcase}" />
    </junit>
  </target>

NOTE: In order to see my output in the JUnit Formatters, I ended up having
to add the following lines to  JUnitTestRunner::run().          
            System.setOut( systemOut );
            System.setErr( systemError );
Without these lines I never saw *any* output at all????
 
Thanks,
-- Chris

Chris Berry  --- christopher.berry@etrade.com  -- 512-323-9479 

 

Mime
View raw message