curcuru 01/01/29 13:24:31
Modified: test/java/src/org/apache/qetest/trax/sax
TemplatesHandlerAPITest.java
Log:
Update expected exception checking to Pass with Crimson messages
Revision Changes Path
1.2 +15 -11
xml-xalan/test/java/src/org/apache/qetest/trax/sax/TemplatesHandlerAPITest.java
Index: TemplatesHandlerAPITest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/sax/TemplatesHandlerAPITest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TemplatesHandlerAPITest.java 2001/01/17 19:53:19 1.1
+++ TemplatesHandlerAPITest.java 2001/01/29 21:24:30 1.2
@@ -75,6 +75,7 @@
// Needed SAX, DOM, JAXP classes
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.ext.DeclHandler;
@@ -98,7 +99,7 @@
/**
* API Coverage test for the TemplatesHandler class of TRAX.
* @author [EMAIL PROTECTED]
- * @version $Id: TemplatesHandlerAPITest.java,v 1.1 2001/01/17 19:53:19
curcuru Exp $
+ * @version $Id: TemplatesHandlerAPITest.java,v 1.2 2001/01/29 21:24:30
curcuru Exp $
*/
public class TemplatesHandlerAPITest extends XSLProcessorTestBase
{
@@ -358,18 +359,21 @@
reporter.checkFail("No exception when expected: parsing
stylesheet with bad systemId");
}
- catch (SAXParseException spe)
- {
- // We're expecting this exception: validate it's text
- // Note: 'impincl/SimpleImport.xsl' comes from the stylesheet
itself
- reporter.check(spe.getMessage(), "File \"" + NONSENSE_SYSTEMID +
"impincl/SimpleImport.xsl\" not found.",
- "Expected SAXParseException has proper message
for bad systemId");
- reporter.logThrowable(reporter.STATUSMSG, spe,"Expected
SAXParseException");
- }
catch (Throwable t)
{
- reporter.checkFail("Problem TemplatesHandler(3)");
- reporter.logThrowable(reporter.ERRORMSG, t,"Problem
TemplatesHandler(3)");
+ String msg = t.toString();
+ if (msg != null)
+ {
+ // Note: 'impincl/SimpleImport.xsl' comes from the
stylesheet itself,
+ // so to reduce dependencies, only validate that portion of
the msg
+ reporter.check((msg.indexOf("impincl/SimpleImport.xsl") >
0), true,
+ "Expected Exception has proper message for
bad systemId");
+ }
+ else
+ {
+ reporter.checkFail("Expected Exception has proper message
for bad systemId");
+ }
+ reporter.logThrowable(reporter.STATUSMSG, t,"(potentially)
Expected Exception");
}
finally
{