curcuru     01/02/16 12:30:08

  Modified:    test/java/src/org/apache/qetest/xsl
                        XSLDirectoryIterator.java
  Log:
  Improve logging for err tests: better names, only
  logs full exceptions when they're unexpected; now
  calls checkErr when unexpected return values given
  (which should never happen...)
  
  Revision  Changes    Path
  1.8       +27 -7     
xml-xalan/test/java/src/org/apache/qetest/xsl/XSLDirectoryIterator.java
  
  Index: XSLDirectoryIterator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/XSLDirectoryIterator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLDirectoryIterator.java 2001/02/14 21:55:31     1.7
  +++ XSLDirectoryIterator.java 2001/02/16 20:30:07     1.8
  @@ -99,7 +99,7 @@
    * </ul>
    * @todo improve file discovery - file execution paradigm
    * @author Shane Curcuru
  - * @version $Id: XSLDirectoryIterator.java,v 1.7 2001/02/14 21:55:31 curcuru 
Exp $
  + * @version $Id: XSLDirectoryIterator.java,v 1.8 2001/02/16 20:30:07 curcuru 
Exp $
    */
   public class XSLDirectoryIterator extends XSLProcessorTestBase
   {
  @@ -436,7 +436,7 @@
   
                                   // Use special filter to look for 
parentName+"err"
                                   reporter.testCaseInit(
  -                                    "Conformance Test of errDir: "
  +                                    "Conformance Test of: " + dirNames[i]
                                       + errDirNames[k]);
                                   processSingleDir(errTestDir, errOutDir,
                                                    errGoldDir, errFileFilter);
  @@ -742,7 +742,8 @@
   
                       default:
                           // This should never happen
  -                        reporter.logErrorMsg("Unexpected return value from 
processEmbeddedFile!");
  +                        reporter.checkErr("Unexpected return value from 
processSingleFile(" 
  +                                          + xslF.getName() + ")!", 
xslF.getName());
                       }
                   }  // of if (dotIndex > 0)
                   else
  @@ -926,7 +927,8 @@
                   
                   default:
                       // This should never happen
  -                    reporter.logErrorMsg("Unexpected return value from 
processEmbeddedFile!");
  +                    reporter.checkErr("Unexpected return value from 
processEmbeddedFile(" 
  +                                      + xmlF.getName() + ")!", 
xmlF.getName());
                   }
               }  // of if (dotIndex > 0)
               else
  @@ -1154,11 +1156,29 @@
           // Catch any Throwable, check if they're expected, and restart
           catch (Throwable t)
           {
  -            reporter.logThrowable(reporter.WARNINGMSG, t, 
  -                                  "processSingleFile(" + xslURI + ") threw");
  -
               // Here, use the original, non-URI'd name
               int retVal = checkExpectedException(t, XSLName, OutName);
  +
  +            // Only log out the full exception if needed
  +            switch (retVal)
  +            {
  +                case GOT_EXPECTED_EXCEPTION:
  +                    // Log just the .toString for simplicity 
  +                    //  (since it's expected, this is enough)
  +                    reporter.logStatusMsg("processSingleFile(" + xslURI + ") 
expected threw: " + t.toString());
  +                    break;
  +                case UNEXPECTED_EXCEPTION:
  +                    // Log the whole exception for debugging
  +                    reporter.logThrowable(reporter.ERRORMSG, t, 
  +                           "processSingleFile(" + xslURI + ") unexpected 
threw");
  +                    break;
  +                default:
  +                    // Should never happen, but cover it anyways
  +                    // Log the whole exception for debugging
  +                    reporter.logThrowable(reporter.ERRORMSG, t, 
  +                           "processSingleFile(" + xslURI + ") unexpected! 
threw");
  +                    break;
  +            }
   
               createNewProcessor();
   
  
  
  

Reply via email to