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 2001/12/11 16:23:13 UTC

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

pauldick    01/12/11 07:23:13

  Modified:    test/java/src/org/apache/qetest/xsl XalanCTestlet.java
  Log:
  Updated to run the new 'Xalan' command line executable.
  
  Revision  Changes    Path
  1.2       +51 -1     xml-xalan/test/java/src/org/apache/qetest/xsl/XalanCTestlet.java
  
  Index: XalanCTestlet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/XalanCTestlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanCTestlet.java	2001/12/10 21:18:58	1.1
  +++ XalanCTestlet.java	2001/12/11 15:23:13	1.2
  @@ -59,6 +59,7 @@
   
   import org.apache.qetest.Datalet;
   import org.apache.qetest.Logger;
  +import java.io.File;
   
   /**
    * Testlet for conformance testing of xsl stylesheet files using 
  @@ -67,7 +68,7 @@
    * Note: this class simply uses CmdlineTestlet's implementation.
    *
    * @author Shane_Curcuru@lotus.com
  - * @version $Id: XalanCTestlet.java,v 1.1 2001/12/10 21:18:58 curcuru Exp $
  + * @version $Id: XalanCTestlet.java,v 1.2 2001/12/11 15:23:13 pauldick Exp $
    */
   public class XalanCTestlet extends CmdlineTestlet
   {
  @@ -85,6 +86,55 @@
       {
           return "XalanCTestlet";
       }
  +
  +    /**
  +     * Default Actual name of external program to call.  
  +     * @return Xalan, the Xalan-C command line.
  +     */
  +    public String getDefaultProgName()
  +    {
  +        return "Xalan";
  +    }
  +
  +    /**
  +     * Worker method to get list of arguments specific to this program.  
  +     * 
  +     * <p>Must be overridden for different processors, obviously.  
  +     * This implementation returns the args for Xalan-C TestXSLT</p>
  +     * 
  +     * @param program path\name of program to Runtime.exec()
  +     * @param defaultArgs any additional arguments to pass
  +     * @return String array of arguments suitable to pass to 
  +     * Runtime.exec()
  +     */
  +    public String[] getProgramArguments(StylesheetDatalet datalet, String[] defaultArgs)
  +    {
  +        final int NUMARGS = 5;
  +        String[] args = new String[defaultArgs.length + NUMARGS];
  +        String progName = datalet.options.getProperty(OPT_PROGNAME, getDefaultProgName());
  +        String progPath = datalet.options.getProperty(OPT_PROGPATH);
  +        if ((null != progPath) && (progPath.length() > 0))
  +        {
  +            args[0] = progPath + File.separator + progName;
  +        }
  +        else
  +        {
  +            // Pesume the program is on the PATH already...
  +            args[0] = progName;
  +        }
  +    
  +        // Default args for Xalan-C TestXSLT
  +        args[1] = "-o";
  +        args[2] = datalet.outputName;
  +        args[3] = datalet.xmlName;
  +        args[4] = datalet.inputName;
  +
  +        if (defaultArgs.length > 0)
  +            System.arraycopy(defaultArgs, 0, args, NUMARGS, defaultArgs.length);
  +
  +        return args;
  +    }
  +
   
   }  // end of class XalanCTestlet
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org