Search in sources :

Example 21 with TestPlan

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;
}
Also used : TestPlan(org.apache.jmeter.testelement.TestPlan) SearchByClass(org.apache.jorphan.collections.SearchByClass)

Example 22 with TestPlan

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;
}
Also used : TestPlan(org.apache.jmeter.testelement.TestPlan)

Example 23 with TestPlan

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());
    }
}
Also used : TestPlan(org.apache.jmeter.testelement.TestPlan)

Aggregations

TestPlan (org.apache.jmeter.testelement.TestPlan)23 TestElement (org.apache.jmeter.testelement.TestElement)12 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)7 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)6 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)6 ValueReplacer (org.apache.jmeter.engine.util.ValueReplacer)5 WorkBench (org.apache.jmeter.testelement.WorkBench)4 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)4 StringProperty (org.apache.jmeter.testelement.property.StringProperty)4 Test (org.junit.Test)4 Arguments (org.apache.jmeter.config.Arguments)3 IllegalUserActionException (org.apache.jmeter.exceptions.IllegalUserActionException)3 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Controller (org.apache.jmeter.control.Controller)2 InvalidVariableException (org.apache.jmeter.functions.InvalidVariableException)2 JMeterTreeModel (org.apache.jmeter.gui.tree.JMeterTreeModel)2 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)2 ResultCollector (org.apache.jmeter.reporters.ResultCollector)2