Package org.apache.jmeter.config

Examples of org.apache.jmeter.config.ConfigTestElement


                    || name.equals(TestElement.TEST_CLASS)) {
                continue; // go on with next property.
            }

            for (Iterator<ConfigTestElement> configs = configurations.iterator(); configs.hasNext();) {
                ConfigTestElement config = configs.next();

                String configValue = config.getPropertyAsString(name);

                if (configValue != null && configValue.length() > 0) {
                    if (configValue.equals(value)) {
                        sampler.setProperty(name, ""); // $NON-NLS-1$
                    }
View Full Code Here


        assertEquals(new Header("1stLevelTestHeader", "testValue1"), headerManager.get(0));
        assertEquals(new Header("2ndLevelTestHeader", "testValue2"), headerManager2.get(0));
    }

    public void testRecovery() throws Exception {
        ConfigTestElement config = new ConfigTestElement();
        config.addProperty(new StringProperty("name", "config"));
        config.setRunningVersion(true);
        LoginConfig loginConfig = new LoginConfig();
        loginConfig.setUsername("user1");
        loginConfig.setPassword("pass1");
        assertTrue(config.getProperty("login") instanceof NullProperty);
        // This test should work whether or not all Nulls are equal
        assertEquals(new NullProperty("login"), config.getProperty("login"));
        config.addProperty(new TestElementProperty("login", loginConfig));
        assertEquals(loginConfig.toString(), config.getPropertyAsString("login"));
        config.recoverRunningVersion();
        assertTrue(config.getProperty("login") instanceof NullProperty);
        assertEquals(new NullProperty("login"), config.getProperty("login"));
    }
View Full Code Here

    public void testArguments() throws Exception {
        Arguments args = new Arguments();
        args.addArgument("arg1", "val1", "=");
        TestElementProperty prop = new TestElementProperty("args", args);
        ConfigTestElement te = new ConfigTestElement();
        te.addProperty(prop);
        te.setRunningVersion(true);
        Arguments config = new Arguments();
        config.addArgument("config1", "configValue", "=");
        TestElementProperty configProp = new TestElementProperty("args", config);
        ConfigTestElement te2 = new ConfigTestElement();
        te2.addProperty(configProp);
        te.addTestElement(te2);
        assertEquals(2, args.getArgumentCount());
        assertEquals("config1=configValue", args.getArgument(1).toString());
        te.recoverRunningVersion();
        te.addTestElement(te2);
View Full Code Here

    public String getLabelResource() {
        return "obsolete_test_element"; // $NON-NLS-1$
    }

    public TestElement createTestElement() {
        return new ConfigTestElement();
    }
View Full Code Here

        password.setText(element.getPropertyAsString(ConfigTestElement.PASSWORD));
    }

    /* Implements JMeterGUIComponent.createTestElement() */
    public TestElement createTestElement() {
        ConfigTestElement element = new ConfigTestElement();
        modifyTestElement(element);
        return element;
    }
View Full Code Here

        checkDeleteStatus();
    }

    /* Implements JMeterGUIComponent.createTestElement() */
    public TestElement createTestElement() {
        TestElement el = new ConfigTestElement();
        modifyTestElement(el);
        return el;
    }
View Full Code Here

                reader.moveUp();
            }
            return prop;
        } catch (InstantiationException e) {
            log.error("Couldn't unmarshall TestElementProperty", e);
            return new TestElementProperty("ERROR", new ConfigTestElement());// $NON-NLS-1$
        } catch (IllegalAccessException e) {
            log.error("Couldn't unmarshall TestElementProperty", e);
            return new TestElementProperty("ERROR", new ConfigTestElement());// $NON-NLS-1$
        }
    }
View Full Code Here

        }
        postContentTabbedPane.setSelectedIndex(TAB_PARAMETERS, false);
    }

    public TestElement createTestElement() {
        ConfigTestElement element = new ConfigTestElement();

        element.setName(this.getName());
        element.setProperty(TestElement.GUI_CLASS, this.getClass().getName());
        element.setProperty(TestElement.TEST_CLASS, element.getClass().getName());
        modifyTestElement(element);
        return element;
    }
View Full Code Here

    /**
     * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
     */
    public TestElement createTestElement() {
        ConfigTestElement config = new ConfigTestElement();
        modifyTestElement(config);
        return config;
    }
View Full Code Here

     * Modifies a given TestElement to mirror the data in the gui components.
     *
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
     */
    public void modifyTestElement(TestElement config) {
        ConfigTestElement cfg = (ConfigTestElement ) config;
        ConfigTestElement el = (ConfigTestElement) urlConfig.createTestElement();
        cfg.clear(); // need to clear because the
        cfg.addConfigElement(el);
        super.configureTestElement(config);
        if (imageParser.isSelected()) {
            config.setProperty(new BooleanProperty(HTTPSamplerBase.IMAGE_PARSER, true));
View Full Code Here

TOP

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

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.