Search in sources :

Example 11 with CollectionProperty

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);
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) NullProperty(org.apache.jmeter.testelement.property.NullProperty)

Example 12 with CollectionProperty

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);
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Example 13 with CollectionProperty

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);
    }
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) ArrayList(java.util.ArrayList)

Example 14 with CollectionProperty

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);
}
Also used : DbMonCollector(kg.apc.jmeter.dbmon.DbMonCollector) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Example 15 with CollectionProperty

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);
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Aggregations

CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)91 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)29 ArrayList (java.util.ArrayList)19 NullProperty (org.apache.jmeter.testelement.property.NullProperty)13 Test (org.junit.Test)11 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)8 Test (org.junit.jupiter.api.Test)7 IOException (java.io.IOException)5 List (java.util.List)4 StringProperty (org.apache.jmeter.testelement.property.StringProperty)4 File (java.io.File)3 Argument (org.apache.jmeter.config.Argument)3 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)3 TestPlan (org.apache.jmeter.testelement.TestPlan)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 Field (java.lang.reflect.Field)2 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 UnknownHostException (java.net.UnknownHostException)2 LinkedList (java.util.LinkedList)2