curcuru     01/08/08 10:18:53

  Modified:    test/java/src/org/apache/qetest/trax TemplatesAPITest.java
                        TransformerAPITest.java
                        TransformerFactoryAPITest.java
  Log:
  Remove outdated attempts to force system property to Xalan implementation;
  makes it easier to test against xsltc impl or others
  
  Revision  Changes    Path
  1.8       +1 -50     
xml-xalan/test/java/src/org/apache/qetest/trax/TemplatesAPITest.java
  
  Index: TemplatesAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TemplatesAPITest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TemplatesAPITest.java     2001/03/22 19:57:09     1.7
  +++ TemplatesAPITest.java     2001/08/08 17:18:53     1.8
  @@ -117,20 +117,7 @@
       /** Name of a stylesheet with xsl:output HTML. */
       protected String outputFormatXSL = null;
   
  -    /** Cache the relevant system property. */
  -    protected String saveXSLTProp = null;
  -
  -    /** Allow user to override our default of Xalan 2.x processor classname. */
  -    public static final String XALAN_CLASSNAME =
  -        "org.apache.xalan.processor.TransformerFactoryImpl";
  -
  -    /** NEEDSDOC Field PROCESSOR_CLASSNAME          */
  -    protected String PROCESSOR_CLASSNAME = "processorClassname";
  -
  -    /** NEEDSDOC Field processorClassname          */
  -    protected String processorClassname = XALAN_CLASSNAME;
  -
  -    /** NEEDSDOC Field TRAX_PROCESSOR_XSLT          */
  +    /** System property name javax.xml.transform.TransformerFactory.  */
       public static final String TRAX_PROCESSOR_XSLT = 
"javax.xml.transform.TransformerFactory";
   
       /** Known outputFormat property name from outputFormatTest  */
  @@ -182,21 +169,6 @@
           simpleTest.goldName = goldBasePath + "TransformerAPIParam.out";
           outputFormatXSL = QetestUtils.filenameToURL(testBasePath + 
"TransformerAPIOutputFormat.xsl");
   
  -        // Cache trax system property
  -        saveXSLTProp = System.getProperty(TRAX_PROCESSOR_XSLT);
  -
  -        reporter.logInfoMsg(TRAX_PROCESSOR_XSLT + " property is: "
  -                            + saveXSLTProp);
  -
  -        // Check if user wants to use a processor other than Xalan 2.x
  -        processorClassname = testProps.getProperty(PROCESSOR_CLASSNAME,
  -                                                   XALAN_CLASSNAME);
  -
  -        // @todo fix: user should be able to specify -processorClassname 
  -        //  on the command line to override the system properties
  -
  -        reporter.logInfoMsg(PROCESSOR_CLASSNAME + " property is: "
  -                            + processorClassname);
           reporter.logInfoMsg(TRAX_PROCESSOR_XSLT + " property is: "
                               + System.getProperty(TRAX_PROCESSOR_XSLT));
           try
  @@ -219,27 +191,6 @@
           return true;
       }
   
  -    /**
  -     * Cleanup this test - reset the cached system property trax.processor.xslt.  
  -     *
  -     * NEEDSDOC @param p
  -     *
  -     * NEEDSDOC ($objectName$) @return
  -     */
  -    public boolean doTestFileClose(Properties p)
  -    {
  -
  -        if (saveXSLTProp == null)
  -        {
  -            System.getProperties().remove(TRAX_PROCESSOR_XSLT);
  -        }
  -        else
  -        {
  -            System.getProperties().put(TRAX_PROCESSOR_XSLT, saveXSLTProp);
  -        }
  -
  -        return true;
  -    }
   
       /**
        * TRAX Templates: cover newTransformer(), 
  
  
  
  1.15      +1 -52     
xml-xalan/test/java/src/org/apache/qetest/trax/TransformerAPITest.java
  
  Index: TransformerAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TransformerAPITest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TransformerAPITest.java   2001/05/10 23:07:39     1.14
  +++ TransformerAPITest.java   2001/08/08 17:18:53     1.15
  @@ -145,24 +145,7 @@
       public static final String MEDIA_TYPE_VALUE = "text/test/xml";
       public static final String OMIT_XML_DECLARATION_VALUE = "yes";
   
  -    /** Cache the relevant system property. */
  -    protected String saveXSLTProp = null;
  -
  -    /** Allow user to override our default of Xalan 2.x processor classname. */
  -    public static final String XALAN_CLASSNAME =
  -        "org.apache.xalan.processor.TransformerFactoryImpl";
  -
  -    /** 
  -     * Commandline/properties string to initialize a different 
  -     * TransformerFactory implementation - otherwise we default to 
  -     * Xalan 2.x org.apache.xalan.processor.TransformerFactoryImpl
  -     */
  -    protected String PROCESSOR_CLASSNAME = "processorClassname";
  -
  -    /** NEEDSDOC Field processorClassname          */
  -    protected String processorClassname = XALAN_CLASSNAME;
  -
  -    /** NEEDSDOC Field TRAX_PROCESSOR_XSLT          */
  +    /** System property name javax.xml.transform.TransformerFactory.  */
       public static final String TRAX_PROCESSOR_XSLT = 
