Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 98834 invoked by uid 500); 19 Jun 2001 15:10:35 -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 98386 invoked by uid 1033); 19 Jun 2001 15:10:23 -0000 Date: 19 Jun 2001 15:10:23 -0000 Message-ID: <20010619151023.98357.qmail@apache.org> From: curcuru@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/test/java/src/org/apache/qetest/trax SystemIdImpInclTest.java curcuru 01/06/19 08:10:22 Modified: test/java/src/org/apache/qetest/trax SystemIdImpInclTest.java Log: Update testCase4 to properly check if the http: URL that is imported actually does exist before executing test; this could have caused spurious fails before if you didn't have http access (Now it simply skips the http tests if it can't find them) Revision Changes Path 1.6 +24 -2 xml-xalan/test/java/src/org/apache/qetest/trax/SystemIdImpInclTest.java Index: SystemIdImpInclTest.java =================================================================== RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/SystemIdImpInclTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SystemIdImpInclTest.java 2001/03/22 19:57:08 1.5 +++ SystemIdImpInclTest.java 2001/06/19 15:10:17 1.6 @@ -107,7 +107,7 @@ * (which will require network resources available). * * @author shane_curcuru@lotus.com - * @version $Id: SystemIdImpInclTest.java,v 1.5 2001/03/22 19:57:08 curcuru Exp $ + * @version $Id: SystemIdImpInclTest.java,v 1.6 2001/06/19 15:10:17 curcuru Exp $ */ public class SystemIdImpInclTest extends XSLProcessorTestBase { @@ -723,11 +723,33 @@ // IOException if anything goes wrong urlConnection.connect(); // Convenience: log out when the doc was last modified - reporter.logStatusMsg(testURL.toString() + " last modified: " + reporter.logInfoMsg(testURL.toString() + " last modified: " + urlConnection.getLastModified()); + int contentLen = urlConnection.getContentLength(); + reporter.logStatusMsg("URL.getContentLength() was: " + contentLen); + if (contentLen < 1) + { + // if no content, throw 'fake' exception to + // short-circut test case + throw new IOException("URL.getContentLength() was: " + contentLen); + } + // Also verify that the file there contains (some of) the data we expect! + reporter.logTraceMsg("calling urlConnection.getContent()..."); + Object content = urlConnection.getContent(); + if (null == content) + { + // if no content, throw 'fake' exception to + // short-circut test case + throw new IOException("URL.getContent() was null!"); + } + reporter.logTraceMsg("getContent().toString() is now: " + content.toString()); + + //@todo we should also verify some key strings in the + // expected .xsl file here, if possible } catch (IOException ioe) { + reporter.logThrowable(Logger.ERRORMSG, ioe, "Can't connect threw"); reporter.logErrorMsg("Can't connect to: " + httpSystemIdBase + "/impincl/SystemIdInclude.xsl, skipping testcase"); reporter.checkPass("FAKE PASS RECORD; testCase was skipped"); --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org