Package javax.resource.spi.work

Examples of javax.resource.spi.work.Work


        return event;
    }

    private Work getTestWork()
    {
        return new Work()
        {
            public void release()
            {
                // noop
            }
View Full Code Here


        final Latch workExecutedLatch = new Latch();
        AbstractMessageReceiver receiver = createMessageReceiver();
        Connector receiverConnector = receiver.getConnector();
        receiverConnector.stop();
        receiverConnector.start();
        receiver.getWorkManager().scheduleWork(new Work()
        {
            @Override
            public void release()
            {
            }
View Full Code Here

    }

    @Test
    public void delegatesDoWork() throws WorkException
    {
        final Work work = mock(Work.class);
        doAnswer(new Answer()
        {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable
            {
                work.run();
                return null;
            }
        }).when(delegateWorkManager).doWork(work);

        trackingWorkManager.doWork(work);
View Full Code Here

    }

    @Test
    public void tracksWorkOnDoWorkDelegation() throws Exception
    {
        Work work = mock(Work.class);

        trackingWorkManager.doWork(work);

        assertWorkIsTracked(work);
    }
View Full Code Here

    }

    @Test
    public void untracksWorkOnDoWorkException() throws Exception
    {
        Work work = mock(Work.class);
        doThrow(new WorkException()).when(delegateWorkManager).doWork(work);

        try
        {
            trackingWorkManager.doWork(work);
View Full Code Here

    }

    @Test
    public void delegatesParameterizedDoWork() throws WorkException
    {
        Work work = mock(Work.class);
        int startTimeout = 10;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        trackingWorkManager.doWork(work, startTimeout, execContext, workListener);
View Full Code Here

    }

    @Test
    public void tracksWorkOnDoParameterizedWorkDelegation() throws Exception
    {
        Work work = mock(Work.class);
        int startTimeout = 10;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        trackingWorkManager.doWork(work, startTimeout, execContext, workListener);
View Full Code Here

    }

    @Test
    public void untracksWorkOnDoParameterizedWorkException() throws Exception
    {
        Work work = mock(Work.class);
        int startTimeout = 10;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        doThrow(new WorkException()).when(delegateWorkManager).doWork(work, startTimeout, execContext, workListener);
View Full Code Here

    }

    @Test
    public void startsWork() throws WorkException
    {
        final Work work = mock(Work.class);
        doAnswer(new Answer()
        {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable
            {
                work.run();
                return null;
            }
        }).when(delegateWorkManager).startWork(Matchers.<Work>any());

        trackingWorkManager.startWork(work);
View Full Code Here

    }

    @Test
    public void tracksWorkStart() throws Exception
    {
        final Work work = mock(Work.class);

        final ArgumentCaptor<Work> argument = ArgumentCaptor.forClass(Work.class);
        doAnswer(new Answer()
        {
            @Override
View Full Code Here

TOP

Related Classes of javax.resource.spi.work.Work

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.