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/12/14 23:31:18 UTC

cvs commit: xml-xalan/test/java/src/org/apache/qetest Reporter.java

curcuru     01/12/14 14:31:18

  Modified:    test/java/src/org/apache/qetest Reporter.java
  Log:
  Fix possible NPE when there is no OPT_LOGFILE;
  Also put in baseref='user.dir' for stylesheets to construct locations from
  
  Revision  Changes    Path
  1.10      +10 -4     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Reporter.java	2001/11/09 19:44:04	1.9
  +++ Reporter.java	2001/12/14 22:31:18	1.10
  @@ -93,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.9 2001/11/09 19:44:04 curcuru Exp $
  + * @version $Id: Reporter.java,v 1.10 2001/12/14 22:31:18 curcuru Exp $
    */
   public class Reporter implements Logger
   {
  @@ -1566,13 +1566,19 @@
        */
       public void writeResultsStatus(boolean writeFile)
       {
  +        final String DEFAULT_SUMMARY_NAME = "ResultsSummary.xml";
           Hashtable resultsHash = createResultsStatusHash();
           resultsHash.put("desc", testComment);
           resultsHash.put("testName", testName);
           //@todo the actual path in the property below may not necessarily 
           //  either exist or be the correct location vis-a-vis the file
           //  that we're writing out - but it should be close
  -        resultsHash.put(OPT_LOGFILE, reporterProps.getProperty(OPT_LOGFILE));
  +        resultsHash.put(OPT_LOGFILE, reporterProps.getProperty(OPT_LOGFILE, DEFAULT_SUMMARY_NAME));
  +        try
  +        {
  +            resultsHash.put("baseref", System.getProperty("user.dir"));
  +        } 
  +        catch (Exception e) { /* no-op, ignore */ }
   
           String elementName = "teststatus";
           String overallResult = resultToString(getCurrentFileResult());
  @@ -1595,11 +1601,11 @@
           {
               // CanonicalPath gives a better path, especially if 
               //  you mix your path separators up
  -            logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, "ResultsSummary.xml"))).getCanonicalPath();
  +            logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, DEFAULT_SUMMARY_NAME))).getCanonicalPath();
           } 
           catch (IOException ioe)
           {
  -            logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, "ResultsSummary.xml"))).getAbsolutePath();
  +            logFileBase = (new File(reporterProps.getProperty(OPT_LOGFILE, DEFAULT_SUMMARY_NAME))).getAbsolutePath();
           }
           logFileBase = (new File(logFileBase)).getParent();
           final File[] summaryFiles = 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org