Search in sources :

Example 71 with CollectionProperty

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

the class UltimateThreadGroupTest method testSetData.

@Test
public void testSetData() {
    System.out.println("setSchedule");
    CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.DATA_PROPERTY);
    instance.setData(prop);
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Example 72 with CollectionProperty

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

the class UltimateThreadGroupTest method testGetData.

@Test
public void testGetData() {
    System.out.println("getSchedule");
    CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.DATA_PROPERTY);
    instance.setData(prop);
    JMeterProperty result = instance.getData();
    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 73 with CollectionProperty

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

the class DbMonCollectorTest method testSetData.

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

Example 74 with CollectionProperty

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

the class FreeFormArrivalsThreadGroup method setData.

public void setData(PowerTableModel model) {
    CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(model, SCHEDULE);
    setProperty(prop);
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty)

Example 75 with CollectionProperty

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

the class FreeFormArrivalsThreadStarter method getCurrentRate.

@Override
protected double getCurrentRate() {
    CollectionProperty data = arrivalsTG.getData();
    PropertyIterator it = data.iterator();
    int offset = 0;
    while (it.hasNext()) {
        CollectionProperty record = (CollectionProperty) it.next();
        double chunkLen = record.get(2).getDoubleValue() * arrivalsTG.getUnitFactor();
        double timeProgress = this.rollingTime / 1000.0 - startTime;
        double chunkProgress = (timeProgress - offset) / chunkLen;
        offset += chunkLen;
        if (timeProgress <= offset) {
            double chunkStart = record.get(0).getDoubleValue() / arrivalsTG.getUnitFactor();
            double chunkEnd = record.get(1).getDoubleValue() / arrivalsTG.getUnitFactor();
            double chunkHeight = chunkEnd - chunkStart;
            return chunkStart + chunkProgress * chunkHeight;
        }
    }
    log.info("Got no further schedule, can stop now");
    return -1;
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) PropertyIterator(org.apache.jmeter.testelement.property.PropertyIterator)

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