Search in sources :

Example 1 with DataSourceChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.DataSourceChartGroup in project pinpoint by naver.

the class DataSourceChartGroupSerializerTest method serializeTest.

@Test
public void serializeTest() throws Exception {
    long currentTimeMillis = System.currentTimeMillis();
    TimeWindow timeWindow = new TimeWindow(new Range(currentTimeMillis - 300000, currentTimeMillis));
    List<SampledDataSource> sampledDataSourceList = createSampledDataSourceList(timeWindow);
    DataSourceChartGroup dataSourceChartGroup = new DataSourceChartGroup(timeWindow, sampledDataSourceList, serviceTypeRegistryService);
    String jsonValue = mapper.writeValueAsString(dataSourceChartGroup);
    Map map = mapper.readValue(jsonValue, Map.class);
    Assert.assertTrue(map.containsKey("id"));
    Assert.assertTrue(map.containsKey("jdbcUrl"));
    Assert.assertTrue(map.containsKey("databaseName"));
    Assert.assertTrue(map.containsKey("serviceType"));
    Assert.assertTrue(map.containsKey("charts"));
}
Also used : DataSourceChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.DataSourceChartGroup) SampledDataSource(com.navercorp.pinpoint.web.vo.stat.SampledDataSource) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Map(java.util.Map) Test(org.junit.Test)

Aggregations

TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)1 Range (com.navercorp.pinpoint.web.vo.Range)1 SampledDataSource (com.navercorp.pinpoint.web.vo.stat.SampledDataSource)1 DataSourceChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.DataSourceChartGroup)1 Map (java.util.Map)1 Test (org.junit.Test)1