Search in sources :

Example 6 with NullProperty

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

Example 7 with NullProperty

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

Example 8 with NullProperty

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

Example 9 with NullProperty

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

Example 10 with NullProperty

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

Aggregations

NullProperty (org.apache.jmeter.testelement.property.NullProperty)26 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)24 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)13 ArrayList (java.util.ArrayList)4 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)3 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)3 List (java.util.List)2 TestElement (org.apache.jmeter.testelement.TestElement)2 StringProperty (org.apache.jmeter.testelement.property.StringProperty)2 Test (org.junit.Test)2 FirefoxDriverConfig (com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig)1 File (java.io.File)1 IOException (java.io.IOException)1 InetAddress (java.net.InetAddress)1 UnknownHostException (java.net.UnknownHostException)1 DbMonCollector (kg.apc.jmeter.dbmon.DbMonCollector)1 JMXMonCollector (kg.apc.jmeter.jmxmon.JMXMonCollector)1 PerfMonCollector (kg.apc.jmeter.perfmon.PerfMonCollector)1 CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)1 MonitoringResultsCollector (kg.apc.jmeter.vizualizers.MonitoringResultsCollector)1