"javax.xml.transform.TransformerFactory";
   
       /** Subdir name under test\tests\api for files.  */
  @@ -220,21 +203,7 @@
           htmlFormatTest.inputName = QetestUtils.filenameToURL(testBasePath + 
"TransformerAPIHTMLFormat.xsl");
           htmlFormatTest.goldName = goldBasePath + "TransformerAPIHTMLFormat.out";
   
  -        // Cache trax system property
  -        saveXSLTProp = System.getProperty(TRAX_PROCESSOR_XSLT);
  -
           reporter.logInfoMsg(TRAX_PROCESSOR_XSLT + " property is: "
  -                            + saveXSLTProp);
  -
  -        // Check if user wants to use a processor other than Xalan 2.x
  -        processorClassname = testProps.getProperty(PROCESSOR_CLASSNAME,
  -                                                   XALAN_CLASSNAME);
  -        // @todo fix: user should be able to specify -processorClassname 
  -        //  on the command line to override the system properties
  -
  -        reporter.logInfoMsg(PROCESSOR_CLASSNAME + " property is: "
  -                            + processorClassname);
  -        reporter.logInfoMsg(TRAX_PROCESSOR_XSLT + " property is: "
                               + System.getProperty(TRAX_PROCESSOR_XSLT));
   
           try
  @@ -257,26 +226,6 @@
           return true;
       }
   
  -    /**
  -     * Cleanup this test - reset the cached system property trax.processor.xslt.  
  -     *
  -     * @param p Properties to initialize with (may be unused)
  -     * @return false if test should be aborted, true otherwise
  -     */
  -    public boolean doTestFileClose(Properties p)
  -    {
  -
  -        if (saveXSLTProp == null)
  -        {
  -            System.getProperties().remove(TRAX_PROCESSOR_XSLT);
  -        }
  -        else
  -        {
  -            System.getProperties().put(TRAX_PROCESSOR_XSLT, saveXSLTProp);
  -        }
  -
  -        return true;
  -    }
   
       /**
        * TRAX Transformer: cover basic get/setParameter(s) APIs.
  
  
  
  1.7       +15 -11    
xml-xalan/test/java/src/org/apache/qetest/trax/TransformerFactoryAPITest.java
  
  Index: TransformerFactoryAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TransformerFactoryAPITest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TransformerFactoryAPITest.java    2001/07/09 18:36:25     1.6
  +++ TransformerFactoryAPITest.java    2001/08/08 17:18:53     1.7
  @@ -87,7 +87,7 @@
   /**
    * API Coverage test for TransformerFactory class of TRAX.
    * @author [EMAIL PROTECTED]
  - * @version $Id: TransformerFactoryAPITest.java,v 1.6 2001/07/09 18:36:25 curcuru 
Exp $
  + * @version $Id: TransformerFactoryAPITest.java,v 1.7 2001/08/08 17:18:53 curcuru 
Exp $
    */
   public class TransformerFactoryAPITest extends XSLProcessorTestBase
   {
  @@ -166,7 +166,7 @@
           embeddedCSSFileInfo.xmlName = testBasePath + 
"TransformerFactoryAPIModern.xml"; // just the local path\filename
           // embeddedCSSFileInfo.optionalName = testBasePath + 
"TransformerFactoryAPIModern.css"; // other file required by XML file
   
  -        // Cache the system property
  +        // Cache the system property; is reset in testFileClose
           cachedSysProp = System.getProperty(defaultPropName);
           return true;
       }
  @@ -184,7 +184,6 @@
               System.getProperties().remove(defaultPropName);
           else
               System.getProperties().put(defaultPropName, cachedSysProp);
  -        
           return true;
       }
   
  @@ -259,20 +258,26 @@
               // Could also verify specific type of exception
           }
   
  -        // test when system property is Xalan-J 2.x's implementation
  +        // Reset the system property to what was cached previously
           try
           {
               // This should come last so it will stay set for the rest of the test
  -            System.getProperties().put(defaultPropName, XALAN_CLASSNAME);
  -            reporter.logStatusMsg("System property " + defaultPropName 
  +            // Note: this needs review, since in the future we may 
  +            //  not guaruntee order of testCase execution!
  +            if (cachedSysProp == null)
  +                System.getProperties().remove(defaultPropName);
  +            else
  +                System.getProperties().put(defaultPropName, cachedSysProp);
  +
  +            reporter.logStatusMsg("System property (default) " + defaultPropName 
                                     + " is: " + System.getProperty(defaultPropName));
               factory = TransformerFactory.newInstance();
  -            reporter.checkPass("factory.newInstance() of Xalan impl is: " + 
factory.toString());
  +            reporter.checkPass("factory.newInstance() of default impl is: " + 
factory.toString());
           }
           catch (Throwable t)
           {
  -            reporter.checkFail("factory.newInstance() of Xalan impl threw: " + 
t.toString());
  -            reporter.logThrowable(reporter.ERRORMSG, t, "factory.newInstance() of 
Xalan impl threw:");
  +            reporter.checkFail("factory.newInstance() of default impl threw: " + 
t.toString());
  +            reporter.logThrowable(reporter.ERRORMSG, t, "factory.newInstance() of 
default impl threw:");
           }
   
           reporter.logStatusMsg("@todo code coverage for findFactory() method");
  @@ -658,6 +663,7 @@
       public String usage()
       {
           return ("Common [optional] options supported by 
TransformerFactoryAPITest:\n"
  +                + "-transformerFactory <FQCN of TransformerFactoryImpl; default 
Xalan 2.x>\n"
                   + "(Note: assumes inputDir=.\\tests\\api)\n"
                   + super.usage());   // Grab our parent classes usage as well
       }
  @@ -669,9 +675,7 @@
        */
       public static void main(String[] args)
       {
  -
           TransformerFactoryAPITest app = new TransformerFactoryAPITest();
  -
           app.doMain(args);
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to