+
+ private static final class ConditionTraceChildrenElements implements IWaitCondition {
+ private final ITmfProjectModelElement fProjectElement;
+ private int fCurNumChildren;
+ private int fExpectedChildNum;
+
+ private ConditionTraceChildrenElements(ITmfProjectModelElement projectElement, int childNum) {
+ fProjectElement = projectElement;
+ fExpectedChildNum = childNum;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ fCurNumChildren = fProjectElement.getChildren().size();
+ return fCurNumChildren == fExpectedChildNum;
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "Timeout while waiting for " + fProjectElement + " to have number of children. Expected: " + fExpectedChildNum + " Actual: " + fCurNumChildren;
+ }
+ }