You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by pa...@apache.org on 2002/03/29 16:09:54 UTC
cvs commit: xml-xalan/test/java/src/org/apache/qetest/xsl XHTFileCheckService.java
pauldick 02/03/29 07:09:54
Modified: test/java/src/org/apache/qetest/xsl XHTFileCheckService.java
Log:
Added main() so we can use this for doing standalone file compares
Revision Changes Path
1.13 +39 -2 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XHTFileCheckService.java 20 Dec 2001 18:29:26 -0000 1.12
+++ XHTFileCheckService.java 29 Mar 2002 15:09:54 -0000 1.13
@@ -77,7 +77,7 @@
* Uses an XML/HTML/Text diff comparator to check or diff two files.
* @see #check(Logger logger, Object actual, Object reference, String msg, String id)
* @author Shane_Curcuru@lotus.com
- * @version $Id: XHTFileCheckService.java,v 1.12 2001/12/20 18:29:26 curcuru Exp $
+ * @version $Id: XHTFileCheckService.java,v 1.13 2002/03/29 15:09:54 pauldick Exp $
*/
public class XHTFileCheckService implements CheckService
{
@@ -121,6 +121,11 @@
* @return Logger.*_RESULT code denoting status; each method may
* define it's own meanings for pass, fail, ambiguous, etc.
*/
+ public XHTFileCheckService()
+ {
+ //No-op
+ }
+
public int check(Logger logger, Object actual, Object reference,
String msg, String id)
{
@@ -292,7 +297,7 @@
// cleanest place to put this is (here or some sort
// of intelligent logic in XMLFileLogger)
elementBody = XMLFileLogger.escapeString(elementBody);
- logger.logElement(Logger.STATUSMSG, "fileCheck", attrs, elementBody);
+ logger.logElement(Logger.STATUSMSG, "fileCheck", attrs, elementBody);
}
/**
@@ -481,5 +486,37 @@
return "XHTFileCheckService-no-info-available";
}
+ /**
+ * Main method to run test from the command line - can be left alone.
+ * @param args command line argument array
+ */
+ public static void main(String[] args)
+ {
+ if (args.length < 2)
+ {
+ System.out.println(" Please provide two files to compare");
+ }
+ else
+ {
+ ConsoleLogger log = new ConsoleLogger();
+ XHTFileCheckService app = new XHTFileCheckService();
+ System.out.println("\nThank you for using XHTFileCheckService");
+ System.out.println( app.getDescription() );
+ System.out.println("We hope your results are satisfactory");
+ System.out.println("\n" + args[0] + " " + args[1]);
+
+ File fAct = new File(args[0]);
+ File fExp = new File(args[1]);
+
+ try
+ {
+ app.check(log, fAct, fExp, "Check");
+ }
+ catch (Exception e)
+ {
+ System.out.println ("main() caught unexpected Exception");
+ }
+ }
+ }
} // end of class XHTFileCheckService
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org