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/29 14:54:01 UTC
cvs commit: xml-xalan/test/java/src/org/apache/qetest/trax Minitest.java
sboag 01/01/29 05:54:01
Modified: test/java/src/org/apache/qetest/trax Minitest.java
Log:
Fixed problem with tests not closing streams before doing comparisons.
Revision Changes Path
1.2 +13 -7 xml-xalan/test/java/src/org/apache/qetest/trax/Minitest.java
Index: Minitest.java
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/Minitest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Minitest.java 2000/12/07 20:44:29 1.1
+++ Minitest.java 2001/01/29 13:54:00 1.2
@@ -100,7 +100,7 @@
* break or fail the minitest, then <b>please</b> be sure to send
* email to xalan-dev letting everyone know.</p>
* @author shane_curcuru@lotus.com
- * @version $Id: Minitest.java,v 1.1 2000/12/07 20:44:29 curcuru Exp $
+ * @version $Id: Minitest.java,v 1.2 2001/01/29 13:54:00 sboag Exp $
*/
public class Minitest extends XSLProcessorTestBase
{
@@ -265,8 +265,10 @@
+ filenameToURI(testFileInfo.inputName) + ", "
+ outNames.nextName());
transformer = templates.newTransformer();
+ FileOutputStream fos = new FileOutputStream(outNames.currentName());
transformer.transform(new StreamSource(filenameToURI(testFileInfo.xmlName)),
- new StreamResult(new FileOutputStream(outNames.currentName())));
+ new StreamResult(fos));
+ fos.close();
int fileCheckStatus = fileChecker.check(reporter,
new File(outNames.currentName()),
new File(testFileInfo.goldName),
@@ -281,8 +283,10 @@
reporter.logTraceMsg("Basic stream transform(2)(" + filenameToURI(testFileInfo.xmlName) + ", "
+ filenameToURI(testFileInfo.inputName) + ", "
+ outNames.nextName());
+ fos = new FileOutputStream(outNames.currentName());
transformer.transform(new StreamSource(filenameToURI(testFileInfo.xmlName)),
- new StreamResult(new FileOutputStream(outNames.currentName())));
+ new StreamResult(fos));
+ fos.close();
fileCheckStatus = fileChecker.check(reporter,
new File(outNames.currentName()),
new File(testFileInfo.goldName),
@@ -352,8 +356,10 @@
reporter.logTraceMsg("Stream-param transform(" + filenameToURI(paramFileInfo.xmlName) + ", "
+ filenameToURI(paramFileInfo.inputName) + ", "
+ outNames.nextName());
+ FileOutputStream fos = new FileOutputStream(outNames.currentName());
paramTransformer.transform(new StreamSource(filenameToURI(paramFileInfo.xmlName)),
- new StreamResult(new FileOutputStream(outNames.currentName())));
+ new StreamResult(fos));
+ fos.close();
int fileCheckStatus = fileChecker.check(reporter,
new File(outNames.currentName()),
new File(paramFileInfo.goldName),
@@ -467,9 +473,9 @@
{
File f = new File(filename);
String tmp = f.getAbsolutePath();
- if (File.separatorChar == '\\') {
- tmp = tmp.replace('\\', '/');
- }
+ if (File.separatorChar == '\\') {
+ tmp = tmp.replace('\\', '/');
+ }
return "file:///" + tmp;
}