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 7791227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:49:17+00:00 2026-06-01T21:49:17+00:00

The problem: Tests are (seemingly) not executed Step 1: Compile source to bin <target

  • 0

The problem: Tests are (seemingly) not executed

Step 1: Compile source to bin

<target name="compile" depends="init" description="compile the source ">
    <javac srcdir="${src}" destdir="${build}" includeantruntime="true" nowarn="yes" debug="true" />
    <javac srcdir="${src}" destdir="${bin}" includeantruntime="true" nowarn="yes" debug="true" />
</target>

Step 2: Compile tests to bin

<target name="compileTest" depends="compile" description="compile jUnit Test cases ">
    <javac srcdir="${test-dir}" destdir="${bin}" includeantruntime="true" nowarn="yes" debug="true" />
</target>

Step 3: Find Test.class(es) and run them

<target name="test" depends="compileTest">
        <junit>
            <formatter type="plain" usefile="false" />
            <formatter type="plain" />
            <batchtest>
                <fileset dir="${bin}" includes="**/Test*.class" />
            </batchtest>
        </junit>
    </target>

Output:

Buildfile: /Users/xx/Documents/repositories/app/build.xml
clean:
   [delete] Deleting directory /Users/xx/Documents/repositories/app/build
   [delete] Deleting directory /Users/xx/Documents/repositories/app/bin
init:
    [mkdir] Created dir: /Users/xx/Documents/repositories/app/build
    [mkdir] Created dir: /Users/xx/Documents/repositories/app/bin
compile:
    [javac] Compiling 145 source files to /Users/xx/Documents/repositories/app/build
    [javac] Compiling 145 source files to /Users/xx/Documents/repositories/app/bin
compileTest:
    [javac] Compiling 24 source files to /Users/xx/Documents/repositories/app/bin
test:
dist:
   [delete] Deleting: /Users/xx/Documents/repositories/app/dist/app.jar
      [jar] Building jar: /Users/xx/Documents/repositories/app/dist/app.jar
     [copy] Copying 1 file to /Users/xx/Documents/repositories/app/dist
   [delete] Deleting: /Users/xx/Documents/repositories/app/dist/app.war
      [war] Building war: /Users/xx/Documents/repositories/app/dist/app.war
     [copy] Copying 1 file to /Users/xx/Documents/repositories/app/dist
BUILD SUCCESSFUL
Total time: 5 seconds

What am i missing please?

  • 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-06-01T21:49:18+00:00Added an answer on June 1, 2026 at 9:49 pm

    I believe you can use batchtest inside junit task:

    <target name="test" depends="compileTest">
      <junit>
        <classpath>
          <pathelement location="bin" />    
          <pathelement location="lib/junit-4.10.jar"/>
        </classpath>    
        <batchtest>
           <fileset dir="${test}">
                <include name="**/*Test*" />
           </fileset>
        </batchtest>
        <formatter type="brief" usefile="false"/>
      </junit>
    </target>   
    

    Note the following:

    • In fileset dir="${test}" should point to the source directory for the tests.
    • In include name="**/*Test*" you should not specify .class extension; it should be .java or nothing.
    • You need to add the test output directory as a “classpath” for junit task element.

    I had a test with a simple project and with the same configuration I got the brief results. I used Apache Ant 1.7.1.

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

Sidebar

Related Questions

Problem: When I run my tests, I get the following message in the command
The problem I'm using fitnesse for running some automated tests. There is a class
I have problem organizing my unittest based class test for family of tests. For
I'm now making unit-tests for already existing code. I faced the next problem: After
It's a well known problem that executing make test doesn't build the tests as
We use hypersonic in memory database for our DAO junit tests. The problem is
guys. I have a strange problem. I try to write unit-tests to web-app. I
i'm trying to solve a seemingly simple problem, but just can't quite get my
I am having a truly bizarre problem with my code here. It works (seemingly)
I've stumbled over a seemingly simple problem while building two libraries and test programs

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.