Package org.apache.jmeter.testelement.property

Examples of org.apache.jmeter.testelement.property.PropertyIterator


    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


        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)
                {
                    functionCall.append(",");
                }
                functionCall.append((String) arg.getValue());
View Full Code Here

                    .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

            file =
                new File(
                    System.getProperty("user.dir") + File.separator + authFile);
        PrintWriter writer = new PrintWriter(new FileWriter(file));
        writer.println("# JMeter generated Cookie file");
        PropertyIterator cookies = getCookies().iterator();
        while (cookies.hasNext())
        {
            Cookie cook = (Cookie) cookies.next().getObjectValue();
            writer.println(cook.toString());
        }
        writer.flush();
        writer.close();
    }
View Full Code Here

        }
    }

    public void removeCookieNamed(String name)
    {
        PropertyIterator iter = getCookies().iterator();
        while (iter.hasNext())
        {
            Cookie cookie = (Cookie) iter.next().getObjectValue();
            if (cookie.getName().equals(name))
            {
                iter.remove();
            }
        }
    }
View Full Code Here

        {
            return;
        }
        HTTPSamplerBase config = (HTTPSamplerBase) entry;
        Map currentUser = allAvailableUsers.getNextUserMods();
        PropertyIterator iter = config.getArguments().iterator();
        while (iter.hasNext())
        {
            Argument arg = (Argument) iter.next().getObjectValue();
            // if parameter name exists in http request
            // then change its value
            // (Note: each jmeter thread (ie user) gets to have unique values)
            if (currentUser.containsKey(arg.getName()))
            {
View Full Code Here

                    rand.nextInt(potentialLinks.size()));
            sampler.setDomain(url.getDomain());
            sampler.setPath(url.getPath());
            if (url.getMethod().equals(HTTPSamplerBase.POST))
            {
                PropertyIterator iter = sampler.getArguments().iterator();
                while (iter.hasNext())
                {
                    Argument arg = (Argument) iter.next().getObjectValue();
                    modifyArgument(arg, url.getArguments());
                }
            }
            else
            {
View Full Code Here

    private void modifyArgument(Argument arg, Arguments args)
    {
        log.debug("Modifying argument: " + arg);
        List possibleReplacements = new ArrayList();
        PropertyIterator iter = args.iterator();
        Argument replacementArg;
        while (iter.hasNext())
        {
            replacementArg = (Argument) iter.next().getObjectValue();
            try
            {
                if (HtmlParsingUtils.isArgumentMatched(replacementArg, arg))
                {
                    possibleReplacements.add(replacementArg);
View Full Code Here

        super.configure(el);
        if (el instanceof Arguments)
        {
            tableModel.clearData();
            HTTPArgument.convertArgumentsToHTTP((Arguments) el);
            PropertyIterator iter = ((Arguments) el).getArguments().iterator();
            while (iter.hasNext())
            {
                HTTPArgument arg = (HTTPArgument) iter.next().getObjectValue();
                tableModel.addRow(arg);
            }
        }
        checkDeleteStatus();
    }
View Full Code Here

        {
            OutputStream out = connection.getOutputStream();
            //new FileOutputStream("c:\\data\\experiment.txt");
            //new ByteArrayOutputStream();
            writeln(out, "--" + BOUNDARY);
            PropertyIterator args = sampler.getArguments().iterator();
            while (args.hasNext())
            {
                Argument arg = (Argument) args.next().getObjectValue();
                writeFormMultipartStyle(
                    out,
                    arg.getName(),
                    (String) arg.getValue());
                writeln(out, "--" + BOUNDARY);
View Full Code Here

TOP

Related Classes of org.apache.jmeter.testelement.property.PropertyIterator

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.