Junit HTML report generated from Teamcity does not show System.out statements

765 views Asked by At

I am using Junit 4.10 with ANT 1.8.3 and Teamcity 7.0.2. I have set printsummary=withOutAndErr in my build.xml

When I run the build manually from ANT, the generated JUnit HTML report shows System.out statements, however; When I run the same build from Teamcity the System-out statements do not show up. What am I doing wrong?

Build.xml to reproduce the scenario:

Sample JUnit Tests

<property name="project_name" value="junitSamples"/>
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="dist"  location="dist"/>
<property name="lib"  location="lib"/>
<property name="res"  location="res"/>
<property name="reports" location="reports"/>

<!-- the names of various distributable files -->
<property name="jar_name" value="${project_name}.jar"/>
<property name="war_name" value="${project_name}.war"/>

<!-- top level targets -->

<target name="compile" depends="init" description="compile the source code " >
    <javac srcdir="${src}" destdir="${build}">
        <classpath>
            <fileset dir="lib">
                <include name="**/*.jar"/>
            </fileset>
        </classpath>
    </javac>
</target>

<target name="dist" depends="compile" description="generate the distributable files " >
    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/${jar_name}" basedir="${build}"/>
</target>

<target name="clean" description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
    <delete dir="${reports}"/>
</target>

<target name="run-tests" depends="compile" description="run your test suite" >
    <junit printsummary="true" haltonfailure="no" showoutput="yes" >
        <classpath>
            <pathelement path="${build}"/>
            <fileset dir="lib">
                <include name="**/*.jar"/>
            </fileset>
        </classpath>
      <batchtest fork="yes" todir="${reports}/raw/">
        <formatter type="xml"/>
        <fileset dir="${src}">
          <include name="**/*Test*.java"/>
        </fileset>
      </batchtest>
    </junit>
</target>

<target name ="test" depends="run-tests">
    <junitreport todir="${reports}">
      <fileset dir="${reports}/raw/">
        <include name="TEST-*.xml"/>
      </fileset>
      <report format="frames" todir="${reports}\html\"/>
    </junitreport>
</target>

<target name ="run" depends="" description="if this project can be run, run it" >
</target>

<!-- supporting targets -->

<target name="init" description="initialize the build environment" >
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create directory structures -->
        <delete dir="${build}"/>        
        <delete dir="${dist}"/> 
        <delete dir="${reports}"/>  
        <mkdir dir="${build}"/>
    <mkdir dir="${dist}/lib"/>
    <mkdir dir="${reports}"/>
    <mkdir dir="${reports}/raw/"/>
    <mkdir dir="${reports}/html/"/>
</target>

<target name="all" depends="clean, test">
</target>

0

There are 0 answers