boolean testDoneAtLeastOnce = false;
for (TreeNode node : nodes.list()) {
assertEquals(newClient, node.getClient());
// also ignore 0 as there is a business partner/sales region tree node with 0
if (node.getNode() != null && !node.getNode().equals("0")) {
final Entity entity = ModelProvider.getInstance().getEntityFromTreeType(
node.getTree().getTypeArea());
if (entity.getName().equals(Project.ENTITY_NAME)) {
// can be removed when this issue:
// https://issues.openbravo.com/view.php?id=8745
// is solved
continue;
}
final BaseOBObject bob = OBDal.getInstance().get(entity.getName(), node.getNode());
assertTrue("Entity instance not found " + entity.getName() + " " + node.getNode(),
bob != null);
if (bob instanceof ClientEnabled) {
assertEquals(newClient, ((ClientEnabled) bob).getClient());
testDoneAtLeastOnce = true;
}
}
// also ignore 0 as there is a business partner/sales region tree node with 0
if (node.getReportSet() != null && !node.getReportSet().equals("0")) {
final Entity entity = ModelProvider.getInstance().getEntityFromTreeType(
node.getTree().getTypeArea());
if (entity.getName().equals(Project.ENTITY_NAME)) {
// can be removed when this issue:
// https://issues.openbravo.com/view.php?id=8745
// is solved
continue;
}
final BaseOBObject bob = OBDal.getInstance().get(entity.getName(), node.getReportSet());
assertTrue("Entity instance not found " + entity.getName() + " " + node.getReportSet(),
bob != null);
if (bob instanceof ClientEnabled) {
assertEquals(newClient, ((ClientEnabled) bob).getClient());
testDoneAtLeastOnce = true;
}