Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 97185 invoked by uid 500); 7 Jan 2002 15:25:04 -0000 Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 97174 invoked from network); 7 Jan 2002 15:25:03 -0000 Date: 7 Jan 2002 15:25:03 -0000 Message-ID: <20020107152503.46317.qmail@icarus.apache.org> From: curcuru@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/test/tests/bugzilla Bugzilla5609.gold Bugzilla5609.java Bugzilla5609.xml Bugzilla5609.xsl Bugzilla5609a.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N curcuru 02/01/07 07:25:03 Added: test/tests/bugzilla Bugzilla5609.gold Bugzilla5609.java Bugzilla5609.xml Bugzilla5609.xsl Bugzilla5609a.xml Log: Reproduce Bugzilla 5609 bug Revision Changes Path 1.1 xml-xalan/test/tests/bugzilla/Bugzilla5609.gold Index: Bugzilla5609.gold =================================================================== Hello 9115 World 1.1 xml-xalan/test/tests/bugzilla/Bugzilla5609.java Index: Bugzilla5609.java =================================================================== /* * Covered by The Apache Software License, Version 1.1 * See xml-xalan/License */ // Common Qetest / Xalan testing imports import org.apache.qetest.Datalet; import org.apache.qetest.Logger; import org.apache.qetest.TestletImpl; // REPLACE_imports needed for reproducing the bug import org.apache.qetest.CheckService; import org.apache.qetest.xsl.XHTFileCheckService; import javax.xml.transform.*; import javax.xml.transform.stream.*; import java.io.File; /** * Testlet for reproducing Bugzilla reported bugs. * @author howejr77@yahoo.com * @author shane_curcuru@us.ibm.com */ public class Bugzilla5609 extends TestletImpl { // Initialize our classname for TestletImpl's main() method - must be updated! static { thisClassName = "Bugzilla5609"; } /** * Write Minimal code to reproduce your Bugzilla bug report. * Many Bugzilla tests won't bother with a datalet; they'll * just have the data to reproduce the bug encoded by default. * @param d (optional) Datalet to use as data point for the test. */ public void execute(Datalet d) { // Use logger.logMsg(...) instead of System.out.println(...) logger.logMsg(Logger.STATUSMSG, "Reproducing Bugzilla#5609: Global Variable Initialization across Multiple Transformations"); CheckService fileChecker = new XHTFileCheckService(); try { // Reproduce bug as-is: re-using transformer with global variable decl uses wrong value TransformerFactory factory = TransformerFactory.newInstance(); logger.logMsg(Logger.STATUSMSG, "About to newTransformer(Bugzilla5609.xsl)"); Transformer transformer = factory.newTransformer(new StreamSource(new File("Bugzilla5609.xsl"))); logger.logMsg(Logger.STATUSMSG, "About to transform#1 Bugzilla5609.xml into .out"); transformer.transform(new StreamSource(new File("Bugzilla5609.xml")), new StreamResult(new File("Bugzilla5609.out"))); fileChecker.check(logger, new File("Bugzilla5609.out"), new File("Bugzilla5609.gold"), "transform#1 into Bugzilla5609.out"); logger.logMsg(Logger.STATUSMSG, "About to transform#2 ParamBugzilla5609a.xml into .out"); transformer.transform(new StreamSource(new File("Bugzilla5609a.xml")), new StreamResult(new File("Bugzilla5609a.out"))); fileChecker.check(logger, new File("Bugzilla5609a.out"), new File("Bugzilla5609a.gold"), "transform#2 into Bugzilla5609a.out; but is wrong var num is used"); } catch (Throwable t) { logger.logThrowable(Logger.WARNINGMSG, t, "Bugzilla#5609 threw"); logger.checkErr("Bugzilla#5609 threw " + t.toString()); } try { // Reproduce bug when getting single transformer from templates TransformerFactory factory = TransformerFactory.newInstance(); logger.logMsg(Logger.STATUSMSG, "About to newTemplates(Bugzilla5609.xsl)"); Templates templates = factory.newTemplates(new StreamSource(new File("Bugzilla5609.xsl"))); logger.logMsg(Logger.STATUSMSG, "About to Templates.newTransformer()"); Transformer transformer = templates.newTransformer(); logger.logMsg(Logger.STATUSMSG, "About to transform#1 Bugzilla5609.xml into .out"); transformer.transform(new StreamSource(new File("Bugzilla5609.xml")), new StreamResult(new File("Bugzilla5609.out"))); fileChecker.check(logger, new File("Bugzilla5609.out"), new File("Bugzilla5609.gold"), "transform#1 into Bugzilla5609.out"); logger.logMsg(Logger.STATUSMSG, "About to transform#2 Bugzilla5609a.xml into .out"); transformer.transform(new StreamSource(new File("Bugzilla5609a.xml")), new StreamResult(new File("Bugzilla5609a.out"))); fileChecker.check(logger, new File("Bugzilla5609a.out"), new File("Bugzilla5609a.gold"), "transform#2 into Bugzilla5609a.out; but is wrong var num is used"); } catch (Throwable t) { logger.logThrowable(Logger.WARNINGMSG, t, "Bugzilla#5609 threw"); logger.checkErr("Bugzilla#5609 threw " + t.toString()); } } /** * * Link to Bugzilla report * @return Global Variable Initialization across Multiple Transformations. */ public String getDescription() { return "Global Variable Initialization across Multiple Transformations"; } } // end of class Bugzilla5609 1.1 xml-xalan/test/tests/bugzilla/Bugzilla5609.xml Index: Bugzilla5609.xml =================================================================== 9115 1.1 xml-xalan/test/tests/bugzilla/Bugzilla5609.xsl Index: Bugzilla5609.xsl =================================================================== Hello World 1.1 xml-xalan/test/tests/bugzilla/Bugzilla5609a.xml Index: Bugzilla5609a.xml =================================================================== 9111 --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org