ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTestRunner.java PlainJUnitResultFormatter.java SummaryJUnitResultFormatter.java XMLJUnitResultFormatter.java
Date Mon, 29 Jan 2001 16:04:38 GMT
bodewig     01/01/29 08:04:38

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTestRunner.java PlainJUnitResultFormatter.java
                        SummaryJUnitResultFormatter.java
                        XMLJUnitResultFormatter.java
  Log:
  Make <junit> work with JUnit 3.5 as well.
  
  Revision  Changes    Path
  1.5       +10 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  
  Index: JUnitTestRunner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JUnitTestRunner.java	2001/01/03 14:18:44	1.4
  +++ JUnitTestRunner.java	2001/01/29 16:04:36	1.5
  @@ -237,7 +237,7 @@
       public void endTest(Test test) {}
   
       /**
  -     * Interface TestListener.
  +     * Interface TestListener for JUnit &lt;= 3.4.
        *
        * <p>A Test failed.
        */
  @@ -245,6 +245,15 @@
           if (haltOnFailure) {
               res.stop();
           }
  +    }
  +
  +    /**
  +     * Interface TestListener for JUnit &gt; 3.4.
  +     *
  +     * <p>A Test failed.
  +     */
  +    public void addFailure(Test test, AssertionFailedError t) {
  +        addFailure(test, (Throwable) t);
       }
   
       /**
  
  
  
  1.4       +12 -2     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java
  
  Index: PlainJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PlainJUnitResultFormatter.java	2001/01/03 14:18:44	1.3
  +++ PlainJUnitResultFormatter.java	2001/01/29 16:04:37	1.4
  @@ -59,13 +59,14 @@
   import java.io.*;
   import java.text.NumberFormat;
   
  +import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import junit.framework.TestCase;
   
   /**
    * Prints plain text output of the test to a specified Writer.
    *
  - * @author <a href="mailto:stefan.bodewig@megabit.net">Stefan Bodewig</a>
  + * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    */
   
   public class PlainJUnitResultFormatter implements JUnitResultFormatter {
  @@ -172,12 +173,21 @@
       }
   
       /**
  -     * Interface TestListener.
  +     * Interface TestListener for JUnit &lt;= 3.4.
        *
        * <p>A Test failed.
        */
       public void addFailure(Test test, Throwable t) {
           formatError("\tFAILED", test, t);
  +    }
  +
  +    /**
  +     * Interface TestListener for JUnit &gt; 3.4.
  +     *
  +     * <p>A Test failed.
  +     */
  +    public void addFailure(Test test, AssertionFailedError t) {
  +        addFailure(test, (Throwable) t);
       }
   
       /**
  
  
  
  1.5       +10 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java
  
  Index: SummaryJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SummaryJUnitResultFormatter.java	2001/01/03 14:18:44	1.4
  +++ SummaryJUnitResultFormatter.java	2001/01/29 16:04:37	1.5
  @@ -57,6 +57,7 @@
   import java.text.NumberFormat;
   import java.io.IOException;
   import java.io.OutputStream;
  +import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   
   import org.apache.tools.ant.BuildException;
  @@ -64,7 +65,7 @@
   /**
    * Prints short summary output of the test to Ant's logging system.
    *
  - * @author <a href="mailto:stefan.bodewig@megabit.net">Stefan Bodewig</a>
  + * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    */
    
   public class SummaryJUnitResultFormatter implements JUnitResultFormatter {
  @@ -98,6 +99,14 @@
        * Empty
        */
       public void addFailure(Test test, Throwable t) {}
  +    /**
  +     * Interface TestListener for JUnit &gt; 3.4.
  +     *
  +     * <p>A Test failed.
  +     */
  +    public void addFailure(Test test, AssertionFailedError t) {
  +        addFailure(test, (Throwable) t);
  +    }
       /**
        * Empty
        */
  
  
  
  1.5       +11 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
  
  Index: XMLJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLJUnitResultFormatter.java	2000/12/07 14:52:01	1.4
  +++ XMLJUnitResultFormatter.java	2001/01/29 16:04:37	1.5
  @@ -64,6 +64,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.util.DOMElementWriter;
   
  +import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import junit.framework.TestCase;
   
  @@ -178,12 +179,21 @@
       }
   
       /**
  -     * Interface TestListener.
  +     * Interface TestListener for JUnit &lt;= 3.4.
        *
        * <p>A Test failed.
        */
       public void addFailure(Test test, Throwable t) {
           formatError("failure", test, t);
  +    }
  +
  +    /**
  +     * Interface TestListener for JUnit &gt; 3.4.
  +     *
  +     * <p>A Test failed.
  +     */
  +    public void addFailure(Test test, AssertionFailedError t) {
  +        addFailure(test, (Throwable) t);
       }
   
       /**
  
  
  

Mime
View raw message