use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.
the class ApplicationMapBuilderTestHelper method createLinkDataDuplexMap.
public static LinkDataDuplexMap createLinkDataDuplexMap(int calleeDepth, int callerDepth) {
if (calleeDepth < 1) {
throw new IllegalArgumentException("calleeDepth must be greater than 0");
}
if (callerDepth < 1) {
throw new IllegalArgumentException("callerDepth must be greater than 0");
}
LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
for (int i = 0; i < calleeDepth - 1; i++) {
LinkData targetLinkData = createTargetLinkData(i);
linkDataDuplexMap.addTargetLinkData(targetLinkData);
}
linkDataDuplexMap.addTargetLinkData(createUserTargetLinkData(calleeDepth - 1));
linkDataDuplexMap.addSourceLinkData(createTerminalSourceLinkData(0));
for (int i = 0; i < callerDepth - 1; i++) {
LinkData sourceLinkData = createSourceLinkData(i);
linkDataDuplexMap.addSourceLinkData(sourceLinkData);
}
linkDataDuplexMap.addSourceLinkData(createUnknownSourceLinkData(callerDepth - 1));
return linkDataDuplexMap;
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.
the class ServerInfoAppenderTest method emptyNodeList.
@Test
public void emptyNodeList() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
// When
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
// Then
Assert.assertTrue(nodeList.getNodeList().isEmpty());
verifyZeroInteractions(serverInstanceListDataSource);
verifyZeroInteractions(linkDataDuplexMap);
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap 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.rawdata.LinkDataDuplexMap 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.rawdata.LinkDataDuplexMap 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);
}
Aggregations