bodewig     2005/03/24 00:35:49

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java JUnitTestRunner.java
  Log:
  Don't ignore the extension attribute for formatters when forking
  multiple JUnit tests in a single VM.
  
  PR: 32973
  
  Revision  Changes    Path
  1.792     +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.791
  retrieving revision 1.792
  diff -u -r1.791 -r1.792
  --- WHATSNEW  23 Mar 2005 15:06:48 -0000      1.791
  +++ WHATSNEW  24 Mar 2005 08:35:49 -0000      1.792
  @@ -450,6 +450,9 @@
   * <xslt> failed to process file-hierarchies of more than one level if
     scanincludeddirectories was true.  Bugzilla Report 24866.
   
  +* forkmode="perBatch" or "once" would ignore extension attributes that
  +  had been specified for <formatter>s.  Bugzilla Report 32973.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===================================
   
  
  
  
  1.115     +5 -1      
ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- JUnitTask.java    9 Mar 2005 00:20:42 -0000       1.114
  +++ JUnitTask.java    24 Mar 2005 08:35:49 -0000      1.115
  @@ -1183,7 +1183,11 @@
        */
       protected File getOutput(FormatterElement fe, JUnitTest test) {
           if (fe.getUseFile()) {
  -            String filename = test.getOutfile() + fe.getExtension();
  +            String base = test.getOutfile();
  +            if (base == null) {
  +                base = JUnitTestRunner.IGNORED_FILE_NAME;
  +            }
  +            String filename = base + fe.getExtension();
               File destFile = new File(test.getTodir(), filename);
               String absFilename = destFile.getAbsolutePath();
               return getProject().resolveFile(absFilename);
  
  
  
  1.56      +16 -0     
ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  
  Index: JUnitTestRunner.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- JUnitTestRunner.java      17 Mar 2005 08:10:49 -0000      1.55
  +++ JUnitTestRunner.java      24 Mar 2005 08:35:49 -0000      1.56
  @@ -80,6 +80,15 @@
       public static final int ERRORS = 2;
   
       /**
  +     * Used in formatter arguments as a placeholder for the basename
  +     * of the output file (which gets replaced by a test specific
  +     * output file name later).
  +     *
  +     * @since Ant 1.6.3
  +     */
  +    public static final String IGNORED_FILE_NAME = "IGNORETHIS";
  +
  +    /**
        * Holds the registered formatters.
        */
       private Vector formatters = new Vector();
  @@ -599,6 +608,13 @@
               fe.setUseFile(true);
               if (!multipleTests) {
                   fe.setOutfile(new File(line.substring(pos + 1)));
  +            } else {
  +                int fName = line.indexOf(IGNORED_FILE_NAME);
  +                if (fName > -1) {
  +                    fe.setExtension(line
  +                                    .substring(fName
  +                                               + 
IGNORED_FILE_NAME.length()));
  +                }
               }
           }
           fromCmdLine.addElement(fe);
  
  
  

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

Reply via email to