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/12/01 23:20:23 UTC

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

curcuru     00/12/01 14:20:22

  Modified:    test/java/src/org/apache/qetest/xsl
                        XSLDirectoryIterator.java
  Log:
  Use new check*(..., id) methods, and call logElement
  on non-pass files to create a <fileref...> element
  
  Revision  Changes    Path
  1.2       +53 -31    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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSLDirectoryIterator.java	2000/11/01 23:26:57	1.1
  +++ XSLDirectoryIterator.java	2000/12/01 22:20:21	1.2
  @@ -101,7 +101,7 @@
    * </ul>
    * @todo improve file discovery - file execution paradigm
    * @author Shane Curcuru
  - * @version $Id: XSLDirectoryIterator.java,v 1.1 2000/11/01 23:26:57 curcuru Exp $
  + * @version $Id: XSLDirectoryIterator.java,v 1.2 2000/12/01 22:20:21 curcuru Exp $
    */
   public class XSLDirectoryIterator extends XSLProcessorTestBase
   {
  @@ -691,33 +691,43 @@
                                                 absOutName))
                       {
                       case PROCESS_OK :
  -                        int res = fileChecker.check(reporter,
  -                                                    new File(absOutName),
  -                                                    new File(absGoldName),
  -                                                    xslF.getName()
  -                                                    + " output comparison");
  -
  -                        // ((XLTestReporter)reporter).checkFiles(new File(absOutName), new File(absGoldName), xslF.getName() + " output comparison");
  -                        // If we're using an appropriate fileChecker, 
  -                        //  get extra info on a fail
  -                        if (res == reporter.FAIL_RESULT)
  +                        if (!reporter.check(fileChecker, 
  +                                            new File(absOutName), 
  +                                            new File(absGoldName), 
  +                                            xslF.getName() + " output comparison",
  +                                            xslF.getName()))
                           {
  -                            String tmp = fileChecker.getExtendedInfo();
  +                            // If we're using an appropriate fileChecker, 
  +                            //  get extra info on a fail, as well as file references to the test file
   
  +                            // Report extra info about why it failed
  +                            String tmp = fileChecker.getExtendedInfo();
                               if (tmp != null)
                                   reporter.logArbitrary(reporter.INFOMSG, tmp);
                               else
  -                                reporter.logTraceMsg(
  -                                    "getFileChecker().getExtendedInfo() not available");
  +                                reporter.logTraceMsg("getFileChecker().getExtendedInfo() not available");
  +
  +                            // Log a custom element with all the file refs in it
  +                            // Closely related to viewResults.xsl select='fileref"
  +                            // This code should be cleaned up and duplicated for 
  +                            //  the UNEXPECTED_EXCEPTION case below too!
  +                            Hashtable attrs = new Hashtable();
  +                            attrs.put("idref", xslF.getName());
  +                            attrs.put("inputName", absXSLName);
  +                            attrs.put("xmlName", absXMLName);
  +                            attrs.put("outputName", absOutName);
  +                            attrs.put("goldName", absGoldName);
  +                            reporter.logElement(reporter.INFOMSG, "fileref", attrs, "File references for Conformance Test");
                           }
  +
                           break;
                       case GOT_EXPECTED_EXCEPTION :
                           reporter.checkPass(xslF.getName()
  -                                           + " got expected exception");
  +                                           + " got expected exception", xslF.getName());
                           break;
                       case UNEXPECTED_EXCEPTION :
                           reporter.checkFail(xslF.getName()
  -                                           + " got unexpected exception");
  +                                           + " got unexpected exception", xslF.getName());
                           break;
                       }
                   }  // of if (dotIndex > 0)
  @@ -822,33 +832,45 @@
                                         fileSet.outputName))
               {
               case PROCESS_OK :
  -                int res = fileChecker.check(reporter,
  -                                            new File(fileSet.outputName),
  -                                            new File(fileSet.goldName),
  -                                            xslF.getName()
  -                                            + " output comparison");
  -
  -                // ((XLTestReporter)reporter).checkFiles(new File(fileSet.outputName), new File(fileSet.goldName), xslF.getName() + " output comparison");
  -                // If we're using an appropriate fileChecker, 
  -                //  get extra info on a fail
  -                if (res == reporter.FAIL_RESULT)
  +                if (!reporter.check(fileChecker, 
  +                                    new File(fileSet.outputName), 
  +                                    new File(fileSet.goldName), 
  +                                    xslF.getName() + " output comparison",
  +                                    xslF.getName()))
                   {
  -                    String tmp = fileChecker.getExtendedInfo();
  +                    // If we're using an appropriate fileChecker, 
  +                    //  get extra info on a fail, as well as file references to the test file
   
  +                    // Report extra info about why it failed
  +                    String tmp = fileChecker.getExtendedInfo();
                       if (tmp != null)
                           reporter.logArbitrary(reporter.INFOMSG, tmp);
                       else
  -                        reporter.logTraceMsg(
  -                            "getFileChecker().getExtendedInfo() not available");
  +                        reporter.logTraceMsg("getFileChecker().getExtendedInfo() not available");
  +
  +                    // Log a custom element with all the file refs in it
  +                    // Closely related to viewResults.xsl select='fileref"
  +                    // This code should be cleaned up and duplicated for 
  +                    //  the UNEXPECTED_EXCEPTION case below too!
  +                    Hashtable attrs = new Hashtable();
  +                    attrs.put("idref", xslF.getName());
  +                    attrs.put("inputName", fileSet.inputName);
  +                    attrs.put("xmlName", fileSet.xmlName);
  +                    attrs.put("outputName", fileSet.outputName);
  +                    attrs.put("goldName", fileSet.goldName);
  +                    reporter.logElement(reporter.INFOMSG, "fileref", attrs, "File references for Conformance Test");
                   }
  +
  +
  +
                   break;
               case GOT_EXPECTED_EXCEPTION :
                   reporter.checkPass(xslF.getName()
  -                                   + " got expected exception");
  +                                   + " got expected exception", xslF.getName());
                   break;
               case UNEXPECTED_EXCEPTION :
                   reporter.checkFail(xslF.getName()
  -                                   + " got unexpected exception");
  +                                   + " got unexpected exception", xslF.getName());
                   break;
               }
           }  // of while...