1 17 package org.apache.servicemix.beanflow; 18 19 import org.apache.servicemix.beanflow.util.ActivityTestSupport; 20 21 25 public class CustomJoinConditionTest extends ActivityTestSupport { 26 27 public void testCustomJoinCondition() throws Exception { 28 final Activity a = new TimeoutActivity(); 31 final Activity b = new TimeoutActivity(); 32 final Activity c = new TimeoutActivity(); 33 34 Activity activity = new JoinSupport(a, b, c) { 36 @Override 37 protected void onChildStateChange(int childCount, int stoppedCount, int failedCount) { 38 39 if (a.isStopped() && (b.isStopped() || c.isStopped())) { 40 stop(); 42 } 43 } 44 }; 45 46 activity.startWithTimeout(timer, timeout); 48 49 assertStarted(activity); 51 52 a.stop(); 53 assertStarted(activity); 54 55 b.stop(); 56 assertStopped(activity); 57 59 c.stop(); 61 assertStopped(activity); 62 } 63 } 64 | Popular Tags |