Search in sources :

Example 6 with BooleanProperty

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

the class ProxyControl method setRegexMatch.

/**
     * @param b flag whether regex matching should be used
     */
public void setRegexMatch(boolean b) {
    regexMatch = b;
    setProperty(new BooleanProperty(REGEX_MATCH, b));
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Example 7 with BooleanProperty

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

the class ThreadGroupGui 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 tg) {
    super.configureTestElement(tg);
    if (tg instanceof AbstractThreadGroup) {
        ((AbstractThreadGroup) tg).setSamplerController((LoopController) loopPanel.createTestElement());
    }
    tg.setProperty(AbstractThreadGroup.NUM_THREADS, threadInput.getText());
    tg.setProperty(ThreadGroup.RAMP_TIME, rampInput.getText());
    tg.setProperty(new LongProperty(ThreadGroup.START_TIME, start.getDate().getTime()));
    tg.setProperty(new LongProperty(ThreadGroup.END_TIME, end.getDate().getTime()));
    if (showDelayedStart) {
        tg.setProperty(ThreadGroup.DELAYED_START, delayedStart.isSelected(), false);
    }
    tg.setProperty(new BooleanProperty(ThreadGroup.SCHEDULER, scheduler.isSelected()));
    tg.setProperty(ThreadGroup.DURATION, duration.getText());
    tg.setProperty(ThreadGroup.DELAY, delay.getText());
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty) LongProperty(org.apache.jmeter.testelement.property.LongProperty) AbstractThreadGroup(org.apache.jmeter.threads.AbstractThreadGroup)

Example 8 with BooleanProperty

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

the class ProxyControl method setUseKeepAlive.

/**
     * @param b flag whether keep alive should be used
     */
public void setUseKeepAlive(boolean b) {
    useKeepAlive = b;
    setProperty(new BooleanProperty(USE_KEEPALIVE, b));
}
Also used : BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty)

Example 9 with BooleanProperty

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

the class LdapConfigGui 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 element) {
    element.clear();
    configureTestElement(element);
    element.setProperty(LDAPSampler.SERVERNAME, servername.getText());
    element.setProperty(LDAPSampler.PORT, port.getText());
    element.setProperty(LDAPSampler.ROOTDN, rootdn.getText());
    element.setProperty(new BooleanProperty(LDAPSampler.USER_DEFINED, userDefined.isSelected()));
    if (addTest.isSelected()) {
        element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.ADD));
        element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, add.getText()));
        element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableAddPanel.createTestElement()));
    }
    if (modifyTest.isSelected()) {
        element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.MODIFY));
        element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, modify.getText()));
        element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableModifyPanel.createTestElement()));
    }
    if (deleteTest.isSelected()) {
        element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.DELETE));
        element.setProperty(new StringProperty(LDAPSampler.DELETE, delete.getText()));
    }
    if (searchTest.isSelected()) {
        element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.SEARCHBASE));
        element.setProperty(new StringProperty(LDAPSampler.SEARCHBASE, searchbase.getText()));
        element.setProperty(new StringProperty(LDAPSampler.SEARCHFILTER, searchfilter.getText()));
    }
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty) StringProperty(org.apache.jmeter.testelement.property.StringProperty)

Example 10 with BooleanProperty

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

the class UrlConfigGui method modifyTestElement.

/**
     * Save the GUI values in the sampler.
     *
     * @param element {@link TestElement} to modify
     */
public void modifyTestElement(TestElement element) {
    boolean useRaw = postContentTabbedPane.getSelectedIndex() == tabRawBodyIndex;
    Arguments args;
    if (useRaw) {
        args = new Arguments();
        String text = postBodyContent.getText();
        /*
             * Textfield uses \n (LF) to delimit lines; we need to send CRLF.
             * Rather than change the way that arguments are processed by the
             * samplers for raw data, it is easier to fix the data.
             * On retrieval, CRLF is converted back to LF for storage in the text field.
             * See
             */
        HTTPArgument arg = new HTTPArgument("", text.replaceAll("\n", "\r\n"), false);
        arg.setAlwaysEncoded(false);
        args.addArgument(arg);
    } else {
        args = (Arguments) argsPanel.createTestElement();
        HTTPArgument.convertArgumentsToHTTP(args);
        if (showFileUploadPane) {
            filesPanel.modifyTestElement(element);
        }
    }
    element.setProperty(HTTPSamplerBase.POST_BODY_RAW, useRaw, HTTPSamplerBase.POST_BODY_RAW_DEFAULT);
    element.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));
    element.setProperty(HTTPSamplerBase.DOMAIN, domain.getText());
    element.setProperty(HTTPSamplerBase.PORT, port.getText());
    element.setProperty(HTTPSamplerBase.PROTOCOL, protocol.getText());
    element.setProperty(HTTPSamplerBase.CONTENT_ENCODING, contentEncoding.getText());
    element.setProperty(HTTPSamplerBase.PATH, path.getText());
    if (notConfigOnly) {
        element.setProperty(HTTPSamplerBase.METHOD, method.getText());
        element.setProperty(new BooleanProperty(HTTPSamplerBase.FOLLOW_REDIRECTS, followRedirects.isSelected()));
        element.setProperty(new BooleanProperty(HTTPSamplerBase.AUTO_REDIRECTS, autoRedirects.isSelected()));
        element.setProperty(new BooleanProperty(HTTPSamplerBase.USE_KEEPALIVE, useKeepAlive.isSelected()));
        element.setProperty(new BooleanProperty(HTTPSamplerBase.DO_MULTIPART_POST, useMultipartForPost.isSelected()));
        element.setProperty(HTTPSamplerBase.BROWSER_COMPATIBLE_MULTIPART, useBrowserCompatibleMultipartMode.isSelected(), HTTPSamplerBase.BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT);
    }
}
Also used : HTTPArgument(org.apache.jmeter.protocol.http.util.HTTPArgument) TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) BooleanProperty(org.apache.jmeter.testelement.property.BooleanProperty) Arguments(org.apache.jmeter.config.Arguments)

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