String expected = Files.forIO().readFrom(getClass().getResourceAsStream("transaction_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 = new DefaultTransaction("A", "n" + i % 2, null);
DefaultTransaction t2 = new DefaultTransaction("A-1", "n" + i % 3, null);
if (i % 2 == 0) {
t2.setStatus("ERROR");
} else {
t2.setStatus(Message.SUCCESS);
}
t2.complete();
t2.setDurationInMillis(i);
t.addChild(t2);
if (i % 2 == 0) {
t.setStatus("ERROR");
} else {
t.setStatus(Message.SUCCESS);
}
t.complete();
t.setDurationInMillis(i * 2);
t.setTimestamp(m_timestamp + 1000);
t2.setTimestamp(m_timestamp + 2000);
tree.setMessage(t);
return tree;
}