use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class PageDataExtractorOverTimeGui method add.
@Override
public void add(SampleResult res) {
super.add(res);
if (regExps == null && cmdRegExps == null) {
return;
}
String pageBody = res.getResponseDataAsString();
long time = normalizeTime(res.getEndTime());
if (cmdRegExps == null) {
PropertyIterator iter = regExps.iterator();
while (iter.hasNext()) {
CollectionProperty props = (CollectionProperty) iter.next();
String label = props.get(0).getStringValue();
String regExpValue = props.get(1).getStringValue();
Boolean isDelta = props.get(2).getBooleanValue();
Boolean isLabelRegExp = props.get(3).getBooleanValue();
if (isLabelRegExp) {
processPageRegExpLabel(pageBody, label, regExpValue, isDelta, time);
} else {
processPageLabel(pageBody, label, regExpValue, isDelta, time);
}
}
} else {
Iterator<Object> regExpIter = cmdRegExps.iterator();
while (regExpIter.hasNext()) {
String label = (String) regExpIter.next();
String regExpValue = (String) regExpIter.next();
boolean isDelta = (Boolean) regExpIter.next();
boolean isLabelRegExp = (Boolean) regExpIter.next();
if (isLabelRegExp) {
processPageRegExpLabel(pageBody, label, regExpValue, isDelta, time);
} else {
processPageLabel(pageBody, label, regExpValue, isDelta, time);
}
}
}
updateGui(null);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class FirefoxDriverConfig method addExtensions.
private void addExtensions(FirefoxProfile profile) {
JMeterProperty property = getProperty(EXTENSIONS_TO_LOAD);
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 filename = ((JMeterProperty) row.get(0)).getStringValue();
try {
profile.addExtension(new File(filename));
} catch (IOException e) {
log.error("Failed to add extension " + filename, e);
}
}
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class VariableThroughputTimerGui method configure.
@Override
public void configure(TestElement tg) {
// log.info("Configure");
super.configure(tg);
VariableThroughputTimer utg = (VariableThroughputTimer) tg;
JMeterProperty threadValues = utg.getData();
if (threadValues instanceof NullProperty) {
log.warn("Received null property instead of collection");
return;
}
CollectionProperty columns = (CollectionProperty) threadValues;
tableModel.removeTableModelListener(this);
JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel);
tableModel.addTableModelListener(this);
buttons.checkDeleteButtonStatus();
updateUI();
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class VariableThroughputTimerGuiTest method testConfigure.
/**
*/
@Test
public void testConfigure() {
System.out.println("configure");
VariableThroughputTimer tg = new VariableThroughputTimer();
CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, VariableThroughputTimer.DATA_PROPERTY);
tg.setData(rows);
VariableThroughputTimerGui instance = new VariableThroughputTimerGui();
// tg.setProperty(new ObjectProperty(AbstractThreadGroup.MAIN_CONTROLLER, tg));
instance.configure(tg);
Assert.assertEquals(4, instance.tableModel.getRowCount());
Assert.assertEquals(4, instance.grid.getRowCount());
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class VariableThroughputTimerTest method testGetData.
/**
* Test of getData method, of class VariableThroughputTimer.
*/
@Test
public void testGetData() {
System.out.println("getData");
VariableThroughputTimer instance = new VariableThroughputTimer();
instance.setData(new CollectionProperty(VariableThroughputTimer.DATA_PROPERTY, new LinkedList()));
JMeterProperty result = instance.getData();
// System.err.println(result.getClass().getCanonicalName());
assertTrue(result instanceof CollectionProperty);
}
Aggregations