Package org.apache.jmeter.config

Examples of org.apache.jmeter.config.Arguments


    /**
     *  Constructor for the JavaConfig object
     */
    public JavaConfig()
    {
        setArguments(new Arguments());
    }
View Full Code Here


     * @param name       the name of the argument to be added
     * @param value      the value of the argument to be added
     */
    public void addArgument(String name, String value)
    {
        Arguments args = this.getArguments();
        args.addArgument(name, value);
    }
View Full Code Here

     * Removes all of the arguments associated with this JavaConfig object.
     */
    public void removeArguments()
    {
        setProperty(
            new TestElementProperty(JavaSampler.ARGUMENTS, new Arguments()));
    }
View Full Code Here

                            className,
                            true,
                            Thread.currentThread().getContextClassLoader()
                        ).newInstance();

                Arguments currArgs = new Arguments();
                argsPanel.modifyTestElement(currArgs);
                Map currArgsMap = currArgs.getArgumentsAsMap();

                Arguments newArgs = new Arguments();
                Arguments testParams = null;
                try
                {
                    testParams = client.getDefaultParameters();
                }
                catch (AbstractMethodError e)
                {
                    log.warn ("JavaSamplerClient doesn't implement "
                            + "getDefaultParameters.  Default parameters won't "
                            + "be shown.  Please update your client class: "
                            + className);
                }
               
                if (testParams != null)
                {
                    PropertyIterator i = testParams.getArguments().iterator();
                    while (i.hasNext())
                    {
                        Argument arg = (Argument) i.next().getObjectValue();
                        String name = arg.getName();
                        String value = arg.getValue();
View Full Code Here

    public void stateChanged(ChangeEvent event)
    {
        try
        {
            Arguments args = new Arguments();
            Function function =
                (Function) ((Class) functionMap.get(functionList.getText()))
                    .newInstance();
            List argumentDesc = function.getArgumentDesc();
            Iterator iter = argumentDesc.iterator();
            while (iter.hasNext())
            {
                String help = (String) iter.next();
                args.addArgument(help, "");
            }
            parameterPanel.configure(args);
            parameterPanel.revalidate();
            getContentPane().remove(parameterPanel);
            this.pack();
View Full Code Here

    public void actionPerformed(ActionEvent e)
    {
        StringBuffer functionCall = new StringBuffer("${");
        functionCall.append(functionList.getText());
        Arguments args = (Arguments) parameterPanel.createTestElement();
        if (args.getArguments().size() > 0)
        {
            functionCall.append("(");
            PropertyIterator iter = args.iterator();
            boolean first = true;
            while (iter.hasNext())
            {
                Argument arg = (Argument) iter.next().getObjectValue();
                if (!first)
View Full Code Here

        public void testCloning() throws Exception
        {
            ListedHashTree original = new ListedHashTree();
            GenericController controller = new GenericController();
            controller.setName("controller");
            Arguments args = new Arguments();
            args.setName("args");
            TestPlan plan = new TestPlan();
            plan.addParameter("server", "jakarta");
            original.add(controller, args);
            original.add(plan);
            ResultCollector listener = new ResultCollector();
            listener.setName("Collector");
            original.add(controller, listener);
            TreeCloner cloner = new TreeCloner();
            original.traverse(cloner);
            ListedHashTree newTree = cloner.getClonedTree();
            assertTrue(original != newTree);
            assertEquals(original.size(), newTree.size());
            assertEquals(
                original.getTree(original.getArray()[0]).size(),
                newTree.getTree(newTree.getArray()[0]).size());
            assertTrue(original.getArray()[0] != newTree.getArray()[0]);
            assertEquals(
                ((GenericController) original.getArray()[0]).getName(),
                ((GenericController) newTree.getArray()[0]).getName());
            assertSame(
                original.getTree(original.getArray()[0]).getArray()[1],
                newTree.getTree(newTree.getArray()[0]).getArray()[1]);
            TestPlan clonedTestPlan = (TestPlan) newTree.getArray()[1];
            clonedTestPlan.setRunningVersion(true);
            clonedTestPlan.recoverRunningVersion();
            assertTrue(
                !plan
                    .getProperty(TestPlan.USER_DEFINED_VARIABLES)
                    .isRunningVersion());
            assertTrue(
                clonedTestPlan
                    .getProperty(TestPlan.USER_DEFINED_VARIABLES)
                    .isRunningVersion());
            Arguments vars =
                (Arguments) plan
                    .getProperty(TestPlan.USER_DEFINED_VARIABLES)
                    .getObjectValue();
            PropertyIterator iter =
                ((CollectionProperty) vars.getProperty(Arguments.ARGUMENTS))
                    .iterator();
            while (iter.hasNext())
            {
                JMeterProperty argProp = iter.next();               
                assertTrue(!argProp.isRunningVersion());
                assertTrue(argProp.getObjectValue() instanceof Argument);
                Argument arg = (Argument)argProp.getObjectValue();
                arg.setValue("yahoo");
                assertEquals("yahoo",arg.getValue());
            }
            vars =
                (Arguments) clonedTestPlan
                    .getProperty(TestPlan.USER_DEFINED_VARIABLES)
                    .getObjectValue();
            iter = vars.propertyIterator();
            while (iter.hasNext())
            {
                assertTrue(iter.next().isRunningVersion());
            }
        }
View Full Code Here

        }

        public void testTreeConversion() throws Exception
        {
            HashTree tree = new ListedHashTree();
            JMeterTreeNode root = new JMeterTreeNode(new Arguments(), null);
            tree.add(root, root);
            tree.getTree(root).add(root, root);
            save.convertSubTree(tree);
            assertEquals(
                tree.getArray()[0].getClass().getName(),
View Full Code Here

        super(name);
    }

    protected void setUp()
    {
        Arguments args = new Arguments();
        args.addArgument("username", "mstover");
        args.addArgument("password", "pass");
        args.addArgument("action", "login");
        config = new HTTPSampler();
        config.setName("Full Config");
        config.setProperty(HTTPSampler.DOMAIN, "www.lazer.com");
        config.setProperty(HTTPSampler.PATH, "login.jsp");
        config.setProperty(HTTPSampler.METHOD, HTTPSampler.POST);
View Full Code Here

    private String boundary, filename, fileField, mimetype;
    private Arguments args;

    public MultipartUrlConfig()
    {
        args = new Arguments();
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.config.Arguments

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.