Search in sources :

Example 6 with AbstractGraphPanelChartElement

use of kg.apc.charting.AbstractGraphPanelChartElement in project jmeter-plugins by undera.

the class GraphRowPercentilesTest method testIterator_req2.

@Test
public void testIterator_req2() {
    System.out.println("iterator 2req");
    GraphRowPercentiles instance = new GraphRowPercentiles();
    instance.add(10, 1);
    instance.add(20, 1);
    Iterator<Entry<Long, AbstractGraphPanelChartElement>> result = instance.iterator();
    Assert.assertNotNull(result);
    Assert.assertTrue(result.hasNext());
    int cnt = 0;
    while (result.hasNext()) {
        Entry<Long, AbstractGraphPanelChartElement> obj = result.next();
        Assert.assertNotNull(obj);
        // System.err.println(cnt + " " + obj.getValue().getValue());
        assertEquals(cnt < 500 ? 10 : 20, obj.getValue().getValue(), 0.01);
        cnt++;
    }
    Assert.assertEquals(expectedCount, cnt);
}
Also used : Entry(java.util.Map.Entry) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement) GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Example 7 with AbstractGraphPanelChartElement

use of kg.apc.charting.AbstractGraphPanelChartElement in project jmeter-plugins by undera.

the class GraphRowAveragesTest method testGetLowerElement.

/**
 * Test of getLowerElement method, of class GraphRowAverages.
 */
@Test
public void testGetLowerElement() {
    System.out.println("getLowerElement");
    long value = 0L;
    AbstractGraphPanelChartElement expResult = null;
    AbstractGraphPanelChartElement result = instance.getLowerElement(value);
    assertEquals(expResult, result);
}
Also used : AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement)

Example 8 with AbstractGraphPanelChartElement

use of kg.apc.charting.AbstractGraphPanelChartElement in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testSetValue.

/**
 * Test of setValue method, of class GraphRowOverallAverages.
 */
@Test
public void testSetValue() {
    System.out.println("setValue");
    GraphPanelChartAverageElement value = null;
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    try {
        AbstractGraphPanelChartElement result = instance.setValue(value);
        Assert.fail("Exception expected");
    } catch (UnsupportedOperationException e) {
    }
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages) GraphPanelChartAverageElement(kg.apc.charting.elements.GraphPanelChartAverageElement) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement)

Example 9 with AbstractGraphPanelChartElement

use of kg.apc.charting.AbstractGraphPanelChartElement in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testGetElement.

/**
 * Test of getElement method, of class GraphRowOverallAverages.
 */
@Test
public void testGetElement() {
    System.out.println("getElement");
    long value = 100L;
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    AbstractGraphPanelChartElement expResult = new GraphPanelChartAverageElement(10);
    instance.add(value, 10);
    AbstractGraphPanelChartElement result = instance.getElement(value);
    Assert.assertTrue(instance.getElement(value).getValue() == expResult.getValue());
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages) GraphPanelChartAverageElement(kg.apc.charting.elements.GraphPanelChartAverageElement) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement)

Example 10 with AbstractGraphPanelChartElement

use of kg.apc.charting.AbstractGraphPanelChartElement in project jmeter-plugins by undera.

the class GraphRowPercentilesTest method testIterator_req3.

@Test
public void testIterator_req3() {
    System.out.println("iterator 3req");
    GraphRowPercentiles instance = new GraphRowPercentiles();
    for (int n = 0; n < expectedCount; n++) {
        instance.add(n, 1);
    }
    Iterator<Entry<Long, AbstractGraphPanelChartElement>> result = instance.iterator();
    Assert.assertNotNull(result);
    Assert.assertTrue(result.hasNext());
    int cnt = 0;
    while (result.hasNext()) {
        Entry<Long, AbstractGraphPanelChartElement> obj = result.next();
        Assert.assertNotNull(obj);
        // System.err.println(cnt + " " + obj.getValue().getValue());
        assertEquals(cnt, obj.getValue().getValue(), 0.01);
        cnt++;
    }
    Assert.assertEquals(expectedCount, cnt);
}
Also used : Entry(java.util.Map.Entry) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement) GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Aggregations

AbstractGraphPanelChartElement (kg.apc.charting.AbstractGraphPanelChartElement)13 Entry (java.util.Map.Entry)5 GraphRowPercentiles (kg.apc.charting.rows.GraphRowPercentiles)4 GraphPanelChartAverageElement (kg.apc.charting.elements.GraphPanelChartAverageElement)3 GraphPanelChartExactElement (kg.apc.charting.elements.GraphPanelChartExactElement)2 GraphRowOverallAverages (kg.apc.charting.rows.GraphRowOverallAverages)2 BasicStroke (java.awt.BasicStroke)1 Stroke (java.awt.Stroke)1 GraphPanelChartSimpleElement (kg.apc.charting.elements.GraphPanelChartSimpleElement)1 GraphPanelChartSumElement (kg.apc.charting.elements.GraphPanelChartSumElement)1 GraphRowExactValues (kg.apc.charting.rows.GraphRowExactValues)1