Package commonj.work

Examples of commonj.work.Work.run()


public class ThreadPoolWorkManagerTestCase extends TestCase {

    public void testSchedule() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        Work work = createMock(Work.class);
        work.run();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.countDown();
                return null;
            }
View Full Code Here


        listener.workStarted(isA(WorkEvent.class));
        listener.workCompleted(isA(WorkEvent.class));
        expectLastCall();
        replay(listener);
        Work work = createMock(Work.class);
        work.run();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.countDown();
                return null;
            }
View Full Code Here

                return null;
            }
        });
        replay(listener);
        Work work = createMock(Work.class);
        work.run();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.await();
                return null;
            }
View Full Code Here

        listener.workAccepted(isA(WorkEvent.class));
        listener.workStarted(isA(WorkEvent.class));
        listener.workCompleted(isA(WorkEvent.class));
        replay(listener);
        Work work = createMock(Work.class);
        work.run();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.countDown();
                throw new RuntimeException();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.