Awesome !!! I love the green bar

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


Hi,

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:
 http://junit.sourceforge.net/doc/testinfected/IMG00001.GIF

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)

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

Modified files:

o JUnitTask.java
 - 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
 o JUnitTestRunner.java
 - an "extract method" refactor so that logic can be re-used
 - fix illegal javadoc
 o BaseTest.java
o JUnitTest.java
o BatchTest.java
 - move shouldRun() from JUnitTest to superclass BaseTest
 - added abstract method getTestNames() to BaseTest and
   implemented in subclasses

Added File:

o BatchSuite.java
 - 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)

--START DOCS--

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 
instead.

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.

<uiarg>

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"/>
  ...
</junit>

--END DOCS--


Thanks,

=Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to