You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/01/03 02:41:49 UTC

cvs commit: xml-xalan/test/java/src/org/apache/qetest/trax/dom DOMSourceAPITest.java

sboag       01/01/02 17:41:49

  Modified:    test/java/src/org/apache/qetest/trax/dom
                        DOMSourceAPITest.java
  Log:
  Added close of stream before the compare is done.  This may or
  may not make a difference, but streams should be closed before
  the file they're writing to is accessed.
  Also, left in hack that adds the gold, xsl, and input file to the logging.
  Shane can replace this with something more formal.
  As of the Xalan checkins today, all DOMSourceAPITest tests should pass.
  
  Revision  Changes    Path
  1.7       +7 -3      xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMSourceAPITest.java
  
  Index: DOMSourceAPITest.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMSourceAPITest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMSourceAPITest.java	2000/12/19 15:01:43	1.6
  +++ DOMSourceAPITest.java	2001/01/03 01:41:49	1.7
  @@ -88,7 +88,7 @@
   /**
    * API Coverage test for the DOMSource class of TRAX.
    * @author shane_curcuru@lotus.com
  - * @version $Id: DOMSourceAPITest.java,v 1.6 2000/12/19 15:01:43 curcuru Exp $
  + * @version $Id: DOMSourceAPITest.java,v 1.7 2001/01/03 01:41:49 sboag Exp $
    */
   public class DOMSourceAPITest extends XSLProcessorTestBase
   {
  @@ -518,14 +518,18 @@
               {
                   // Use identity transformer to serialize
                   Transformer identityTransformer = factory.newTransformer();
  -                StreamResult streamResult = new StreamResult(new FileOutputStream(outNames.nextName()));
  +                String outName = outNames.nextName();
  +                FileOutputStream fos = new FileOutputStream(outName);
  +                StreamResult streamResult = new StreamResult(fos);
                   DOMSource nodeSource = new DOMSource(dom);
                   reporter.logTraceMsg("serializeDOMAndCheck() into " + outNames.currentName());
                   identityTransformer.transform(nodeSource, streamResult);
  +                fos.close();
                   fileChecker.check(reporter, 
                                     new File(outNames.currentName()), 
                                     new File(goldFileName), 
  -                                  comment + " into " + outNames.currentName());
  +                                  comment + " into " + outNames.currentName()+" gold is "+
  +                                  goldFileName+" xsl is identity transform");
                   return true;    // Note: should check return from fileChecker.check!
               }
               else