use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class UltimateThreadGroup method getData.
public JMeterProperty getData() {
JMeterProperty brokenProp = getProperty(EXTERNAL_DATA_PROPERTY);
JMeterProperty usualProp = getProperty(DATA_PROPERTY);
if (brokenProp instanceof CollectionProperty) {
if (usualProp == null || usualProp instanceof NullProperty) {
log.warn("Copying '" + EXTERNAL_DATA_PROPERTY + "' into '" + DATA_PROPERTY + "'");
JMeterProperty newProp = brokenProp.clone();
newProp.setName(DATA_PROPERTY);
setProperty(newProp);
}
log.warn("Removing property '" + EXTERNAL_DATA_PROPERTY + "' as invalid");
removeProperty(EXTERNAL_DATA_PROPERTY);
}
// log.info("getData: "+getProperty(DATA_PROPERTY));
CollectionProperty overrideProp = getLoadFromExternalProperty();
if (overrideProp != null) {
return overrideProp;
}
return getProperty(DATA_PROPERTY);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class UltimateThreadGroupGui method modifyTestElement.
@Override
public void modifyTestElement(TestElement tg) {
// log.info("Modify test element");
if (grid.isEditing()) {
grid.getCellEditor().stopCellEditing();
}
if (tg instanceof UltimateThreadGroup) {
UltimateThreadGroup utg = (UltimateThreadGroup) tg;
CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, UltimateThreadGroup.DATA_PROPERTY);
utg.setData(rows);
utg.setSamplerController((LoopController) loopPanel.createTestElement());
}
super.configureTestElement(tg);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class DbMonCollector method initiateConnectors.
private void initiateConnectors() throws SQLException {
JMeterProperty prop = getSamplerSettings();
dbMonSamplers.clear();
if (!(prop instanceof CollectionProperty)) {
log.warn("Got unexpected property: " + prop);
return;
}
CollectionProperty rows = (CollectionProperty) prop;
for (int i = 0; i < rows.size(); i++) {
ArrayList<Object> row = (ArrayList<Object>) rows.get(i).getObjectValue();
String connectionPool = ((JMeterProperty) row.get(0)).getStringValue();
String label = ((JMeterProperty) row.get(1)).getStringValue();
boolean isDelta = ((JMeterProperty) row.get(2)).getBooleanValue();
String sql = ((JMeterProperty) row.get(3)).getStringValue();
initiateConnector(connectionPool, label, isDelta, sql);
}
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class DbMonGui method modifyTestElement.
@Override
public void modifyTestElement(TestElement te) {
super.modifyTestElement(te);
if (grid.isEditing()) {
grid.getCellEditor().stopCellEditing();
}
if (te instanceof DbMonCollector) {
DbMonCollector dmte = (DbMonCollector) te;
CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, DbMonCollector.DATA_PROPERTY);
dmte.setData(rows);
}
super.configureTestElement(te);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class DistributedTestControl method setData.
public void setData(ArrayList<String> data) {
setProperty(new CollectionProperty(DistributedTestControl.DATA_PROP, data));
String val = StringUtils.join(data, ",");
log.debug("Setting hosts 2: " + val);
JMeterUtils.setProperty(PROP_HOSTS, val);
}
Aggregations