use of com.github.bordertech.wcomponents.monitor.UicStats.Stat in project wcomponents by BorderTech.
the class UicStats_Test method testGetWCTreeStats.
/**
* Test getWCTreeStats.
*/
@Test
public void testGetWCTreeStats() {
stats.analyseWC(app);
Map<WComponent, Stat> resultStats = stats.getWCTreeStats(app);
// label
for (Map.Entry<WComponent, Stat> entry : resultStats.entrySet()) {
WComponent comp = entry.getKey();
Stat stat = entry.getValue();
if (comp instanceof WLabel) {
Assert.assertEquals("this should be the label created", label, comp);
Assert.assertEquals("stat should have correct label name", label.getId(), stat.getName());
} else if (comp instanceof WButton) {
Assert.assertEquals("this should be the button in the app", button, comp);
Assert.assertEquals("stat should have correct button name", button.getId(), stat.getName());
} else if (comp instanceof WApplication) {
Assert.assertEquals("this should be the app", app, comp);
Assert.assertEquals("stat should have correct app name", app.getId(), stat.getName());
}
}
}
Aggregations