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 [EMAIL PROTECTED]
    * @author [EMAIL PROTECTED]
  - * @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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to