use of org.apache.jmeter.testelement.TestPlan in project jmeter by apache.
the class StandardJMeterEngine method configure.
// End of code to allow engine to be controlled remotely
@Override
public void configure(HashTree testTree) {
// Is testplan serialised?
SearchByClass<TestPlan> testPlan = new SearchByClass<>(TestPlan.class);
testTree.traverse(testPlan);
Object[] plan = testPlan.getSearchResults().toArray();
if (plan.length == 0) {
throw new RuntimeException("Could not find the TestPlan class!");
}
TestPlan tp = (TestPlan) plan[0];
serialized = tp.isSerialized();
tearDownOnShutdown = tp.isTearDownOnShutdown();
active = true;
test = testTree;
}
use of org.apache.jmeter.testelement.TestPlan in project jmeter by apache.
the class TestPlanGui method createTestElement.
/* Implements JMeterGUIComponent.createTestElement() */
@Override
public TestElement createTestElement() {
TestPlan tp = new TestPlan();
modifyTestElement(tp);
return tp;
}
use of org.apache.jmeter.testelement.TestPlan in project jmeter by apache.
the class TestPlanGui method modifyTestElement.
/* Implements JMeterGUIComponent.modifyTestElement(TestElement) */
@Override
public void modifyTestElement(TestElement plan) {
super.configureTestElement(plan);
if (plan instanceof TestPlan) {
TestPlan tp = (TestPlan) plan;
tp.setFunctionalMode(functionalMode.isSelected());
tp.setTearDownOnShutdown(tearDownOnShutdown.isSelected());
tp.setSerialized(serializedMode.isSelected());
tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
tp.setTestPlanClasspathArray(browseJar.getFiles());
}
}
Aggregations