Package org.apache.jmeter.testelement

Examples of org.apache.jmeter.testelement.TestElement


            clonedItem.getClass().getName());
    }

    private static void checkElementCloning(TestElement item)
    {
        TestElement clonedItem = (TestElement) item.clone();
        cloneTesting(item, clonedItem);
        PropertyIterator iter2 = item.propertyIterator();
        while (iter2.hasNext())
        {
            JMeterProperty item2 = iter2.next();
            //[sebb] assertEquals(item2, clonedItem.getProperty(item2.getName()));
            assertEquals(item2.getStringValue(), clonedItem.getProperty(item2.getName()).getStringValue());
            assertTrue(item2 != clonedItem.getProperty(item2.getName()));
        }
    }
View Full Code Here


        stack.addLast(node);
    }

    public void subtractNode()
    {
        TestElement lastNode = (TestElement)stack.removeLast();
        if(!lastNode.getPropertyAsBoolean(TestElement.ENABLED))
        {
            tree.getTree(stack).remove(lastNode);
        }
    }
View Full Code Here

        {
            ValueReplacer replacer = new ValueReplacer(variables);
            assertTrue(
                variables.getUserDefinedVariables().containsKey("server"));
            assertTrue(replacer.variables.containsKey("server"));
            TestElement element = new TestPlan();
            element.setProperty(
                new StringProperty("domain", "jakarta.apache.org"));
            List args = new ArrayList();
            args.add("username is jack");
            args.add("jacks_password");
            element.setProperty(new CollectionProperty("args", args));
            replacer.reverseReplace(element);
            assertEquals("${server}", element.getPropertyAsString("domain"));
            args = (List) element.getProperty("args").getObjectValue();
            assertEquals(
                "${password}",
                ((JMeterProperty) args.get(1)).getStringValue());
        }
View Full Code Here

        public void testReplace() throws Exception
        {
            ValueReplacer replacer = new ValueReplacer();
            replacer.setUserDefinedVariables(
                variables.getUserDefinedVariables());
            TestElement element = new ConfigTestElement();
            element.setProperty(new StringProperty("domain", "${server}"));
            replacer.replaceValues(element);
            log.debug("domain property = " + element.getProperty("domain"));
            element.setRunningVersion(true);
            assertEquals(
                "jakarta.apache.org",
                element.getPropertyAsString("domain"));
        }
View Full Code Here

                    }
                }
                else
                {
                    convertSubTree(tree.getTree(item));
                    TestElement testElement = item.getTestElement();
                    tree.replace(item, testElement);
                }
            }
            else
            {
View Full Code Here

     */
    public void doAction(ActionEvent e)
    {
        try
        {
            TestElement node =
                GuiPackage.getInstance().createTestElement(
                    ((JComponent) e.getSource()).getName());
            addObjectToTree(node);
        }
        catch (Exception err)
View Full Code Here

    public void doAction(ActionEvent e)
    {
        String name = ((Component) e.getSource()).getName();
        try
        {
            TestElement controller =
                (TestElement) GuiPackage.getInstance().createTestElement(name);
            addParentToTree(controller);
        }
        catch (Exception err)
        {
View Full Code Here

    guiPackage.updateCurrentGui();
    }

    public static void removeNode(JMeterTreeNode node)
    {
        TestElement testElement = node.getTestElement();
        if (testElement.canRemove())
        {
            GuiPackage.getInstance().getTreeModel().removeNodeFromParent(node);
        GuiPackage.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

        Iterator iter = new LinkedList(tree.list()).iterator();
        while (iter.hasNext())
        {
            JMeterTreeNode item = (JMeterTreeNode) iter.next();
            convertSubTree(tree.getTree(item));
            TestElement testElement = item.getTestElement();
            tree.replace(item, testElement);
        }
    }
View Full Code Here

        super();
    }

    public TestElement createTestElement()
    {
        TestElement ce = super.createTestElement();

        configureTestElement(ce);
        ce.setProperty(HTTPSampler.MIMETYPE, mimetypeField.getText());
        ce.setProperty(HTTPSampler.FILE_NAME, filenameField.getText());
        ce.setProperty(HTTPSampler.FILE_FIELD, paramNameField.getText());
        return ce;
    }
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.