Search in sources :

Example 26 with CollectionProperty

use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.

the class VariableThroughputTimerTest method testSetData.

/**
 * Test of setData method, of class VariableThroughputTimer.
 */
@Test
public void testSetData() {
    System.out.println("setData");
    CollectionProperty rows = new CollectionProperty();
    VariableThroughputTimer instance = new VariableThroughputTimer();
    instance.setData(rows);
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) Test(org.junit.Test)

Example 27 with CollectionProperty

use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.

the class PerfMonGui method modifyTestElement.

@Override
public void modifyTestElement(TestElement te) {
    super.modifyTestElement(te);
    if (grid.isEditing()) {
        grid.getCellEditor().stopCellEditing();
    }
    if (te instanceof PerfMonCollector) {
        PerfMonCollector pmte = (PerfMonCollector) te;
        CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, PerfMonCollector.DATA_PROPERTY);
        pmte.setData(rows);
    }
    super.configureTestElement(te);
}
Also used : PerfMonCollector(kg.apc.jmeter.perfmon.PerfMonCollector) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Example 28 with CollectionProperty

use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.

the class PerfMonCollectorTest method testSetData.

/**
 * Test of setData method, of class PerfMonCollector.
 */
@Test
public void testSetData() {
    System.out.println("setData");
    CollectionProperty rows = new CollectionProperty();
    PerfMonCollector instance = new PerfMonCollector();
    instance.setData(rows);
// TODO review the generated test code and remove the default call to fail.
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) Test(org.junit.Test)

Example 29 with CollectionProperty

use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.

the class PerfMonCollector method initiateConnectors.

private void initiateConnectors() {
    oldValues.clear();
    JMeterProperty prop = getMetricSettings();
    connectors.clear();
    if (!(prop instanceof CollectionProperty)) {
        log.warn("Got unexpected property: " + prop);
        return;
    }
    CollectionProperty rows = (CollectionProperty) prop;
    for (int i = 0; i < rows.size(); i++) {
        Object val = rows.get(i).getObjectValue();
        if (val instanceof ArrayList) {
            ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) val;
            String host = row.get(0).getStringValue();
            int port = row.get(1).getIntValue();
            String metric = row.get(2).getStringValue();
            String params = row.get(3).getStringValue();
            initiateConnector(host, port, i, metric, params);
        }
    }
    for (Object key : connectors.keySet()) {
        try {
            connectors.get(key).connect();
        } catch (IOException ex) {
            log.error("Error connecting to agent", ex);
            connectors.put(key, new UnavailableAgentConnector(ex));
        }
    }
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) IOException(java.io.IOException)

Example 30 with CollectionProperty

use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.

the class CompositeGraphGui method getConfig.

private CollectionProperty getConfig() {
    CollectionProperty ret = new CollectionProperty();
    CollectionProperty testplans = new CollectionProperty();
    CollectionProperty rows = new CollectionProperty();
    ret.setName(CONFIG_PROPERTY);
    Iterator<String[]> iter = compositeRowsSelectorPanel.getItems();
    while (iter.hasNext()) {
        String[] item = iter.next();
        testplans.addItem(item[0]);
        rows.addItem(item[1]);
    }
    ret.addItem(testplans);
    ret.addItem(rows);
    return ret;
}
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