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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:41:48+00:00 2026-06-16T00:41:48+00:00

Using an ANT script to run JUnit tests, one group of tests (TestSCF) is

  • 0

Using an ANT script to run JUnit tests, one group of tests (TestSCF) is a subset of all tests. These tests are to be run as part of a nightly build and produce a report. Using @IncludeCategory to define the tests that need to be run, and ClasspathSuite to locate all tests in the project.

An example test class declaration, defined to be run as the TestSCF subset. TestSCF is an empty interface.

@Category(TestSCF.class)
public class ErrorDialogTest extends TestCase
{
    ....
}

The main test suite.

@RunWith(Categories.class)
@IncludeCategory(TestSCF.class)
@SuiteClasses({AllTests.class})
public class SCFTests
{
}

The AllTests declaration

@RunWith(ClasspathSuite.class)
public class AllTests
{
}

The relevant parts of the ANT script

<!-- Run the unit tests -->
<junit showoutput   ="true"
       printsummary = "yes"
       fork         = "yes"
       timeout      = "60000" >
  <formatter type="xml"/>
  <classpath refid="cpath"/>

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

<!-- Copy the XML files that get deleted by junitreport -->
<mkdir dir="${junit.html.dir}/xml_files"/>
<copy todir="${junit.html.dir}/xml_files" preservelastmodified="true">
  <fileset dir="${test.report.dir}">
      <include name="*.xml"/>
  </fileset>
</copy>

<!-- Format the test results into browsable HTML -->
<junitreport todir="${junit.html.dir}">
  <fileset dir="${test.report.dir}">
    <include name="TEST-*.xml"/>
  </fileset>
  <report format="frames" todir="${junit.html.dir}"/>
</junitreport>

The problem is that the Junit report shows only one class tested – SCFTests. I understand why this is happening, but would like to know if there is a way to produce a report for each class actually tested, or a way to get the name of the class tested added to the ‘name’ of the test results in the report.

For example:

dev.sca.test.ErrorDialogTest 45 Passed, 3 Failures, 0 Errors

as opposed to

SCFTests 45 Passed, 3 Failures, 0 Errors
  • 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-16T00:41:49+00:00Added an answer on June 16, 2026 at 12:41 am

    For future reference, I was able to get the classpath printed in the ‘Name’ column of the report by modifying the junit-frames.xsl file as below.

    Under

    <td>
      <a name="{@name}"/>
      <xsl:choose>
        <xsl:when test="boolean($show.class)">
          <a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="@name"/>
        </xsl:otherwise>
      </xsl:choose>
    </td>
    

    Becomes

    <td>
      <a name="{@name}"/>
      <xsl:choose>
        <xsl:when test="boolean($show.class)">
          <a href="{concat($class.href, '#', @classname)}"><xsl:value-of select="@classname"/></a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="@classname"/>
        </xsl:otherwise>
      </xsl:choose>
    </td>
    

    Results in:

    Name                         Status Type    Time(s)
    dev.sca.test.ErrorDialogTest Success        1.45
    dev.sca.test.SomeOtherTest   Success        2.03
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using an Ant build script to collate my Eclipse-based application for distribution. One
I have switched to JUnit4.4 from JUnit3.8. I run my tests using ant, all
I have a Java project that I build using an Ant script. I am
I'm using Jenkins with Ant plug-in to run PHPUnit/Selenium tests. I'm trying to set
I am using acceleoCompiler inside an ant script and when i run the ant
I have checked out code using command-line SVN. I have an Ant build script
I am using ant script and running a junit, the problem I am facing
I have an ant script that does a headless build using the following ant
I am having trouble getting my Ant script (for BlackBerry build) to run the
We currently run a specific SQL script as part of our Ant deploy process.

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.