Package org.apache.jmeter.testelement

Examples of org.apache.jmeter.testelement.TestElement


    /**
     * Adds the specified class to the current node of the tree.
     */
    public void doAction(ActionEvent e) {
        try {
            TestElement node = ReportGuiPackage.getInstance()
                    .createTestElement(((JComponent) e.getSource()).getName());
            addObjectToTree(node);
        } catch (Exception err) {
            log.error("", err);
        }
View Full Code Here


        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode node = new ReportTreeNode(el, guiPackage.getTreeModel());
        guiPackage.getTreeModel().insertNodeInto(node,
                guiPackage.getTreeListener().getCurrentNode(),
                guiPackage.getTreeListener().getCurrentNode().getChildCount());
        TestElement curNode =
            (TestElement)guiPackage.getTreeListener().getCurrentNode().getUserObject();
        if (curNode != null) {
            curNode.addTestElement(el);
            guiPackage.getMainFrame().getTree().setSelectionPath(
                    new TreePath(node.getPath()));
        }
    }
View Full Code Here

     */
    public HashTree addSubTree(HashTree subTree, ReportTreeNode current)
            throws IllegalUserActionException {
        Iterator<Object> iter = subTree.list().iterator();
        while (iter.hasNext()) {
            TestElement item = (TestElement) iter.next();
            if (item instanceof ReportPlan) {
                current = (ReportTreeNode) ((ReportTreeNode) getRoot())
                        .getChildAt(0);
                ((TestElement) current.getUserObject()).addTestElement(item);
                ((ReportPlan) current.getUserObject()).setName(item.getName());
                addSubTree(subTree.getTree(item), current);
            } else {
                if (subTree.getTree(item) != null) {
                    addSubTree(subTree.getTree(item), addComponent(item, current));
                }
View Full Code Here

        super.removeNodeFromParent((ReportTreeNode) getChild(getRoot(), 0));
        initTree();
    }

    private void initTree() {
        TestElement rp = new ReportGui().createTestElement();
        this.insertNodeInto(new ReportTreeNode(rp, this),
                (ReportTreeNode) getRoot(), 0);
    }
View Full Code Here

        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode[] draggedNodes = guiPackage.getTreeListener().getDraggedNodes();
        ReportTreeListener treeListener = guiPackage.getTreeListener();
        ReportTreeNode currentNode = treeListener.getCurrentNode();
        ReportTreeNode parentNode = (ReportTreeNode) currentNode.getParent();
        TestElement te = currentNode.getTestElement();
        if (te instanceof TestPlan || te instanceof WorkBench) {
            parentNode = null; // So elements can only be added as children
        }
        // System.out.println(action+" "+te.getClass().getName());
View Full Code Here

     */
    static boolean canAddTo(ReportTreeNode parentNode) {
        if (null == parentNode) {
            return false;
        }
        TestElement te = parentNode.getTestElement();
        // System.out.println("Add to: "+te.getClass().getName());
        if (te instanceof Controller) {
            return true;
        }
        if (te instanceof Sampler) {
View Full Code Here

            RandomOrderController roc = new RandomOrderController();
            roc.addTestElement(new TestSampler("zero"));
            roc.addTestElement(new TestSampler("one"));
            roc.addTestElement(new TestSampler("two"));
            roc.addTestElement(new TestSampler("three"));
            TestElement sampler = null;
            List<String> usedSamplers = new ArrayList<String>();
            roc.initialize();
            while ((sampler = roc.next()) != null) {
                String samplerName = sampler.getName();
                if (usedSamplers.contains(samplerName)) {
                    assertTrue("Duplicate sampler returned from next()", false);
                }
                usedSamplers.add(samplerName);
            }
View Full Code Here

        }

        public void testRandomOrderOneElement() {
            RandomOrderController roc = new RandomOrderController();
            roc.addTestElement(new TestSampler("zero"));
            TestElement sampler = null;
            List<String> usedSamplers = new ArrayList<String>();
            roc.initialize();
            while ((sampler = roc.next()) != null) {
                String samplerName = sampler.getName();
                if (usedSamplers.contains(samplerName)) {
                    assertTrue("Duplicate sampler returned from next()", false);
                }
                usedSamplers.add(samplerName);
            }
View Full Code Here

    private void convertSubTree(HashTree tree) {
        Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
        while (iter.hasNext()) {
            ReportTreeNode item = (ReportTreeNode) iter.next();
            convertSubTree(tree.getTree(item));
            TestElement testElement = item.getTestElement();
            tree.replace(item, testElement);
        }
    }
View Full Code Here

        guiPackage.getTreeListener().getJTree().setSelectionPath(newTreePath);
        guiPackage.updateCurrentGui();
    }

    public static void removeNode(ReportTreeNode node) {
        TestElement testElement = node.getTestElement();
        if (testElement.canRemove()) {
            ReportGuiPackage.getInstance().getTreeModel().removeNodeFromParent(
                    node);
            ReportGuiPackage.getInstance().removeNode(testElement);
        } else {
            String message = testElement.getClass().getName() + " is busy";
            JOptionPane.showMessageDialog(null, message, "Cannot remove item",
                    JOptionPane.ERROR_MESSAGE);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.testelement.TestElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.