use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method testFindToLink.
@Test
public void testFindToLink() {
Link tomcatToBlocLink = createTomcatToBlocLink();
LinkList list = new LinkList();
list.addLink(tomcatToBlocLink);
Link tomcatToTomcatLink = createTomcatToTomcatLink();
list.addLink(tomcatToTomcatLink);
// find all links requesting "to"
Application toBloc = new Application("to", BLOC);
List<Link> findToLink = list.findToLink(toBloc);
Assert.assertEquals(findToLink.size(), 1);
for (Link link : findToLink) {
Application to = link.getTo().getApplication();
Assert.assertEquals(toBloc + " " + to, toBloc, to);
}
List<Link> unknown = list.findToLink(new Application("unknown", BLOC));
Assert.assertEquals(unknown.size(), 0);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class NodeHistogramAppenderTest method emptyNodeList.
@Test
public void emptyNodeList() {
// Given
Range range = Range.newRange(0, 60 * 1000);
NodeList nodeList = new NodeList();
LinkList linkList = new LinkList();
// When
nodeHistogramAppender.appendNodeHistogram(range, nodeList, linkList, buildTimeoutMillis);
// Then
Assert.assertTrue(nodeList.getNodeList().isEmpty());
verifyZeroInteractions(wasNodeHistogramDataSource);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method testFindFromLink.
@Test
public void testFindFromLink() {
Link tomcatToBlocLink = createTomcatToBlocLink();
LinkList list = new LinkList();
list.addLink(tomcatToBlocLink);
Link tomcatToTomcatLink = createTomcatToTomcatLink();
list.addLink(tomcatToTomcatLink);
// find all links for "from" to request
Application tomcat = new Application("from", TOMCAT);
List<Link> findFromLink = list.findFromLink(tomcat);
Assert.assertEquals(findFromLink.size(), 2);
for (Link link : findFromLink) {
Application linkFrom = link.getFrom().getApplication();
Assert.assertEquals(linkFrom, tomcat);
}
List<Link> unknown = list.findFromLink(new Application("unknown", TOMCAT));
Assert.assertEquals(unknown.size(), 0);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method addLinkList.
@Test
public void addLinkList() {
Link tomcatToTomcatLink = createTomcatToTomcatLink();
LinkList copy = new LinkList();
copy.addLink(tomcatToTomcatLink);
LinkList original = new LinkList();
original.addLinkList(copy);
Assert.assertEquals(original.size(), 1);
// don't copy in case of duplicated node
original.addLinkList(copy);
Assert.assertEquals(original.size(), 1);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method testGetLinkList.
@Test
public void testGetLinkList() {
LinkList linkList = new LinkList();
Assert.assertEquals(linkList.getLinkList().size(), 0);
}
Aggregations