jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1769218 - /jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
Date Thu, 10 Nov 2016 22:33:31 GMT
Author: pmouawad
Date: Thu Nov 10 22:33:31 2016
New Revision: 1769218

URL: http://svn.apache.org/viewvc?rev=1769218&view=rev
Log:
Bug 60361 - ModuleController : If a Test plan contains a Module Controller which references
an unexistant Controller, JMeter in GUI mode will not stop
Bugzilla Id: 60361

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java?rev=1769218&r1=1769217&r2=1769218&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java Thu Nov 10 22:33:31
2016
@@ -45,6 +45,7 @@ import org.apache.jorphan.collections.Ha
 import org.apache.jorphan.collections.ListedHashTree;
 import org.apache.jorphan.collections.SearchByClass;
 import org.apache.jorphan.logging.LoggingManager;
+import org.apache.jorphan.util.JMeterStopTestException;
 import org.apache.log.Logger;
 
 /**
@@ -454,31 +455,36 @@ public class StandardJMeterEngine implem
     
     private void startThreadGroup(AbstractThreadGroup group, int groupCount, SearchByClass<?>
searcher, List<?> testLevelElements, ListenerNotifier notifier)
     {
-        int numThreads = group.getNumThreads();
-        JMeterContextService.addTotalThreads(numThreads);
-        boolean onErrorStopTest = group.getOnErrorStopTest();
-        boolean onErrorStopTestNow = group.getOnErrorStopTestNow();
-        boolean onErrorStopThread = group.getOnErrorStopThread();
-        boolean onErrorStartNextLoop = group.getOnErrorStartNextLoop();
-        String groupName = group.getName();
-        log.info("Starting " + numThreads + " threads for group " + groupName + ".");
-
-        if (onErrorStopTest) {
-            log.info("Test will stop on error");
-        } else if (onErrorStopTestNow) {
-            log.info("Test will stop abruptly on error");
-        } else if (onErrorStopThread) {
-            log.info("Thread will stop on error");
-        } else if (onErrorStartNextLoop) {
-            log.info("Thread will start next loop on error");
-        } else {
-            log.info("Thread will continue on error");
+        try {
+            int numThreads = group.getNumThreads();
+            JMeterContextService.addTotalThreads(numThreads);
+            boolean onErrorStopTest = group.getOnErrorStopTest();
+            boolean onErrorStopTestNow = group.getOnErrorStopTestNow();
+            boolean onErrorStopThread = group.getOnErrorStopThread();
+            boolean onErrorStartNextLoop = group.getOnErrorStartNextLoop();
+            String groupName = group.getName();
+            log.info("Starting " + numThreads + " threads for group " + groupName + ".");
+    
+            if (onErrorStopTest) {
+                log.info("Test will stop on error");
+            } else if (onErrorStopTestNow) {
+                log.info("Test will stop abruptly on error");
+            } else if (onErrorStopThread) {
+                log.info("Thread will stop on error");
+            } else if (onErrorStartNextLoop) {
+                log.info("Thread will start next loop on error");
+            } else {
+                log.info("Thread will continue on error");
+            }
+            ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
+            threadGroupTree.add(group, testLevelElements);
+    
+            groups.add(group);
+            group.start(groupCount, notifier, threadGroupTree, this);
+        } catch (JMeterStopTestException ex) {
+            JMeterUtils.reportErrorToUser("Error occurred compiling the tree:\r\n "+ex.getMessage()+",
\r\nsee log file for more details");
+            return; // no point continuing
         }
-        ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
-        threadGroupTree.add(group, testLevelElements);
-
-        groups.add(group);
-        group.start(groupCount, notifier, threadGroupTree, this);
     }
 
     /**



Mime
View raw message