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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:23:28+00:00 2026-05-16T23:23:28+00:00

The build.xml we have today have many targets to compile and run unit tests.

  • 0

The build.xml we have today have many targets to compile and run unit tests. The build.xml refers to many property files with relative to itself. All this works fine when build and test is done on same machine.

It is pretty simple to do build get all jars and any test input files to a build_home(another machine). How to run junit on the new location? Should I create small build.xml files to running the tests? (There is no way to create ant build.xml dynamically) Any solutions?

( GridGain is possible solution. Not tried yet. )

Edit: Mode details on why this more complicated: The source code is around 3G, doing clearcase update and build takes considerable time (40 minute) against real test time of junit testing – 60 minutes. We have many machines to run the tests — loading Clearcase on all systems not possible.

  • 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-16T23:23:29+00:00Added an answer on May 16, 2026 at 11:23 pm

    I understand your question as you want to only run the Junit tests on another machine without actually building on it? You can run something on the lines below as build scripts from Cruise control and probably Hudson too

    If you’re using the task via ant, then follow the same principles as a standard build. You can check out the code to all target machines from source control.

    Externalize all root directories to a build.properties. These are properties which have to be set on each machine like so.

    #Overall Project Name
    project.name=myapp
    
    # Top Level Root directory of the new working project
    toplevel.project.dir=D:/proj/eComm
    
    # Root directory of the source code
    root.project.dir=D:/proj/eComm/Construction
    
    # JDK home directory 
    jdk.home=C:/jdk1.5.0_11
    

    build.properties will also have some static properties defined relative to the above. These need not be changed by any user on any local machine.

    ear.dist.dir = ${root.project.dir}/target
    src.dir     = ${root.project.dir}/src
    test.src.dir = ${root.project.dir}/test
    

    Ensure your build.xml only refers to any further sub directories via these properties without any hardcoded values in it.

    My junit are in a separate file which is imported into the build.xml by

    <import file="${root.project.dir.buildscripts.dir}/junit.xml"/>
    

    and some part of junit.xml is shown below

    <target name="run.junit" depends="clean.junit, junit.info, prepare.junit"
        description="Compiles and runs all JUnit Tests in the 'test' directory and produces a report of all failures">
    
    <junit printsummary="yes" fork="true" haltonfailure="no" showoutput="yes" maxmemory="512m">
          <jvmarg line="${junit.jvm.arg}"/>
          <classpath>
            <fileset dir="${src.dir}">
              <include name="**/*.*"/>
            </fileset>
            <fileset dir="${ear.dist.dir}/build/classes">
              <include name="**/*.*"/>
            </fileset>
             <pathelement path="${test.run.path}"/>
          </classpath>
          <formatter type="xml"/>
          <batchtest fork="true" todir="${ear.dist.dir}/build/junit">
          <fileset dir="${test.src.dir}" includes="${test.pattern.include}"/>
          </batchtest>
        </junit>
    
    </target>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object that can build itself from an XML string, and write
I can't get my Junit tests to run from my build.xml script. I feel
When I build XML up from scratch with XmlDocument , the OuterXml property already
I'm using TinyXML to parse/build XML files. Now, according to the documentation this library
I have been using this exact Build.xml file. I had problems in the beginning
Let's say I have a file-system that looks a little something like this: C:\stuff\build.xml
I have a tree in flex built from an XML document into an XMLlist
The build.xml has a test and a build target. The test target obviously depends
I've got a ant build.xml that uses the <copy> task to copy a variety
I'm trying to call an Antlr task in my Ant build.xml as follows: <path

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.