Search in sources :

Example 1 with JsonizerVisitor

use of org.apache.jmeter.report.dashboard.JsonizerVisitor in project jmeter by apache.

the class CustomGraphConsumerTest method testInitializeExtraResults.

@Test
public void testInitializeExtraResults() {
    customGraphConsumer.initializeExtraResults(resultData);
    JsonizerVisitor jsonizer = new JsonizerVisitor();
    for (Map.Entry<String, ResultData> entrySet : resultData.entrySet()) {
        Object testedValue = entrySet.getValue().accept(jsonizer);
        String key = entrySet.getKey();
        if (key.equals("granularity")) {
            assertThat(testedValue, equalTo("60000"));
        } else if (key.equals("X_Axis")) {
            assertThat(testedValue, equalTo("\"X axis name\""));
        } else if (key.equals("Y_Axis")) {
            assertThat(testedValue, equalTo("\"Y axis name\""));
        } else if (key.equals("sample_Metric_Name")) {
            assertThat(testedValue, equalTo("\"ulp_lag_ratio\""));
        } else if (key.equals("content_Message")) {
            assertThat(testedValue, equalTo("\"content message\""));
        }
    }
}
Also used : MapResultData(org.apache.jmeter.report.processor.MapResultData) ResultData(org.apache.jmeter.report.processor.ResultData) JsonizerVisitor(org.apache.jmeter.report.dashboard.JsonizerVisitor) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 JsonizerVisitor (org.apache.jmeter.report.dashboard.JsonizerVisitor)1 MapResultData (org.apache.jmeter.report.processor.MapResultData)1 ResultData (org.apache.jmeter.report.processor.ResultData)1 Test (org.junit.jupiter.api.Test)1