Search in sources :

Example 11 with BooleanProperty

use of org.apache.jmeter.testelement.property.BooleanProperty in project jmeter by apache.

the class HttpDefaultsGui method modifyTestElement.

/**
     * Modifies a given TestElement to mirror the data in the gui components.
     *
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
     */
@Override
public void modifyTestElement(TestElement config) {
    ConfigTestElement cfg = (ConfigTestElement) config;
    ConfigTestElement el = (ConfigTestElement) urlConfigGui.createTestElement();
    cfg.clear();
    cfg.addConfigElement(el);
    super.configureTestElement(config);
    if (retrieveEmbeddedResources.isSelected()) {
        config.setProperty(new BooleanProperty(HTTPSamplerBase.IMAGE_PARSER, true));
    } else {
        config.removeProperty(HTTPSamplerBase.IMAGE_PARSER);
    }
    enableConcurrentDwn(retrieveEmbeddedResources.isSelected());
    if (concurrentDwn.isSelected()) {
        config.setProperty(new BooleanProperty(HTTPSamplerBase.CONCURRENT_DWN, true));
    } else {
        // The default is false, so we can remove the property to simplify JMX files
        // This also allows HTTPDefaults to work for this checkbox
        config.removeProperty(HTTPSamplerBase.CONCURRENT_DWN);
    }
    if (!StringUtils.isEmpty(concurrentPool.getText())) {
        config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL, concurrentPool.getText()));
    } else {
        config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL, String.valueOf(HTTPSamplerBase.CONCURRENT_POOL_SIZE)));
    }
    if (useMD5.isSelected()) {
        config.setProperty(new BooleanProperty(HTTPSamplerBase.MD5, true));
    } else {
        config.removeProperty(HTTPSamplerBase.MD5);
    }
    if (!StringUtils.isEmpty(embeddedRE.getText())) {
        config.setProperty(new StringProperty(HTTPSamplerBase.EMBEDDED_URL_RE, embeddedRE.getText()));
    } else {
        config.removeProperty(HTTPSamplerBase.EMBEDDED_URL_RE);
    }
    if (!StringUtils.isEmpty(sourceIpAddr.getText())) {
        config.setProperty(new StringProperty(HTTPSamplerBase.IP_SOURCE, sourceIpAddr.getText()));
        config.setProperty(new IntegerProperty(HTTPSamplerBase.IP_SOURCE_TYPE, sourceIpType.getSelectedIndex()));
    } else {
        config.removeProperty(HTTPSamplerBase.IP_SOURCE);
        config.removeProperty(HTTPSamplerBase.IP_SOURCE_TYPE);
    }
    config.setProperty(HTTPSamplerBase.PROXYHOST, proxyHost.getText(), "");
    config.setProperty(HTTPSamplerBase.PROXYPORT, proxyPort.getText(), "");
    config.setProperty(HTTPSamplerBase.PROXYUSER, proxyUser.getText(), "");
    config.setProperty(HTTPSamplerBase.PROXYPASS, String.valueOf(proxyPass.getPassword()), "");
    config.setProperty(HTTPSamplerBase.IMPLEMENTATION, httpImplementation.getSelectedItem().toString(), "");
    config.setProperty(HTTPSamplerBase.CONNECT_TIMEOUT, connectTimeOut.getText());
    config.setProperty(HTTPSamplerBase.RESPONSE_TIMEOUT, responseTimeOut.getText());
}
Also used : IntegerProperty(org.apache.jmeter.testelement.property.IntegerProperty) BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty) StringProperty(org.apache.jmeter.testelement.property.StringProperty) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement)

Example 12 with BooleanProperty

use of org.apache.jmeter.testelement.property.BooleanProperty in project jmeter by apache.

the class ProxyControl method setSamplerDownloadImages.

public void setSamplerDownloadImages(boolean b) {
    samplerDownloadImages = b;
    setProperty(new BooleanProperty(SAMPLER_DOWNLOAD_IMAGES, b));
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Example 13 with BooleanProperty

use of org.apache.jmeter.testelement.property.BooleanProperty in project jmeter by apache.

the class ProxyControl method setSamplerFollowRedirects.

public void setSamplerFollowRedirects(boolean b) {
    samplerFollowRedirects = b;
    setProperty(new BooleanProperty(SAMPLER_FOLLOW_REDIRECTS, b));
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Example 14 with BooleanProperty

use of org.apache.jmeter.testelement.property.BooleanProperty in project jmeter by apache.

the class BeanShellAssertionGui method modifyTestElement.

/**
     * Modifies a given TestElement to mirror the data in the gui components.
     * 
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
     */
@Override
public void modifyTestElement(TestElement te) {
    te.clear();
    super.configureTestElement(te);
    te.setProperty(BeanShellAssertion.SCRIPT, scriptField.getText());
    te.setProperty(BeanShellAssertion.FILENAME, filename.getText());
    te.setProperty(BeanShellAssertion.PARAMETERS, parameters.getText());
    te.setProperty(new BooleanProperty(BeanShellAssertion.RESET_INTERPRETER, resetInterpreter.isSelected()));
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Example 15 with BooleanProperty

use of org.apache.jmeter.testelement.property.BooleanProperty in project jmeter by apache.

the class BooleanPropertyConverter method unmarshal.

/** {@inheritDoc} */
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    final String name = ConversionHelp.getPropertyName(reader, context);
    if (name == null) {
        return null;
    }
    BooleanProperty prop = new BooleanProperty(name, Boolean.valueOf(reader.getValue()).booleanValue());
    return prop;
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Aggregations

BooleanProperty (org.apache.jmeter.testelement.property.BooleanProperty)16 StringProperty (org.apache.jmeter.testelement.property.StringProperty)2 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)2 Arguments (org.apache.jmeter.config.Arguments)1 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)1 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)1 IntegerProperty (org.apache.jmeter.testelement.property.IntegerProperty)1 LongProperty (org.apache.jmeter.testelement.property.LongProperty)1 AbstractThreadGroup (org.apache.jmeter.threads.AbstractThreadGroup)1