Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:40:11+00:00 2026-05-30T23:40:11+00:00

I put up an Ant project which includes a unit test using JUnit. The

  • 0

I put up an Ant project which includes a unit test using JUnit.

The test target is as:

<target name="test">
    <mkdir dir="target/test/reports"/>
    <junit printsummary="yes" haltonfailure="yes">
        <classpath>
            <pathelement location="${test.classes.dir}"/>
            <pathelement location="${test.junit.jar}" />
            <pathelement path="${classes.dir}"/>
            <pathelement path="${java.class.path}"/>
        </classpath>
        <formatter type="plain"/>

        <batchtest fork="yes" todir="${test.reports.dir}">
            <fileset dir="${test.src.dir}">
                <include name="**/*Test*.java"/>
            </fileset>
        </batchtest>
    </junit>
</target>

When I run this test, it show on the screen only the summary of the test like:

Buildfile: F:\test\build.xml

test:
    [junit] Running com.mycompany.myproject.myTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.013 sec
    [junit] Running com.mycompany.myproject.myTest1
    [junit] Tests run: 3, Failures: 1, Errors: 0, Time elapsed: 0.018 sec

BUILD FAILED
F:\test\build.xml:30: Test com.mycompany.myproject.myTest1 failed

Total time: 1 second

Is there anyway I can tell JUnit or Ant to display the detailed result on the screen?

Also, if I want to write something in the Unit test to the screen, how can I do this? I tried to insert System.out.println() in the test but it does not display anything on the screen.

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:40:12+00:00Added an answer on May 30, 2026 at 11:40 pm

    Set the showOutput flag to true.

    What are you trying to accomplish via the S.o.p in the middle of a test?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application, which parses XML ant put data to CoreData. I want
I created a Maven project in Eclipse using the webapp artifact and put the
I have the following Ant build file: <?xml version=1.0 encoding=UTF-8?> <project default=build name=MyAntScript> <!--
My ant project generates an output folder which contains the outputs of multiple runs
My test code in Maven project B (which is a child of project A)
Put them all in one separate folder structure or along with classes which implements
We put all of our unit tests in their own projects. We find that
Simply put, is there a way to create a 2D javascript array using similar
What do you guys do, when you have huge project built with ant for
I'm using ant, ivy and nexus repo manager to build and store my artifacts.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.