8990919293949596979899
mtContexts.put(PARENT_AFTER_CREATE_MTC_TASK, after); } @Test public void test_execute() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); executorService.execute(task); Thread.sleep(100);
114115116117118119120121122123124
assertTask1(call.copied); } @Test public void test_submit_runnable_result() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); Future future = executorService.submit(task, "ok"); assertEquals("ok", future.get());
126127128129130131132133134135136
assertTask1(task.copied); } @Test public void test_submit_runnable_null() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); Future future = executorService.submit(task); assertNull(future.get());
205206207208209210211212213214215
assertTask2(call2.copied); } @Test public void test_schedule_runnable() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); Future future = executorService.schedule(task, 1, TimeUnit.SECONDS); assertNull(future.get());
231232233234235236237238239240241
assertTask1(call.copied); } @Test public void test_scheduleAtFixedRate() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); Future future = executorService.scheduleAtFixedRate(task, 0, 100, TimeUnit.SECONDS); Thread.sleep(1000);
244245246247248249250251252253254
assertTask1(task.copied); } @Test public void test_scheduleWithFixedDelay() throws Exception { Task task = new Task("1", mtContexts); setLocalAfter(); Future future = executorService.scheduleWithFixedDelay(task, 0, 100, TimeUnit.SECONDS);