1 17 package org.apache.servicemix.beanflow; 18 19 import org.apache.servicemix.beanflow.util.ActivityTestSupport; 20 21 import java.util.concurrent.Executor ; 22 import java.util.concurrent.Executors ; 23 import java.util.concurrent.TimeUnit ; 24 25 29 public class ParallelActivityTest extends ActivityTestSupport { 30 31 protected Executor executor = Executors.newFixedThreadPool(10); 32 33 @SuppressWarnings ("unchecked") 34 public void testParallelWorkflow() throws Exception { 35 36 ExampleParallelBean parallelBean = new ExampleParallelBean(); 38 ParallelActivity activity = ParallelActivity.newParallelMethodActivity(executor, parallelBean); 39 activity.startWithTimeout(timer, 2000); 40 42 activity.join(10, TimeUnit.SECONDS); 43 44 parallelBean.assertCompleted(); 45 assertStopped(activity); 46 } 47 } 48 | Popular Tags |