You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@apache.org on 2001/08/14 19:22:08 UTC
cvs commit: xml-xalan/test/java/src/org/apache/qetest Reporter.java
curcuru 01/08/14 10:22:08
Modified: test/java/src/org/apache/qetest Reporter.java
Log:
Use CanonicalPath/AbsolutePath to ensure writeResultsStatus will
work even when using mixed-up directory separators
(i.e. this now works when logFile=foo/bar.xml on Windows)
Revision Changes Path
1.8 +15 -3 xml-xalan/test/java/src/org/apache/qetest/Reporter.java
Index: Reporter.java
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/Reporter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Reporter.java 2001/04/11 20:34:41 1.7
+++ Reporter.java 2001/08/14 17:22:08 1.8
@@ -64,6 +64,7 @@
import java.io.File;
import java.io.FileWriter;
+import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -92,7 +93,7 @@
* @todo explain better how results are rolled up and calculated
* @author Shane_Curcuru@lotus.com
* @author Jo_Grant@lotus.com
- * @version $Id: Reporter.java,v 1.7 2001/04/11 20:34:41 curcuru Exp $
+ * @version $Id: Reporter.java,v 1.8 2001/08/14 17:22:08 curcuru Exp $
*/
public class Reporter implements Logger
{
@@ -1585,8 +1586,18 @@
// harnesses and build environments
// Calculate the name relative to any logfile we have
- String logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, "ResultsSummary.xml"))).getParent();
- File summaryFile = new File("ResultsSummary.xml"); //@todo have better default
+ String logFileBase = null;
+ try
+ {
+ // CanonicalPath gives a better path, especially if
+ // you mix your path separators up
+ logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, "ResultsSummary.xml"))).getCanonicalPath();
+ }
+ catch (IOException ioe)
+ {
+ logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, "ResultsSummary.xml"))).getAbsolutePath();
+ }
+ logFileBase = (new File(logFileBase)).getParent();
File[] summaryFiles =
{
// Note array is ordered; should be re-designed so this doesn't matter
@@ -1609,6 +1620,7 @@
summaryFiles[i].delete();
}
+ File summaryFile = null;
switch (getCurrentFileResult())
{
case INCP_RESULT:
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org