use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class FirefoxDriverConfig method setPreferences.
private void setPreferences(FirefoxProfile profile) {
JMeterProperty property = getProperty(PREFERENCES);
if (property instanceof NullProperty) {
return;
}
CollectionProperty rows = (CollectionProperty) property;
for (int i = 0; i < rows.size(); i++) {
ArrayList row = (ArrayList) rows.get(i).getObjectValue();
String name = ((JMeterProperty) row.get(0)).getStringValue();
String value = ((JMeterProperty) row.get(1)).getStringValue();
switch(value) {
case "true":
profile.setPreference(name, true);
break;
case "false":
profile.setPreference(name, false);
break;
default:
profile.setPreference(name, value);
break;
}
}
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class FirefoxDriverConfig method setPreferences.
public void setPreferences(PowerTableModel model) {
CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(model, PREFERENCES);
setProperty(prop);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class MonitoringResultsCollector method getSamplerSettings.
public CollectionProperty getSamplerSettings() {
JMeterProperty prop = getProperty(DATA_PROPERTY);
if (!(prop instanceof CollectionProperty)) {
log.warn("Got unexpected property: " + prop);
// empty collection instead of NullProperty
return new CollectionProperty();
}
CollectionProperty rows = (CollectionProperty) prop;
return rows;
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class JMeterPluginsUtils method tableModelRowsToCollectionProperty.
public static CollectionProperty tableModelRowsToCollectionProperty(PowerTableModel model, String propname) {
CollectionProperty rows = new CollectionProperty(propname, new ArrayList<>());
for (int row = 0; row < model.getRowCount(); row++) {
List<Object> item = getArrayListForArray(model.getRowData(row));
rows.addItem(item);
}
return rows;
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class AbstractMonitoringVisualizer method modifyTestElement.
@Override
public void modifyTestElement(TestElement te) {
super.modifyTestElement(te);
if (grid.isEditing()) {
grid.getCellEditor().stopCellEditing();
}
if (te instanceof MonitoringResultsCollector) {
MonitoringResultsCollector mrc = (MonitoringResultsCollector) te;
CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, MonitoringResultsCollector.DATA_PROPERTY);
mrc.setData(rows);
}
super.configureTestElement(te);
}
Aggregations