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));
}
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));
}
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));
}
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;
}
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);
}
Aggregations