ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20791] New: - [PATCH] add support to <junit> for popping up the JUnit GUI
Date Sun, 15 Jun 2003 23:17:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20791>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20791

[PATCH] add support to <junit> for popping up the JUnit GUI

           Summary: [PATCH] add support to <junit> for popping up the JUnit
                    GUI
           Product: Ant
           Version: unspecified
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: spud@madbean.com


(this was posted to dev@ant.apache.org, just creating a bugzilla entry for 
tracking)

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.zip) 

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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message