use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.
the class TFDataSourceBoMapper method map.
public TFDataSource map(DataSourceBo dataSourceBo) {
TFDataSource tFDataSource = new TFDataSource();
tFDataSource.setId(dataSourceBo.getId());
tFDataSource.setServiceTypeCode(dataSourceBo.getServiceTypeCode());
tFDataSource.setDatabaseName(dataSourceBo.getDatabaseName());
tFDataSource.setUrl(dataSourceBo.getJdbcUrl());
tFDataSource.setActiveConnectionSize(dataSourceBo.getActiveConnectionSize());
tFDataSource.setMaxConnectionSize(dataSourceBo.getMaxConnectionSize());
return tFDataSource;
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.
the class TFDataSourceBoMapperTest method mapTest.
@Test
public void mapTest() {
DataSourceBo dataSourceBo = new DataSourceBo();
dataSourceBo.setId(1);
dataSourceBo.setJdbcUrl("jdbc:mysql");
dataSourceBo.setDatabaseName("pinpoint");
dataSourceBo.setServiceTypeCode((short) 1000);
dataSourceBo.setTimestamp(timestamp);
dataSourceBo.setActiveConnectionSize(15);
dataSourceBo.setMaxConnectionSize(30);
TFDataSourceBoMapper mapper = new TFDataSourceBoMapper();
TFDataSource tFdataSource = mapper.map(dataSourceBo);
assertEquals(tFdataSource.getId(), 1);
assertEquals(tFdataSource.getServiceTypeCode(), 1000);
assertEquals(tFdataSource.getDatabaseName(), "pinpoint");
assertEquals(tFdataSource.getUrl(), "jdbc:mysql");
assertEquals(tFdataSource.getActiveConnectionSize(), 15);
assertEquals(tFdataSource.getMaxConnectionSize(), 30);
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFDataSource in project pinpoint by naver.
the class JoinDataSourceListBoMapperTest method map2Test.
@Test
public void map2Test() {
JoinDataSourceListBoMapper mapper = new JoinDataSourceListBoMapper();
TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
JoinDataSourceListBo joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
TFDataSourceList tFDataSourceList = new TFDataSourceList();
tFAgentStat.setDataSourceList(tFDataSourceList);
joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
List<TFDataSource> dataSourceList = new ArrayList<>();
tFDataSourceList.setDataSourceList(dataSourceList);
joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
}
Aggregations