Search in sources :

Example 11 with ListedHashTree

use of org.apache.jorphan.collections.ListedHashTree in project jmeter by apache.

the class StandardJMeterEngine method startThreadGroup.

private void startThreadGroup(AbstractThreadGroup group, int groupCount, SearchByClass<?> searcher, List<?> testLevelElements, ListenerNotifier notifier) {
    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) {
        // NOSONAR Reported by log
        JMeterUtils.reportErrorToUser("Error occurred starting thread group :" + group.getName() + ", error message:" + ex.getMessage() + ", \r\nsee log file for more details", ex);
        // no point continuing
        return;
    }
}
Also used : ListedHashTree(org.apache.jorphan.collections.ListedHashTree) JMeterStopTestException(org.apache.jorphan.util.JMeterStopTestException)

Aggregations

ListedHashTree (org.apache.jorphan.collections.ListedHashTree)11 HashTree (org.apache.jorphan.collections.HashTree)5 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)4 Test (org.junit.Test)4 IOException (java.io.IOException)2 Arguments (org.apache.jmeter.config.Arguments)2 GenericController (org.apache.jmeter.control.GenericController)2 TreeCloner (org.apache.jmeter.engine.TreeCloner)2 IllegalUserActionException (org.apache.jmeter.exceptions.IllegalUserActionException)2 GuiPackage (org.apache.jmeter.gui.GuiPackage)2 TestPlan (org.apache.jmeter.testelement.TestPlan)2 ThreadGroup (org.apache.jmeter.threads.ThreadGroup)2 ActionEvent (java.awt.event.ActionEvent)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 JFileChooser (javax.swing.JFileChooser)1 HttpHost (org.apache.http.HttpHost)1 HttpGet (org.apache.http.client.methods.HttpGet)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1