Search in sources :

Example 66 with CollectionProperty

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

the class PageDataExtractorOverTimeGui method modifyTestElement.

@Override
public void modifyTestElement(TestElement te) {
    super.modifyTestElement(te);
    if (grid.isEditing()) {
        grid.getCellEditor().stopCellEditing();
    }
    if (te instanceof CorrectedResultCollector) {
        CorrectedResultCollector rc = (CorrectedResultCollector) te;
        CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, REGEXPS_PROPERTY);
        rc.setProperty(rows);
    }
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Example 67 with CollectionProperty

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

the class UltimateThreadGroupGui method configure.

@Override
public void configure(TestElement tg) {
    // log.info("Configure");
    super.configure(tg);
    UltimateThreadGroup utg = (UltimateThreadGroup) tg;
    // log.info("Configure "+utg.getName());
    JMeterProperty threadValues = utg.getData();
    if (!(threadValues instanceof NullProperty)) {
        CollectionProperty columns = (CollectionProperty) threadValues;
        tableModel.removeTableModelListener(this);
        JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel);
        tableModel.addTableModelListener(this);
        updateUI();
    } else {
        log.warn("Received null property instead of collection");
    }
    TestElement te = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue();
    if (te != null) {
        loopPanel.configure(te);
    }
    buttons.checkDeleteButtonStatus();
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) NullProperty(org.apache.jmeter.testelement.property.NullProperty) TestElement(org.apache.jmeter.testelement.TestElement)

Example 68 with CollectionProperty

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

the class UltimateThreadGroupGuiTest method getTestData.

private CollectionProperty getTestData() {
    PowerTableModel model = UltimateThreadGroupTest.getTestModel();
    CollectionProperty data = JMeterPluginsUtils.tableModelRowsToCollectionProperty(model, UltimateThreadGroup.DATA_PROPERTY);
    return data;
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel)

Example 69 with CollectionProperty

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

the class UltimateThreadGroupTest method testScheduleThreadAll.

@Test
public void testScheduleThreadAll() {
    System.out.println("scheduleThreadAll");
    HashTree hashtree = new HashTree();
    hashtree.add(new LoopController());
    CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.DATA_PROPERTY);
    instance.setData(prop);
    instance.testStarted();
    for (int n = 0; n < instance.getNumThreads(); n++) {
        JMeterThread thread = new JMeterThread(hashtree, null, null);
        thread.setThreadNum(n);
        instance.scheduleThread(thread);
    }
}
Also used : HashTree(org.apache.jorphan.collections.HashTree) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) JMeterThread(org.apache.jmeter.threads.JMeterThread) LoopController(org.apache.jmeter.control.LoopController)

Example 70 with CollectionProperty

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

the class UltimateThreadGroupTest method testGetData_broken_del.

@Test
public void testGetData_broken_del() {
    CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.EXTERNAL_DATA_PROPERTY);
    instance.setProperty(prop);
    CollectionProperty prop2 = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.DATA_PROPERTY);
    instance.setProperty(prop2);
    JMeterProperty result = instance.getData();
    assertEquals(prop2, instance.getProperty(UltimateThreadGroup.DATA_PROPERTY));
    assertTrue(instance.getProperty(UltimateThreadGroup.EXTERNAL_DATA_PROPERTY) instanceof NullProperty);
    assertFalse(result instanceof NullProperty);
    assertEquals(prop.getStringValue(), result.getStringValue());
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) NullProperty(org.apache.jmeter.testelement.property.NullProperty)

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