Package org.apache.jmeter.testelement.property

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


        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


    }

    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

    }

    // 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

    // 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

    }

    // 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

    }

    // 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

    }

    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("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

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

    public void testOverRide() {
        JMeterProperty jmp = partialConfig.getProperty(HTTPSamplerBase.DOMAIN);
        assertTrue(jmp instanceof NullProperty);
        assertEquals(jmp, new NullProperty(HTTPSamplerBase.DOMAIN));
        partialConfig.addTestElement(defaultConfig);
        assertEquals(partialConfig.getPropertyAsString(HTTPSamplerBase.DOMAIN), "www.xerox.com");
        assertEquals(partialConfig.getPropertyAsString(HTTPSamplerBase.PATH), "main.jsp");
View Full Code Here

        setProperty(MIMETYPE, mimetype);
        setProperty(PARAMNAME, paramname);
    }

    private void setProperty(String name, JMeterProperty prop) {
        JMeterProperty jmp = (JMeterProperty) prop.clone();
        jmp.setName(name);
        setProperty(jmp);
    }
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.