Czar
Czar

Reputation: 366

Problem with ANT output, java logging and SPRING tutorial

I am currently following this tutorial to learn SPRING: http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html

It all works, but the Ant output always displays "STANDARD ERROR" with normal logging content which I assume is wrong.

$ ant tests
Buildfile: build.xml

build:

buildtests:

    [javac] Compiling 1 source file to /Users/Shared/Projects/springapp/war/WEB-INF/classes

tests:

    [junit] Running springapp.web.HelloWorldControllerTests
    [junit] Oct 30, 2007 11:31:43 PM springapp.web.HelloController handleRequest
    [junit] INFO: Returning hello view
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.03 sec
    [junit] Testsuite: springapp.web.HelloWorldControllerTests
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.03 sec
    [junit] ------------- Standard Error -----------------
    [junit] Oct 30, 2007 11:31:43 PM springapp.web.HelloController handleRequest
    [junit] INFO: Returning hello view
    [junit] ------------- ---------------- ---------------

BUILD SUCCESSFUL
Total time: 2 seconds

How can I change this behaviour? Logging output is not an error, or is it for Ant? Thanks for any ideas and clarification!

Upvotes: 2

Views: 603

Answers (1)

martin clayton
martin clayton

Reputation: 78175

Peeking at the linked tutorial, the 'junit' task looks like the below.

Change it to showoutput="false" to hide the test output. I guess the tutorial switched it on so you could see what was happening, but usually its implicitly 'false' - the default if you omit the 'showoutput' attribute.

<junit printsummary="on"
    fork="false"
    haltonfailure="false"
    failureproperty="tests.failed"
    showoutput="true">
    <classpath refid="master-classpath"/>
    <formatter type="brief" usefile="false"/>

    <batchtest>
        <fileset dir="${build.dir}">
            <include name="**/*Tests.*"/>
        </fileset>
    </batchtest>

</junit>

Upvotes: 2

Related Questions