Search in sources :

Example 6 with WorkBench

use of org.apache.jmeter.testelement.WorkBench in project jmeter by apache.

the class ProxyControlGui method buildNodesModel.

private void buildNodesModel(JMeterTreeNode node, String parentName, int level) {
    String separator = " > ";
    if (node != null) {
        for (int i = 0; i < node.getChildCount(); i++) {
            StringBuilder name = new StringBuilder();
            JMeterTreeNode cur = (JMeterTreeNode) node.getChildAt(i);
            TestElement te = cur.getTestElement();
            /*
                 * Will never be true. Probably intended to use
                 * org.apache.jmeter.threads.ThreadGroup rather than
                 * java.lang.ThreadGroup However, that does not work correctly;
                 * whereas treating it as a Controller does. if (te instanceof
                 * ThreadGroup) { name.append(parent_name);
                 * name.append(cur.getName()); name.append(separator);
                 * buildNodesModel(cur, name.toString(), level); } else
                 */
            if (te instanceof Controller) {
                name.append(parentName);
                name.append(cur.getName());
                TreeNodeWrapper tnw = new TreeNodeWrapper(cur, name.toString());
                targetNodesModel.addElement(tnw);
                name.append(separator);
                buildNodesModel(cur, name.toString(), level + 1);
            } else if (te instanceof TestPlan || te instanceof WorkBench) {
                name.append(cur.getName());
                name.append(separator);
                buildNodesModel(cur, name.toString(), 0);
            }
        // Ignore everything else
        }
    }
}
Also used : TestPlan(org.apache.jmeter.testelement.TestPlan) TreeNodeWrapper(org.apache.jmeter.control.gui.TreeNodeWrapper) JMeterTreeNode(org.apache.jmeter.gui.tree.JMeterTreeNode) TestElement(org.apache.jmeter.testelement.TestElement) Controller(org.apache.jmeter.control.Controller) RecordingController(org.apache.jmeter.protocol.http.control.RecordingController) WorkBench(org.apache.jmeter.testelement.WorkBench)

Example 7 with WorkBench

use of org.apache.jmeter.testelement.WorkBench in project jmeter by apache.

the class NamePanel method createTestElement.

/** {@inheritDoc} */
@Override
public TestElement createTestElement() {
    WorkBench wb = new WorkBench();
    modifyTestElement(wb);
    return wb;
}
Also used : WorkBench(org.apache.jmeter.testelement.WorkBench)

Aggregations

WorkBench (org.apache.jmeter.testelement.WorkBench)7 TestElement (org.apache.jmeter.testelement.TestElement)4 TestPlan (org.apache.jmeter.testelement.TestPlan)4 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)3 ActionEvent (java.awt.event.ActionEvent)1 JTree (javax.swing.JTree)1 TreePath (javax.swing.tree.TreePath)1 Controller (org.apache.jmeter.control.Controller)1 TreeNodeWrapper (org.apache.jmeter.control.gui.TreeNodeWrapper)1 IllegalUserActionException (org.apache.jmeter.exceptions.IllegalUserActionException)1 GuiPackage (org.apache.jmeter.gui.GuiPackage)1 RecordingController (org.apache.jmeter.protocol.http.control.RecordingController)1 HashTree (org.apache.jorphan.collections.HashTree)1