String expected = Files.forIO().readFrom(getClass().getResourceAsStream("matrix_analyzer.xml"), "utf-8");
Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
}
protected MessageTree generateMessageTree(int i) {
MessageTree tree = new DefaultMessageTree();
tree.setMessageId("" + i);
tree.setDomain(m_domain);
tree.setHostName("group001");
tree.setIpAddress("192.168.1.1");
DefaultTransaction t;
DefaultTransaction event;
if (i % 3 == 0) {
t = new DefaultTransaction("URL", "Cat-Test-Call", null);
event = new DefaultTransaction("Call", "192.168.1.0:3000:class:method1", null);
} else if (i % 3 == 1) {
t = new DefaultTransaction("PigeonService", "Cat-Test-Service", null);
event = new DefaultTransaction("SQL", "192.168.1.2:3000:class:method2", null);
} else {
t = new DefaultTransaction("Service", "Cat-Test-Service", null);
event = new DefaultTransaction("Cache.CatTest", "192.168.1.2:3000:class:method2", null);
}
event.setTimestamp(m_timestamp + 5 * 60 * 1000);
event.setDurationInMillis(i);
event.setStatus(Message.SUCCESS);
t.addChild(event);
t.complete();
t.setDurationInMillis(i * 2);
t.setTimestamp(m_timestamp + 1000);
tree.setMessage(t);
return tree;
}