ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dharnidhar Vemuri <>
Subject RE: [PATCH] add support to <junit> for popping up the JUnit GUI
Date Wed, 18 Jun 2003 12:57:41 GMT

It would be good if this patch has the printsummary also enabled as most of
us trap the results in a file and parse the results file for further
processing. I have placed a sample target which is being used in one of the
projects that we are doing.

<target name="ExecuteSuite" depends="CompileSuiteClass">
  <xmlproperty file="${xmlfile}" collapseAttributes="true"/>
  <junit printsummary="yes" fork="true">
      <pathelement path="${classpath}"/>
      <pathelement path="${cls.dir}"/>
      <pathelement path="${suite.dir}"/>
    <test name="suite.${suite.filename}" outfile="TEST-${suite.filename}"
       <formatter type="xml" extension=".xml"/>

As u said, fork is by default in your patch, but as u see we store the
output in a file.


-----Original Message-----
From: Dharnidhar Vemuri []
Sent: Wednesday, June 18, 2003 6:13 PM
To: 'Ant Developers List'
Subject: RE: [PATCH] add support to <junit> for popping up the JUnit GUI

	Where is the patch? I have downloaded the latest nightly build
today. I did not find this. Can you please help me in locating this file.


-----Original Message-----
From: Gollapally, Devender []
Sent: Tuesday, June 17, 2003 7:21 PM
To: Ant Developers List
Subject: RE: [PATCH] add support to <junit> for popping up the JUnit GUI

Awesome !!! I love the green bar

-----Original Message-----
From: Matt Quail []
Sent: Saturday, June 14, 2003 6:30 AM
Subject: [PATCH] add support to <junit> for popping up the JUnit GUI


This is a patch for the <junit> task, that adds an option to use the 
traditional JUnit GUI instead of Ant's built-in text/xml/html/etc. 
formatters. You know, this kind of thing:

This is a scratch I've always wanted to itch. The text/html/etc. <junit> 
output formats are great in continuous-integration situations, but when 
doing a code/compile/test cycle, I think the "immediate" feedback of the 
GUI is preferable. You have to love the green-bar :D

This patch adds a uimode="true" attribute to <junit> (see the preliminary 
doco below).

I have tested this patch with JDK1.2.2 on Win2k, with JUnit 3.8.1 and 3.0

Patch Contents
(see attached patch.txt and patch.tar.gz, created using patch.xml)

- I've used "@since Ant 1.6FIXME", not sure what the correct value
  should be

Modified files:

 - added UI mode functionality
 - "extract method" refactor in executeAsForked() creating
   executeAsForkedCommon(), so that the setup performed on
   "cmd" could be reused
 - Removed some deprecated warnings by using appropriate JDK1.2 methods
   (this is okay now, right?)
 - misc whitespace cleaning
 - an "extract method" refactor so that logic can be re-used
 - fix illegal javadoc
 - move shouldRun() from JUnitTest to superclass BaseTest
 - added abstract method getTestNames() to BaseTest and
   implemented in subclasses

Added File:

 - A JUnit test that initializes its suite from a file
  Preliminary Doco
(if the patch is accepted I'll submit a follow-up patch to junit.html)


Note: UI Mode

When UI mode is activated (using the "uimode" attribute), any associated 
<formatter> tags are ignored, and one of JUnit's own GUI viewers is used 

When in UI mode, the following options are ignored: printsummary, fork, 
halton*, errorproperty, failureproperty, filtertrace, timeout, showoutput, 
todir, and outfile.

All tests will be run in forked mode, irrespective of the value of "fork". 
If more than one test is run at once (eg, as in a <batchtest> or multiple 
<test>s) then "includeAntRuntime" will be force to be "true".

The <uiarg> nested element can be used when UI mode is active (otherwise it 
is ignored by <junit>).

uimode        When set, UI mode is activated as described
              above. Valid values include "swing", "awt" or
              the fully-qualified classname of a JUnit "runner".
              When "true", "yes" or "on", then "swing" is used.
              (In versions of JUnit that don't have the "swing"
              viewer, then "swing" and "awt" mean the same thing)
              If "false" or not set (the default), then
              UI mode is not active.


Adds arguments to the of the JUnit's commandline. <uiarg> allows all 
attributes described in Command-line Arguments.

This is useful, for example, to pass "-noloading" to JUnit:

<junit uimode="yes">
  <uiarg value="-noloading"/>




To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message