use of org.apache.jmeter.testelement.property.IntegerProperty in project jmeter by apache.
the class TestNumberProperty method testIZeroCompareToDZero.
@Test
public void testIZeroCompareToDZero() {
NumberProperty n1 = new IntegerProperty("n1", 0);
NumberProperty n2 = new DoubleProperty("n2", 0.0);
assertEquals(0, n1.compareTo(n2));
}
use of org.apache.jmeter.testelement.property.IntegerProperty in project jmeter by apache.
the class ThroughputController method getMaxThroughputAsInt.
protected int getMaxThroughputAsInt() {
JMeterProperty prop = getProperty(MAXTHROUGHPUT);
int retVal = 1;
if (prop instanceof IntegerProperty) {
retVal = prop.getIntValue();
} else {
String valueString = prop.getStringValue();
try {
retVal = Integer.parseInt(valueString);
} catch (NumberFormatException e) {
log.warn("Error parsing '{}'", valueString, e);
}
}
return retVal;
}
use of org.apache.jmeter.testelement.property.IntegerProperty 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(embeddedAllowRE.getText())) {
config.setProperty(new StringProperty(HTTPSamplerBase.EMBEDDED_URL_RE, embeddedAllowRE.getText()));
} else {
config.removeProperty(HTTPSamplerBase.EMBEDDED_URL_RE);
}
if (!StringUtils.isEmpty(embeddedExcludeRE.getText())) {
config.setProperty(new StringProperty(HTTPSamplerBase.EMBEDDED_URL_EXCLUDE_RE, embeddedExcludeRE.getText()));
} else {
config.removeProperty(HTTPSamplerBase.EMBEDDED_URL_EXCLUDE_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.PROXYSCHEME, proxyScheme.getText(), "");
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());
}
Aggregations