use of org.apache.jmeter.testelement.property.NullProperty in project jmeter-plugins by undera.
the class UltimateThreadGroupTest method testGetData_broken_rename.
@Test
public void testGetData_broken_rename() {
CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.EXTERNAL_DATA_PROPERTY);
instance.setProperty(prop);
JMeterProperty result = instance.getData();
assertNotNull(instance.getProperty(UltimateThreadGroup.DATA_PROPERTY));
assertTrue(instance.getProperty(UltimateThreadGroup.EXTERNAL_DATA_PROPERTY) instanceof NullProperty);
assertFalse(result instanceof NullProperty);
assertEquals(prop.getStringValue(), result.getStringValue());
}
use of org.apache.jmeter.testelement.property.NullProperty in project jmeter-plugins by undera.
the class UltimateThreadGroup method getNumThreads.
@Override
public int getNumThreads() {
int result = 0;
JMeterProperty threadValues = getData();
if (!(threadValues instanceof NullProperty)) {
CollectionProperty columns = (CollectionProperty) threadValues;
List<?> rows = (List<?>) columns.getObjectValue();
for (Object row1 : rows) {
CollectionProperty prop = (CollectionProperty) row1;
ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue();
// log.info(prop.getStringValue());
result += row.get(0).getIntValue();
}
}
return result;
}
use of org.apache.jmeter.testelement.property.NullProperty 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.NullProperty in project jmeter-plugins by undera.
the class MergeResultsGui method configure.
@Override
public void configure(TestElement el) {
super.configure(el);
setFile(el.getPropertyAsString(CorrectedResultCollector.FILENAME));
JMeterProperty fileValues = el.getProperty(DATA_PROPERTY);
if (!(fileValues instanceof NullProperty)) {
CollectionProperty columns = (CollectionProperty) fileValues;
tableModel.removeTableModelListener(this);
JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel, columnClasses);
tableModel.addTableModelListener(this);
updateUI();
} else {
log.warn("Received null property instead of collection");
}
checkDeleteButtonStatus();
checkMergeButtonStatus();
startTimeRef = 0;
}
use of org.apache.jmeter.testelement.property.NullProperty in project jmeter-plugins by undera.
the class ParameterizedControllerGui method configure.
@Override
public void configure(TestElement te) {
super.configure(te);
ParameterizedController controller = (ParameterizedController) te;
final JMeterProperty udv = controller.getUserDefinedVariablesAsProperty();
if (udv != null && !(udv instanceof NullProperty)) {
argsPanel.configure((Arguments) udv.getObjectValue());
}
}
Aggregations