curcuru 00/12/18 13:37:37
Modified: test/java/src/org/apache/qetest/trax/dom
DOMResultAPITest.java
Log:
Update to new spec'd behavior for re-used DOMResult
Revision Changes Path
1.4 +8 -11
xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMResultAPITest.java
Index: DOMResultAPITest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMResultAPITest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMResultAPITest.java 2000/12/12 21:36:31 1.3
+++ DOMResultAPITest.java 2000/12/18 21:37:37 1.4
@@ -88,7 +88,7 @@
/**
* API Coverage test for the DOMResult class of TRAX.
* @author [EMAIL PROTECTED]
- * @version $Id: DOMResultAPITest.java,v 1.3 2000/12/12 21:36:31 curcuru Exp
$
+ * @version $Id: DOMResultAPITest.java,v 1.4 2000/12/18 21:37:37 curcuru Exp
$
*/
public class DOMResultAPITest extends XSLProcessorTestBase
{
@@ -292,6 +292,7 @@
reporter.logThrowable(reporter.ERRORMSG, t,
"Problem with blank results");
}
+ boolean reusePass = false;
try
{
DOMSource xmlSource = new DOMSource(xmlNode);
@@ -306,22 +307,18 @@
serializeDOMAndCheck(reuseNode, testFileInfo.goldName,
"transform into reuseable1 DOMResult");
// Get a new transformer just to avoid extra complexity
- reporter.logTraceMsg("About to re-use DOMResult from previous
transform as-is");
+ reporter.logTraceMsg("About to re-use DOMResult from previous
transform, should throw");
transformer = templates.newTransformer();
+ reusePass = true; // Next line should throw an exception
transformer.transform(xmlSource, reuseResult); // SPR SCUU4RJKG4
throws DOM006
- reuseNode = reuseResult.getNode();
- serializeDOMAndCheck(reuseNode, testFileInfo.goldName,
"transform into reused1 DOMResult");
-
- // Reuse again, with the same transformer
- transformer.transform(xmlSource, reuseResult);
- reuseNode = reuseResult.getNode();
- serializeDOMAndCheck(reuseNode, testFileInfo.goldName,
"transform into reused1 DOMResult again");
+ reporter.checkFail("Re-using DOMResult should have thrown
exception", "SCUU4RJKG4");
}
catch (Throwable t)
{
- reporter.checkFail("Problem with re-using results(1)",
"SCUU4RJKG4");
+ reporter.check(reusePass, true, "Re-using DOMResult throws
exception properly");
reporter.logThrowable(reporter.ERRORMSG, t,
- "Problem with re-using results(1)");
+ "Re-using DOMResult throws exception
properly");
+ reporter.logTraceMsg("@todo Should validate specific kind of
error above");
}
try
{