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/04/24 22:04:03 UTC
cvs commit: xml-xalan/test/tests/bugzilla Bugzilla1283.java error.xml
curcuru 01/04/24 13:04:03
Added: test/tests/bugzilla Bugzilla1283.java error.xml
Log:
Reproduction of Bugzilla1283; Note this does currently hang, so don't run it under automation!
Revision Changes Path
1.1 xml-xalan/test/tests/bugzilla/Bugzilla1283.java
Index: Bugzilla1283.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;
import org.apache.qetest.trax.LoggingErrorListener;
// REPLACE_imports needed for reproducing the bug
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
import java.io.File;
/**
* Testlet for reproducing Bugzilla reported bugs.
*
* @author Antti.Valtokari@iocore.fi
* @author shane_curcuru@lotus.com
*/
public class Bugzilla1283 extends TestletImpl
{
// Initialize our classname for TestletImpl's main() method - must be updated!
static { thisClassName = "Bugzilla1283"; }
/**
* Write Minimal code to reproduce your Bugzilla bug report.
*/
public void execute(Datalet d)
{
logger.logMsg(Logger.STATUSMSG, "Reproducing Bugzilla#1283 Xalan hangs if javax.xml.transform.TransformerException thrown when invoked through JAXP");
logger.logMsg(Logger.CRITICALMSG, "WARNING! THIS TEST MAY HANG! (i.e. don't run in automation)");
try
{
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Source transformerSource = new StreamSource(new File("identity.xsl"));
Transformer transformer =
transformerFactory.newTransformer(transformerSource);
// Use nifty utility from testxsl.jar
LoggingErrorListener loggingErrorListener = new LoggingErrorListener(logger);
transformer.setErrorListener(loggingErrorListener); // default is to throw when fatalError
Source input = new StreamSource(new File("error.xml"));
Result output = new StreamResult(new File("Bugzilla1283.out"));
logger.logMsg(Logger.STATUSMSG, "About to transform error.xml into Bugzilla1283.out");
transformer.transform(input, output);
logger.checkFail("Transform should have had fatalError which threw Exception");
}
catch (Exception e)
{
logger.checkPass("Transform properly had fatalError and threw: " + e.toString());
logger.logThrowable(Logger.ERRORMSG, e, "Transform properly had fatalError and threw");
}
logger.checkAmbiguous("Bug occours now: system hangs");
}
/**
* <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1283">
* Link to Bugzilla report</a>
* @return Xalan hangs if javax.xml.transform.TransformerException thrown when invoked through JAXP.
*/
public String getDescription()
{
return "Xalan hangs if javax.xml.transform.TransformerException thrown when invoked through JAXP";
}
} // end of class Bugzilla1283
1.1 xml-xalan/test/tests/bugzilla/error.xml
Index: error.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<title name="title-name-attr">title-content</title>
<list>
<item version="1">Xalan-J 1.x</item>
<item version="2">Xalan-J 2.x</item>
<item version="1">Xalan-C 1.x</item>
<list-bad-tag>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
</doc>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org