use of org.apache.jmeter.engine.JMeterEngineException in project jmeter by apache.
the class Start method startEngine.
/**
* Start JMeter engine
* @param ignoreTimer flag to ignore timers
* @param isValidationShot
* @param threadGroupsToRun Array of AbstractThreadGroup to run
*/
private void startEngine(boolean ignoreTimer, boolean isValidationShot, AbstractThreadGroup[] threadGroupsToRun) {
GuiPackage gui = GuiPackage.getInstance();
HashTree testTree = gui.getTreeModel().getTestPlan();
JMeter.convertSubTree(testTree);
if (threadGroupsToRun != null && threadGroupsToRun.length > 0) {
removeThreadGroupsFromHashTree(testTree, threadGroupsToRun);
}
testTree.add(testTree.getArray()[0], gui.getMainFrame());
if (log.isDebugEnabled()) {
log.debug("test plan before cloning is running version: {}", ((TestPlan) testTree.getArray()[0]).isRunningVersion());
}
ListedHashTree clonedTree = null;
if (isValidationShot) {
TreeCloner cloner = createTreeClonerForValidation();
testTree.traverse(cloner);
clonedTree = cloner.getClonedTree();
} else {
TreeCloner cloner = cloneTree(testTree, ignoreTimer);
clonedTree = cloner.getClonedTree();
}
if (popupCheckExistingFileListener(testTree)) {
engine = new StandardJMeterEngine();
engine.configure(clonedTree);
try {
engine.runTest();
} catch (JMeterEngineException e) {
JOptionPane.showMessageDialog(gui.getMainFrame(), e.getMessage(), JMeterUtils.getResString("error_occurred"), //$NON-NLS-1$
JOptionPane.ERROR_MESSAGE);
}
if (log.isDebugEnabled()) {
log.debug("test plan after cloning and running test is running version: {}", ((TestPlan) testTree.getArray()[0]).isRunningVersion());
}
}
}
Aggregations