xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject cvs commit: xml-xalan/test/java/src/org/apache/qetest/xsl StylesheetDataletManager.java StylesheetTestletDriver.java
Date Tue, 26 Mar 2002 15:36:55 GMT
curcuru     02/03/26 07:36:55

  Modified:    test/java/src/org/apache/qetest/xsl
                        StylesheetDataletManager.java
                        StylesheetTestletDriver.java
  Log:
  Fix omission where runId was not set into individual datalets if user
  passed in a -fileList argument.  Maybe Not the neatest of solutions, but
  sufficient for our purposes (pass the testProps through to each worker
  method, then explicitly pass the runId thru to the datalet)
  
  Revision  Changes    Path
  1.3       +28 -9     xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetDataletManager.java
  
  Index: StylesheetDataletManager.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetDataletManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StylesheetDataletManager.java	14 Dec 2001 22:33:06 -0000	1.2
  +++ StylesheetDataletManager.java	26 Mar 2002 15:36:55 -0000	1.3
  @@ -65,6 +65,7 @@
   import java.io.File;
   import java.io.FileReader;
   import java.io.IOException;
  +import java.util.Properties;
   import java.util.StringTokenizer;
   import java.util.Vector;
   
  @@ -73,7 +74,7 @@
    * 
    *
    * @author shane_curcuru@us.ibm.com
  - * @version $Id: StylesheetDataletManager.java,v 1.2 2001/12/14 22:33:06 curcuru Exp $
  + * @version $Id: StylesheetDataletManager.java,v 1.3 2002/03/26 15:36:55 curcuru Exp $
    */
   public abstract class StylesheetDataletManager // provide static services only
   {
  @@ -201,9 +202,10 @@
        * @param logger to report problems to
        * @param fileName String; name of the file
        * @param desc description; caller's copy changed
  +     * @param defaults default properties to potentially add to each datalet
        * @return Vector of StylesheetDatalets, or null if error
        */
  -    public static Vector readFileList(Logger logger, String fileName, String desc)
  +    public static Vector readFileList(Logger logger, String fileName, String desc, Properties
defaults)
       {
           // Verify the file is there
           File f = new File(fileName);
  @@ -243,18 +245,18 @@
           if (line.startsWith(XSLTMARK_CHAR))
           {
               // This is an xsltmark .ini style file
  -            vec = readXsltmarkFileList(logger, br, line, fileName, desc);
  +            vec = readXsltmarkFileList(logger, br, line, fileName, desc, defaults);
           }
           else if (line.startsWith(QETEST_COMMENT_CHAR))
           {
               // This is a native qetest style file
  -            vec = readQetestFileList(logger, br, line, fileName, desc);
  +            vec = readQetestFileList(logger, br, line, fileName, desc, defaults);
           }
           else
           {
               logger.logMsg(Logger.WARNINGMSG, "readFileList: " + fileName
                             + " could not determine file type; assuming qetest!");
  -            vec = readQetestFileList(logger, br, line, fileName, desc);
  +            vec = readQetestFileList(logger, br, line, fileName, desc, defaults);
           }
   
           if (vec.size() == 0)
  @@ -289,10 +291,12 @@
        * @param firstLine already read from br
        * @param fileName String; name of the file
        * @param desc to use of this file
  +     * @param defaults default properties to potentially add to each datalet
        * @return Vector of StylesheetDatalets, or null if error
        */
       protected static Vector readQetestFileList(Logger logger, BufferedReader br, 
  -                                               String firstLine, String fileName, String
desc)
  +                                               String firstLine, String fileName, 
  +                                               String desc, Properties defaults)
       {
           final String ABSOLUTE = "absolute";
           final String RELATIVE = "relative";
  @@ -326,6 +330,9 @@
                   // Create a Datalet and initialize with the line's contents
                   StylesheetDatalet d = new StylesheetDatalet(line);
   
  +                // Also pass over the global runId, if set
  +                d.options.put("runId", defaults.getProperty("runId"));
  +
                   //@todo Avoid spurious passes when output & gold not specified
                   //  needs to detect when StylesheetDatalet doesn't 
                   //  properly have outputName and goldName set
  @@ -373,10 +380,12 @@
        * @param firstLine already read from br
        * @param fileName String; name of the file
        * @param desc to use of this file
  +     * @param defaults default properties to potentially add to each datalet
        * @return Vector of StylesheetDatalets, or null if error
        */
       protected static Vector readXsltmarkFileList(Logger logger, BufferedReader br, 
  -                                                 String firstLine, String fileName, String
desc)
  +                                                 String firstLine, String fileName, 
  +                                                 String desc, Properties defaults)
       {
           Vector vec = new Vector();
           String line = firstLine;
  @@ -386,7 +395,11 @@
               // If we're starting a section, parse the section to a datalet
               if (line.startsWith(XSLTMARK_CHAR))
               {
  -                StylesheetDatalet d = readXsltmarkDatalet(logger, br, line, fileName, desc);
  +                StylesheetDatalet d = readXsltmarkDatalet(logger, br, line, fileName, desc,
defaults);
  +
  +                // Also pass over the global runId, if set
  +                d.options.put("runId", defaults.getProperty("runId"));
  +
                   // Add datalet to our vector
                   vec.addElement(d);
               }
  @@ -431,10 +444,12 @@
        * @param firstLine already read from br
        * @param fileName String; name of the file
        * @param desc to use of this file
  +     * @param defaults default properties to potentially add to each datalet
        * @return StylesheetDatalet with appropriate data, or null if error
        */
       private static StylesheetDatalet readXsltmarkDatalet(Logger logger, BufferedReader
br, 
  -                                                String firstLine, String fileName, String
desc)
  +                                                String firstLine, String fileName, 
  +                                                String desc, Properties defaults)
       {
           final String STYLESHEET_MARKER = "stylesheet=";
           final String INPUT_MARKER = "input=";
  @@ -444,6 +459,10 @@
           
           String line = firstLine;
           StylesheetDatalet d = new StylesheetDatalet();
  +
  +        // Also pass over the global runId, if set
  +        d.options.put("runId", defaults.getProperty("runId"));
  +
           // Parse lines throughout the section to build the datalet
           for (;;)
           {
  
  
  
  1.6       +2 -2      xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetTestletDriver.java
  
  Index: StylesheetTestletDriver.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetTestletDriver.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StylesheetTestletDriver.java	12 Dec 2001 22:08:47 -0000	1.5
  +++ StylesheetTestletDriver.java	26 Mar 2002 15:36:55 -0000	1.6
  @@ -85,7 +85,7 @@
    * would be a good model for a completely generic TestletDriver.
    *
    * @author shane_curcuru@lotus.com
  - * @version $Id: StylesheetTestletDriver.java,v 1.5 2001/12/12 22:08:47 curcuru Exp $
  + * @version $Id: StylesheetTestletDriver.java,v 1.6 2002/03/26 15:36:55 curcuru Exp $
    */
   public class StylesheetTestletDriver extends XSLProcessorTestBase
   {
  @@ -240,7 +240,7 @@
               // Process the specific list of tests the user supplied
               String desc = "User-supplied fileList: " + fileList; // provide default value
               // Use static worker class to process the list
  -            Vector datalets = StylesheetDataletManager.readFileList(reporter, fileList,
desc);
  +            Vector datalets = StylesheetDataletManager.readFileList(reporter, fileList,
desc, testProps);
   
               // Actually process the specified files in a testCase
               processFileList(datalets, desc);
  
  
  

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


Mime
View raw message