Package com.alibaba.mtc.testmodel

Examples of com.alibaba.mtc.testmodel.Task


        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);
View Full Code Here


        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());
View Full Code Here

        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());
View Full Code Here

            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());
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

TOP

Related Classes of com.alibaba.mtc.testmodel.Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.