Package org.apache.jmeter.testelement.property

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


    {
        StringProperty prop =
            new StringProperty(
                "html",
                "${__regexFunction(<html>(${my_regex})</html>,$1$)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        assertEquals("hello world", newProp.getStringValue());
    }
View Full Code Here


     * @see ValueTransformer#transformValue(JMeterProperty)
     */
    public JMeterProperty transformValue(JMeterProperty prop)
        throws InvalidVariableException
    {
        JMeterProperty newValue = prop;
        getMasterFunction().clear();
        getMasterFunction().setParameters(prop.getStringValue());
        if (getMasterFunction().hasFunction())
        {
            newValue =
View Full Code Here

        StringProperty prop =
            new StringProperty(
                "date",
                "${__javaScript((new Date().getDate() / 100).toString()."
                    + "substr(${__javaScript(1+1,d\\,ay)}\\,2),heute)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        newProp.recoverRunningVersion(null);
        assertTrue(Integer.parseInt(newProp.getStringValue()) > -1);
        assertEquals(
            "2",
            jmctx.getVariables().getObject("d,ay"));
    }
View Full Code Here

    {
        StringProperty prop =
            new StringProperty(
                "html",
                "${__regexFunction(<html>(.*)</html>,$1$)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        assertEquals("hello world", newProp.getStringValue());
    }
View Full Code Here

    {
        StringProperty prop =
            new StringProperty(
                "html",
                "It should say:\\${${__regexFunction(<html>(.*)</html>,$1$)}}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        assertEquals("It should say:${hello world}", newProp.getStringValue());
    }
View Full Code Here

            new StringProperty(
                "html",
                "${__regexFunction(<html>(.*)</html>,$1$)}"
                    + "${__regexFunction(<html>(.*o)(.*o)(.*)</html>,"
                    + "$1$$3$)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        assertEquals("hello worldhellorld", newProp.getStringValue());
    }
View Full Code Here

    public void testParseExample4() throws Exception
    {
        StringProperty prop =
            new StringProperty("html", "${non-existing function}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals(
            "org.apache.jmeter.testelement.property.FunctionProperty",
            newProp.getClass().getName());
        assertEquals("${non-existing function}", newProp.getStringValue());
    }
View Full Code Here

        throws InvalidVariableException
    {
        List props = new LinkedList();
        while(iter.hasNext())
        {
            JMeterProperty val = iter.next();
            if (log.isDebugEnabled())
            {
                log.debug("About to replace in property of tipe: "
                  +val.getClass()+": "+val);
            }
            if (val instanceof StringProperty)
            {
                val = transform.transformValue((StringProperty) val);
                if (log.isDebugEnabled())
View Full Code Here

            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
View Full Code Here

        assertEquals(config.getDomain(), "www.lazer.com");
    }

    public void testOverRide()
    {
      JMeterProperty jmp =partialConfig.getProperty(HTTPSampler.DOMAIN);
        assertTrue(jmp instanceof NullProperty);
        assertTrue(new NullProperty(HTTPSampler.DOMAIN).equals(jmp));
        partialConfig.addTestElement(defaultConfig);
        assertEquals(
            partialConfig.getPropertyAsString(HTTPSampler.DOMAIN),
View Full Code Here

TOP

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

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.