use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.
the class ServerInfoAppenderTest method userNode.
@Test
public void userNode() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
Node userNode = new Node(new Application("User", ServiceType.USER));
nodeList.addNode(userNode);
// When
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
// Then
Assert.assertEquals(0, userNode.getServerInstanceList().getInstanceCount());
verifyZeroInteractions(linkDataDuplexMap);
}
use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.
the class ServerInfoAppenderTest method wasNode.
@Test
public void wasNode() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
Node wasNode = new Node(new Application("Was", ServiceType.TEST_STAND_ALONE));
nodeList.addNode(wasNode);
ServerInstanceList serverInstanceList = new ServerInstanceList();
when(serverInstanceListDataSource.createServerInstanceList(wasNode, range.getTo())).thenReturn(serverInstanceList);
// When
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
// Then
Assert.assertSame(serverInstanceList, wasNode.getServerInstanceList());
verifyZeroInteractions(linkDataDuplexMap);
}
use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.
the class ServerInfoAppenderTest method wasNodes.
@Test
public void wasNodes() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
Node wasNode1 = new Node(new Application("Was1", ServiceType.TEST_STAND_ALONE));
nodeList.addNode(wasNode1);
Node wasNode2 = new Node(new Application("Was2", ServiceType.TEST_STAND_ALONE));
nodeList.addNode(wasNode2);
ServerInstanceList serverInstanceList1 = new ServerInstanceList();
when(serverInstanceListDataSource.createServerInstanceList(wasNode1, range.getTo())).thenReturn(serverInstanceList1);
ServerInstanceList serverInstanceList2 = new ServerInstanceList();
when(serverInstanceListDataSource.createServerInstanceList(wasNode2, range.getTo())).thenReturn(serverInstanceList2);
// When
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
// Then
Assert.assertSame(serverInstanceList1, wasNode1.getServerInstanceList());
Assert.assertSame(serverInstanceList2, wasNode2.getServerInstanceList());
verifyZeroInteractions(linkDataDuplexMap);
}
use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.
the class ServerInfoAppenderTest method unknownNode.
@Test
public void unknownNode() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
Node unknownNode = new Node(new Application("Unknown", ServiceType.UNKNOWN));
nodeList.addNode(unknownNode);
// When
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
// Then
Assert.assertEquals(0, unknownNode.getServerInstanceList().getInstanceCount());
verifyZeroInteractions(linkDataDuplexMap);
}
use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.
the class ApplicationMapTest method root.
@Test
public void root() throws IOException {
ApplicationMap app = new DefaultApplicationMap(Range.newRange(0, 1), new NodeList(), new LinkList());
String s = MAPPER.writeValueAsString(app);
logger.debug(s);
}
Aggregations