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:18:39 UTC

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

curcuru     00/12/01 14:18:39

  Modified:    test/java/src/org/apache/qetest/xsl XHTFileCheckService.java
  Log:
  Add duplicate check*() methods with optional 'String id' param
  
  Revision  Changes    Path
  1.2       +27 -9     xml-xalan/test/java/src/org/apache/qetest/xsl/XHTFileCheckService.java
  
  Index: XHTFileCheckService.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/XHTFileCheckService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XHTFileCheckService.java	2000/11/01 23:26:57	1.1
  +++ XHTFileCheckService.java	2000/12/01 22:18:38	1.2
  @@ -73,7 +73,7 @@
   /**
    * Uses an XML/HTML/Text diff comparator to check or diff two files.
    * @author Shane_Curcuru@lotus.com
  - * @version $Id: XHTFileCheckService.java,v 1.1 2000/11/01 23:26:57 curcuru Exp $
  + * @version $Id: XHTFileCheckService.java,v 1.2 2000/12/01 22:18:38 curcuru Exp $
    */
   public class XHTFileCheckService implements CheckService
   {
  @@ -102,12 +102,13 @@
        * @param actual (current) Object to check
        * @param reference (gold, or expected) Object to check against
        * @param description of what you're checking
  -     * NEEDSDOC @param msg
  +     * @param msg comment to log out with this test point
  +     * @param id ID tag to log out with this test point
        * @return Reporter.*_RESULT code denoting status; each method may define
        * it's own meanings for pass, fail, ambiguous, etc.
        */
       public int check(Reporter reporter, Object actual, Object reference,
  -                     String msg)
  +                     String msg, String id)
       {
   
           if (!((actual instanceof File) & (reference instanceof File)))
  @@ -115,7 +116,7 @@
   
               // Must have File objects to continue
               reporter.checkErr("XHTFileCheckService only takes files, with: "
  -                              + msg);
  +                              + msg, id);
   
               return reporter.ERRR_RESULT;
           }
  @@ -126,7 +127,7 @@
           // Fail if Actual file doesn't exist or is 0 len
           if ((!actualFile.exists()) || (actualFile.length() == 0))
           {
  -            reporter.checkFail(msg);
  +            reporter.checkFail(msg, id);
   
               return reporter.FAIL_RESULT;
           }
  @@ -134,7 +135,7 @@
           // Ambiguous if gold file doesn't exist or is 0 len
           if ((!referenceFile.exists()) || (referenceFile.length() == 0))
           {
  -            reporter.checkAmbiguous(msg);
  +            reporter.checkAmbiguous(msg, id);
   
               return Reporter.AMBG_RESULT;
           }
  @@ -171,7 +172,7 @@
           {
   
               // We fail, obviously!
  -            reporter.checkFail(msg);
  +            reporter.checkFail(msg, id);
   
               return Reporter.FAIL_RESULT;
           }
  @@ -179,16 +180,33 @@
           {
               pw.println("comparator whitespace diff warning!");
               pw.flush();
  -            reporter.checkFail(msg);
  +            reporter.checkFail(msg, id);
   
               return Reporter.FAIL_RESULT;
           }
           else
           {
  -            reporter.checkPass(msg);
  +            reporter.checkPass(msg, id);
   
               return Reporter.PASS_RESULT;
           }
  +    }
  +
  +    /**
  +     * Compare two objects for equivalence, and return appropriate result.
  +     *
  +     * @param reporter to dump any output messages to
  +     * @param actual (current) File to check
  +     * @param reference (gold, or expected) File to check against
  +     * @param description of what you're checking
  +     * @param msg comment to log out with this test point
  +     * @return Reporter.*_RESULT code denoting status; each method may define
  +     * it's own meanings for pass, fail, ambiguous, etc.
  +     */
  +    public int check(Reporter reporter, Object actual, Object reference,
  +                     String msg)
  +    {
  +        return check(reporter, actual, reference, msg, null);
       }
   
       /**