Package org.apache.jmeter.testelement.property

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


        assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
        assertEquals("$3.47", newProp.getStringValue());
    }

    public void testParseExample9() throws Exception {
        StringProperty prop = new StringProperty("html", "${__regexFunction(([$]\\d+\\.\\d+),$1$)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
        assertEquals("$3.47", newProp.getStringValue());
    }
View Full Code Here


        assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
        assertEquals("$3.47", newProp.getStringValue());
    }

    public void testParseExample10() throws Exception {
        StringProperty prop = new StringProperty("html", "${__regexFunction(\\ "
                + "(\\\\\\$\\d+\\.\\d+\\,\\\\$\\d+\\.\\d+),$1$)}");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
        assertEquals("$3.47,$5.67", newProp.getStringValue());
View Full Code Here

        assertEquals("$3.47,$5.67", newProp.getStringValue());
    }

    // Escaped dollar commma and backslash with no variable reference
    public void testParseExample11() throws Exception {
        StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ jakarta.apache.org");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        assertEquals("org.apache.jmeter.testelement.property.StringProperty", newProp.getClass().getName());
        assertEquals("\\$a \\, \\\\ \\x \\ jakarta.apache.org", newProp.getStringValue());
    }
View Full Code Here

    // It's too late now, as this would invalidate some existing test plans,
    // so document the current behaviour with some more tests.
   
    // Escaped dollar commma and backslash with variable reference
    public void testParseExample12() throws Exception {
        StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${server} \\$b \\, \\\\ cd");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        // N.B. Backslashes are removed before dollar, comma and backslash
        assertEquals("$a , \\ \\x \\ jakarta.apache.org $b , \\ cd", newProp.getStringValue());
    }
View Full Code Here

        assertEquals("$a , \\ \\x \\ jakarta.apache.org $b , \\ cd", newProp.getStringValue());
    }

    // Escaped dollar commma and backslash with missing variable reference
    public void testParseExample13() throws Exception {
        StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${missing} \\$b \\, \\\\ cd");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        // N.B. Backslashes are removed before dollar, comma and backslash
        assertEquals("$a , \\ \\x \\ ${missing} $b , \\ cd", newProp.getStringValue());
    }
View Full Code Here

        assertEquals("$a , \\ \\x \\ ${missing} $b , \\ cd", newProp.getStringValue());
    }

    // Escaped dollar commma and backslash with missing function reference
    public void testParseExample14() throws Exception {
        StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${__missing(a)} \\$b \\, \\\\ cd");
        JMeterProperty newProp = transformer.transformValue(prop);
        newProp.setRunningVersion(true);
        // N.B. Backslashes are removed before dollar, comma and backslash
        assertEquals("$a , \\ \\x \\ ${__missing(a)} $b , \\ cd", newProp.getStringValue());
    }
View Full Code Here

        // N.B. Backslashes are removed before dollar, comma and backslash
        assertEquals("$a , \\ \\x \\ ${__missing(a)} $b , \\ cd", newProp.getStringValue());
    }

    public void testNestedExample1() throws Exception {
        StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</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

        assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
        assertEquals("hello worldhellorld", newProp.getStringValue());
    }

    public void testNestedExample2() throws Exception {
        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

        public void testReverseReplacement() throws Exception {
            ValueReplacer replacer = new ValueReplacer(variables);
            assertTrue(variables.getUserDefinedVariables().containsKey("server"));
            assertTrue(replacer.containsKey("server"));
            TestElement element = new TestPlan();
            element.setProperty(new StringProperty("domain", "jakarta.apache.org"));
            List<Object> argsin = new ArrayList<Object>();
            argsin.add("username is jack");
            argsin.add("his_password");
            element.setProperty(new CollectionProperty("args", argsin));
            replacer.reverseReplace(element);
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

TOP

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

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.