You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@locus.apache.org on 2000/11/09 23:14:29 UTC

cvs commit: xml-xalan/test/java/src/org/apache/qetest Reporter.java

curcuru     00/11/09 14:14:29

  Modified:    test/java/src/org/apache/qetest Reporter.java
  Log:
  executeTests() should now report an ERRR instead of FAIL when testCase throws an exception
  Cleaned up logging of contained exceptions
  
  Revision  Changes    Path
  1.2       +13 -16    xml-xalan/test/java/src/org/apache/qetest/Reporter.java
  
  Index: Reporter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/Reporter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Reporter.java	2000/11/01 23:30:51	1.1
  +++ Reporter.java	2000/11/09 22:14:28	1.2
  @@ -89,7 +89,7 @@
    * @todo explain better how results are rolled up and calculated
    * @author Shane_Curcuru@lotus.com
    * @author Jo_Grant@lotus.com
  - * @version $Id: Reporter.java,v 1.1 2000/11/01 23:30:51 curcuru Exp $
  + * @version $Id: Reporter.java,v 1.2 2000/11/09 22:14:28 curcuru Exp $
    */
   public class Reporter implements Logger
   {
  @@ -827,30 +827,27 @@
               }
               catch (InvocationTargetException ite)
               {
  -
  -                // Catch any error, log it as a fail, and allow next test case to run
  -                // @todo should we log it as an error instead?
  +                // Catch any error, log it as an error, and allow next test case to run
                   gotException = true;
  -                testResult = java.lang.Math.max(FAIL_RESULT, testResult);
  +                testResult = java.lang.Math.max(ERRR_RESULT, testResult);
  +                tmpErrString += ite.toString();
  +                logErrorMsg(tmpErrString);
   
  -                // Grab the contained error 
  +                // Grab the contained error, log it if available 
                   java.lang.Throwable containedThrowable =
                       ite.getTargetException();
  -
  -                tmpErrString += ite.toString() + ":"
  -                                + containedThrowable.toString();
  -
  -                logErrorMsg(tmpErrString);
  -                logThrowable(ERRORMSG, ite, tmpErrString);
  +                if (containedThrowable != null)
  +                {
  +                    logThrowable(ERRORMSG, containedThrowable, tmpErrString + "(1)");
  +                }
  +                logThrowable(ERRORMSG, ite, tmpErrString + "(2)");
               }  // end of catch
               catch (Throwable t)
               {
  -
  -                // Catch any Exception or Error, log it as a fail, and allow next test case to run
  +                // Catch any error, log it as an error, and allow next test case to run
                   gotException = true;
  -                testResult = java.lang.Math.max(FAIL_RESULT, testResult);
  +                testResult = java.lang.Math.max(ERRR_RESULT, testResult);
                   tmpErrString += t.toString();
  -
                   logErrorMsg(tmpErrString);
                   logThrowable(ERRORMSG, t, tmpErrString);
               }  // end of catch