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...@apache.org on 2001/02/26 22:40:59 UTC

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

curcuru     01/02/26 13:40:57

  Modified:    test/java/src/org/apache/qetest/xsl StylesheetDatalet.java
  Log:
  Add options member variable Properties - this is a catch-all
  for future data members, so that the same StylesheetDatalet
  can be used for performance testing as well. Comments on
  Datalet design welcome (i.e. have each datalet have specific
  member variables for it's testlet, for ease of testlet programming,
  or move Datalets to more of an intelligent Properties/Hashtable metaphor?)
  
  Revision  Changes    Path
  1.2       +41 -1     xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetDatalet.java
  
  Index: StylesheetDatalet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/StylesheetDatalet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StylesheetDatalet.java	2001/02/23 21:04:45	1.1
  +++ StylesheetDatalet.java	2001/02/26 21:40:51	1.2
  @@ -65,13 +65,14 @@
   import org.apache.qetest.Datalet;
   
   import java.util.Hashtable;
  +import java.util.Properties;
   import java.util.StringTokenizer;
   
   /**
    * Datalet for conformance testing of xsl stylesheet files.
    * Should serve as a base class for other XSLT related Datalets.
    * @author Shane_Curcuru@lotus.com
  - * @version $Id: StylesheetDatalet.java,v 1.1 2001/02/23 21:04:45 curcuru Exp $
  + * @version $Id: StylesheetDatalet.java,v 1.2 2001/02/26 21:40:51 curcuru Exp $
    */
   public class StylesheetDatalet implements Datalet
   {
  @@ -99,6 +100,21 @@
        */
       public boolean useURL = true;
   
  +    /** 
  +     * Generic placeholder for any additional options.  
  +     * I'm still undecided if I like this idea or not.  
  +     * This allows StylesheetDatalets to support additional kinds 
  +     * of tests, like performance tests, without having to change 
  +     * this data model.  These options can serve as a catch-all 
  +     * for any new properties or options or what-not that new 
  +     * tests need, without having to change how the most basic 
  +     * member variables here work.
  +     * Note that while this needs to be a Properties object to 
  +     * take advantage of the parent/default behavior in 
  +     * getProperty(), this doesn't necessarily mean they can only 
  +     * store Strings.
  +     */
  +    public Properties options = new Properties();
   
       /** Description of what this Datalet tests.  */
       protected String description = "StylesheetDatalet: String inputName, String xmlName, String outputName, String goldName, String flavor";
  @@ -151,6 +167,8 @@
       /**
        * Load fields of this Datalet from a Hashtable.  
        * Caller must provide data for all of our fields.
  +     * //@todo design decision: only have load(Hashtable)
  +     * or load(Properties), not both.
        * 
        * @param Hashtable to load
        */
  @@ -166,6 +184,28 @@
           flavor = (String)h.get("flavor");
       }
   
  +
  +    /**
  +     * Load fields of this Datalet from a Properties.  
  +     * Caller must provide data for all of our fields.
  +     * //@todo design decision: only have load(Hashtable)
  +     * or load(Properties), not both.
  +     * 
  +     * @param Hashtable to load
  +     */
  +    public void load(Properties p)
  +    {
  +        if (null == p)
  +            return; //@todo should this have a return val or exception?
  +
  +        inputName = (String)p.getProperty("inputName");
  +        xmlName = (String)p.getProperty("xmlName");
  +        outputName = (String)p.getProperty("outputName");
  +        goldName = (String)p.getProperty("goldName");
  +        flavor = (String)p.getProperty("flavor");
  +        // Also set our internal options to default to this Properties
  +        options = new Properties(p);
  +    }
   
       /**
        * Load fields of this Datalet from an array.