use of org.apache.jmeter.testelement.property.PropertyIterator in project jmeter by apache.
the class SimpleConfigGui method configure.
/**
* A newly created component can be initialized with the contents of a Test
* Element object by calling this method. The component is responsible for
* querying the Test Element object for the relevant information to display
* in its GUI.
* <p>
* This implementation retrieves all key/value pairs from the TestElement
* object and sets these values in the GUI.
*
* @param el
* the TestElement to configure
*/
@Override
public void configure(TestElement el) {
super.configure(el);
tableModel.clearData();
PropertyIterator iter = el.propertyIterator();
while (iter.hasNext()) {
JMeterProperty prop = iter.next();
tableModel.addRow(new Object[] { prop.getName(), prop.getStringValue() });
}
checkDeleteStatus();
}
use of org.apache.jmeter.testelement.property.PropertyIterator in project jmeter by apache.
the class UserParametersGui method configure.
@Override
public void configure(TestElement el) {
initTableModel();
paramTable.setModel(tableModel);
UserParameters params = (UserParameters) el;
CollectionProperty names = params.getNames();
CollectionProperty threadValues = params.getThreadLists();
tableModel.setColumnData(0, (List<?>) names.getObjectValue());
PropertyIterator iter = threadValues.iterator();
if (iter.hasNext()) {
tableModel.setColumnData(1, (List<?>) iter.next().getObjectValue());
}
int count = 2;
while (iter.hasNext()) {
String colName = getUserColName(count);
tableModel.addNewColumn(colName, String.class);
tableModel.setColumnData(count, (List<?>) iter.next().getObjectValue());
count++;
}
setColumnWidths();
perIterationCheck.setSelected(params.isPerIteration());
super.configure(el);
}
use of org.apache.jmeter.testelement.property.PropertyIterator in project jmeter by apache.
the class Arguments method getArgumentsAsMap.
/**
* Get the arguments as a Map. Each argument name is used as the key, and
* its value as the value.
*
* @return a new Map with String keys and values containing the arguments
*/
public Map<String, String> getArgumentsAsMap() {
PropertyIterator iter = getArguments().iterator();
Map<String, String> argMap = new LinkedHashMap<>();
while (iter.hasNext()) {
Argument arg = (Argument) iter.next().getObjectValue();
// elements:
if (!argMap.containsKey(arg.getName())) {
argMap.put(arg.getName(), arg.getValue());
}
}
return argMap;
}
use of org.apache.jmeter.testelement.property.PropertyIterator in project jmeter by apache.
the class TestBeanGUI method setValues.
/**
* Get values from element to fill propertyMap and setup customizer
* @param element TestElement
*/
private void setValues(TestElement element) {
// Copy all property values into the map:
for (PropertyIterator jprops = element.propertyIterator(); jprops.hasNext(); ) {
JMeterProperty jprop = jprops.next();
propertyMap.put(jprop.getName(), jprop.getObjectValue());
}
if (customizer != null) {
customizer.setObject(propertyMap);
} else {
if (initialized) {
remove(customizerIndexInPanel);
}
Customizer c = customizers.computeIfAbsent(element, e -> {
Customizer result = createCustomizer();
result.setObject(propertyMap);
return result;
});
add((Component) c, BorderLayout.CENTER);
}
}
use of org.apache.jmeter.testelement.property.PropertyIterator in project jmeter by apache.
the class AbstractTestElement method traverse.
@Override
public void traverse(TestElementTraverser traverser) {
PropertyIterator iter = propertyIterator();
traverser.startTestElement(this);
while (iter.hasNext()) {
traverseProperty(traverser, iter.next());
}
traverser.endTestElement(this);
}
Aggregations