jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1820112 - in /jmeter/trunk: src/core/org/apache/jmeter/JMeter.java xdocs/changes.xml
Date Thu, 04 Jan 2018 16:04:49 GMT
Author: pmouawad
Date: Thu Jan  4 16:04:48 2018
New Revision: 1820112

URL: http://svn.apache.org/viewvc?rev=1820112&view=rev
Log:
Bug 61956 - Report Generation : -f of -forceDeleteResultFile option does not work
Bugzilla Id: 61956

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java?rev=1820112&r1=1820111&r2=1820112&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/JMeter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/JMeter.java Thu Jan  4 16:04:48 2018
@@ -943,6 +943,26 @@ public class JMeter implements JMeterPlu
             // For GUI runs this is done in Start.java
             convertSubTree(tree);
             
+            Summariser summariser = null;
+            String summariserName = JMeterUtils.getPropDefault("summariser.name", "");//$NON-NLS-1$
+            if (summariserName.length() > 0) {
+                log.info("Creating summariser <{}>", summariserName);
+                println("Creating summariser <" + summariserName + ">");
+                summariser = new Summariser(summariserName);
+            }
+            ResultCollector resultCollector = null;
+            if (logFile != null) {
+                resultCollector = new ResultCollector(summariser);
+                resultCollector.setFilename(logFile);
+                tree.add(tree.getArray()[0], resultCollector);
+            }
+            else {
+                // only add Summariser if it can not be shared with the ResultCollector
+                if (summariser != null) {
+                    tree.add(tree.getArray()[0], summariser);
+                }
+            }
+
             if (deleteResultFile) {
                 SearchByClass<ResultCollector> resultListeners = new SearchByClass<>(ResultCollector.class);
                 tree.traverse(resultListeners);
@@ -950,34 +970,17 @@ public class JMeter implements JMeterPlu
                 while (irc.hasNext()) {
                     ResultCollector rc = irc.next();
                     File resultFile = new File(rc.getFilename());
-                    if (resultFile.exists()) {
-                        resultFile.delete();
+                    if (resultFile.exists() && !resultFile.delete()) {
+                        throw new IllegalStateException("Could not delete results file "
+ resultFile.getAbsolutePath()
+                            + "(canRead:"+resultFile.canRead()+", canWrite:"+resultFile.canWrite()+")");
                     }
                 }
             }
-
-            Summariser summer = null;
-            String summariserName = JMeterUtils.getPropDefault("summariser.name", "");//$NON-NLS-1$
-            if (summariserName.length() > 0) {
-                log.info("Creating summariser <{}>", summariserName);
-                println("Creating summariser <" + summariserName + ">");
-                summer = new Summariser(summariserName);
-            }
             ReportGenerator reportGenerator = null;
-            if (logFile != null) {
-                ResultCollector logger = new ResultCollector(summer);
-                logger.setFilename(logFile);
-                tree.add(tree.getArray()[0], logger);
-                if(generateReportDashboard) {
-                    reportGenerator = new ReportGenerator(logFile, logger);
-                }
-            }
-            else {
-                // only add Summariser if it can not be shared with the ResultCollector
-                if (summer != null) {
-                    tree.add(tree.getArray()[0], summer);
-                }
+            if (logFile != null && generateReportDashboard) {
+                reportGenerator = new ReportGenerator(logFile, resultCollector);
             }
+
             // Used for remote notification of threads start/stop,see BUG 54152
             // Summariser uses this feature to compute correctly number of threads 
             // when NON GUI mode is used

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1820112&r1=1820111&r2=1820112&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Jan  4 16:04:48 2018
@@ -269,6 +269,7 @@ Summary
     <li><bug>61807</bug>Web Report : fix error in <code>getTop5ErrorMetrics</code>.
Contributed by Graham Russell (graham at ham1.co.uk)</li>
     <li><bug>61900</bug>Report Generator : Report generation fails if separator
is a regex reserved char like <code>|</code></li>
     <li><bug>61925</bug>CsvSampleReader does not increment row in nextSample().
Contributed by Graham Russell (graham at ham1.co.uk)</li>
+    <li><bug>61956</bug>Report Generation : <code>-f</code>
of <code>-forceDeleteResultFile</code> option does not work. Contributed by Ubik
Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>General</h3>



Mime
View raw message