@Test public void testSequenceSuccess () throws InterruptedException { AdaptationTree root = new AdaptationTree<> (AdaptationExecutionOperatorT.SEQUENCE_STOP_SUCCESS); root.addLeaf (new ExecutableTest (1)); root.addLeaf (new ExecutableTest (2, false)); root.addLeaf (new ExecutableTest (3)); CountDownLatch countdownLatch = new CountDownLatch (1); DefaultAdaptationExecutorVisitor<IEvaluable> visitor = new TestAdaptationVisitor (root, new ThreadGroup ("test"), countdownLatch); visitor.start (); countdownLatch.await (5, TimeUnit.SECONDS); assertTrue (numbers.size () == 1); assertTrue (numbers.get (0) == 1); }
public void addLeaf (T root, T leaf) { addLeaf (root).addLeaf (leaf); }
AdaptationTree { public void addLeaf (T root, T leaf) { addLeaf (root).addLeaf (leaf); } }
AdaptationTree { public void addLeaf (T root, T leaf) { addLeaf (root).addLeaf (leaf); } AdaptationTree(T head);  AdaptationTree(AdaptationExecutionOperatorT operator); }
AdaptationTree { public void addLeaf (T root, T leaf) { addLeaf (root).addLeaf (leaf); } AdaptationTree(T head);  AdaptationTree(AdaptationExecutionOperatorT operator); void setId(String id); String getId(); void addLeaf(T root, T leaf); AdaptationTree<T> addLeaf(T leaf); AdaptationTree<T> setAsParent(T parentRoot); T getHead(); AdaptationTree<T> getParent(); Collection<AdaptationTree<T>> getSubTrees(); AdaptationExecutionOperatorT getOperator(); @Override String toString(); boolean visit(IAdaptationVisitor<T> visitor); }
AdaptationTree { public void addLeaf (T root, T leaf) { addLeaf (root).addLeaf (leaf); } AdaptationTree(T head);  AdaptationTree(AdaptationExecutionOperatorT operator); void setId(String id); String getId(); void addLeaf(T root, T leaf); AdaptationTree<T> addLeaf(T leaf); AdaptationTree<T> setAsParent(T parentRoot); T getHead(); AdaptationTree<T> getParent(); Collection<AdaptationTree<T>> getSubTrees(); AdaptationExecutionOperatorT getOperator(); @Override String toString(); boolean visit(IAdaptationVisitor<T> visitor);  }