Search in sources :

Example 1 with TestElementProperty

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

the class HTTPSamplerBase method setDNSResolver.

public void setDNSResolver(DNSCacheManager cacheManager) {
    DNSCacheManager mgr = getDNSResolver();
    if (mgr != null) {
        if (log.isWarnEnabled()) {
            log.warn("Existing DNSCacheManager {} superseded by {}", mgr.getName(), cacheManager.getName());
        }
    }
    setProperty(new TestElementProperty(DNS_CACHE_MANAGER, cacheManager));
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) DNSCacheManager(org.apache.jmeter.protocol.http.control.DNSCacheManager)

Example 2 with TestElementProperty

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

the class HTTPSamplerBase method setHeaderManager.

public void setHeaderManager(final HeaderManager value) {
    HeaderManager mgr = getHeaderManager();
    HeaderManager lValue = value;
    if (mgr != null) {
        lValue = mgr.merge(value);
        if (log.isDebugEnabled()) {
            log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + lValue.getName() + "'");
            for (int i = 0; i < lValue.getHeaders().size(); i++) {
                log.debug("    " + lValue.getHeader(i).getName() + "=" + lValue.getHeader(i).getValue());
            }
        }
    }
    setProperty(new TestElementProperty(HEADER_MANAGER, lValue));
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) HeaderManager(org.apache.jmeter.protocol.http.control.HeaderManager)

Example 3 with TestElementProperty

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

the class HTTPSamplerBase method setAuthManager.

public void setAuthManager(AuthManager value) {
    AuthManager mgr = getAuthManager();
    if (mgr != null) {
        if (log.isWarnEnabled()) {
            log.warn("Existing AuthManager {} superseded by {}", mgr.getName(), value.getName());
        }
    }
    setProperty(new TestElementProperty(AUTH_MANAGER, value));
}
Also used : AuthManager(org.apache.jmeter.protocol.http.control.AuthManager) TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty)

Example 4 with TestElementProperty

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

the class TestBeanHelper method unwrapProperty.

private static Object unwrapProperty(PropertyDescriptor desc, JMeterProperty jprop, Class<?> type) {
    Object value;
    if (jprop instanceof TestElementProperty) {
        TestElement te = ((TestElementProperty) jprop).getElement();
        if (te instanceof TestBean) {
            prepare(te);
        }
        value = te;
    } else if (jprop instanceof MultiProperty) {
        value = unwrapCollection((MultiProperty) jprop, (String) desc.getValue(TableEditor.CLASSNAME));
    } else // value was not provided, and this is allowed
    if (jprop instanceof NullProperty && // use negative condition so missing (null) value is treated as FALSE
    !Boolean.TRUE.equals(desc.getValue(GenericTestBeanCustomizer.NOT_UNDEFINED))) {
        value = null;
    } else {
        value = Converter.convert(jprop.getStringValue(), type);
    }
    return value;
}
Also used : NullProperty(org.apache.jmeter.testelement.property.NullProperty) TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) MultiProperty(org.apache.jmeter.testelement.property.MultiProperty) TestElement(org.apache.jmeter.testelement.TestElement)

Example 5 with TestElementProperty

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

the class Arguments method addArgument.

/**
     * Add a new argument.
     *
     * @param arg
     *            the new argument
     */
public void addArgument(Argument arg) {
    TestElementProperty newArg = new TestElementProperty(arg.getName(), arg);
    if (isRunningVersion()) {
        this.setTemporary(newArg);
    }
    getArguments().addItem(newArg);
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty)

Aggregations

TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)22 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)5 TestElement (org.apache.jmeter.testelement.TestElement)4 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)4 Arguments (org.apache.jmeter.config.Arguments)3 NullProperty (org.apache.jmeter.testelement.property.NullProperty)3 StringProperty (org.apache.jmeter.testelement.property.StringProperty)3 HeaderManager (org.apache.jmeter.protocol.http.control.HeaderManager)2 BooleanProperty (org.apache.jmeter.testelement.property.BooleanProperty)2 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)2 Test (org.junit.Test)2 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 LoginConfig (org.apache.jmeter.config.LoginConfig)1 AuthManager (org.apache.jmeter.protocol.http.control.AuthManager)1 Authorization (org.apache.jmeter.protocol.http.control.Authorization)1 DNSCacheManager (org.apache.jmeter.protocol.http.control.DNSCacheManager)1 Header (org.apache.jmeter.protocol.http.control.Header)1 HTTPNullSampler (org.apache.jmeter.protocol.http.sampler.HTTPNullSampler)1 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)1