TagProcessor tp = new TagProcessor();
int count = 0;
Tag tag = null;
for (String line : lines)
{
tag = tp.processLine(line);
if (count++ < lines.length - 1)
{
assertNull(tag);
}
}
assertNotNull(tag);
assertEquals("phase", tag.getName());
assertEquals(2, tag.getChildren().size());
Tag child0 = tag.getChildren().get(0);
assertEquals("loop_tree", child0.getName());
assertEquals(0, child0.getAttrs().size());
assertEquals(2, child0.getChildren().size());
Tag child01 = child0.getChildren().get(0);
assertEquals("loop", child01.getName());
assertEquals("1124", child01.getAttribute("idx"));
Tag child02 = child0.getChildren().get(1);
assertEquals("loop", child02.getName());
assertEquals("1012", child02.getAttribute("idx"));
assertEquals("1", child02.getAttribute("inner_loop"));
Tag child1 = tag.getChildren().get(1);
assertEquals("phase_done", child1.getName());
assertEquals(2, child1.getAttrs().size());
assertEquals(0, child1.getChildren().size());
assertEquals("1144", child1.getAttribute("nodes"));
assertEquals("14.151", child1.getAttribute("stamp"));
}