Package javax.resource.spi.work

Examples of javax.resource.spi.work.Work


    }

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

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


    }

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

        doThrow(new WorkException()).when(delegateWorkManager).scheduleWork(Matchers.<Work>any());

        try
        {
View Full Code Here

    }

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

        doThrow(new RuntimeException()).when(delegateWorkManager).scheduleWork(Matchers.<Work>any());

        try
        {
View Full Code Here

    }

    @Test
    public void untracksWorkOnSchedulingExecutionException() throws Exception
    {
        final Work work = mock(Work.class);
        doThrow(new RuntimeException()).when(work).run();

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

    }

    @Test
    public void schedulesParameterizedWork() throws WorkException
    {
        final Work work = mock(Work.class);
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        final ArgumentCaptor<Work> argument = ArgumentCaptor.forClass(Work.class);
View Full Code Here

    }

    @Test
    public void wrapsWorkListenerOnParameterizedScheduleWork() throws WorkException
    {
        final Work work = mock(Work.class);
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);
        WorkListener wrappedWorkListener = mock(WorkListener.class);
View Full Code Here

    }

    @Test
    public void tracksPrameterizedWorkScheduling() throws Exception
    {
        final Work work = mock(Work.class);
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        final ArgumentCaptor<Work> argument = ArgumentCaptor.forClass(Work.class);
View Full Code Here

    }

    @Test
    public void untracksParameterizedWorkOnSchedulingWorkException() throws Exception
    {
        final Work work = mock(Work.class);
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        doThrow(new WorkException()).when(delegateWorkManager).scheduleWork(Matchers.<Work>any(), eq(startTimeout), eq(execContext), Matchers.<WorkListener>any());
View Full Code Here

    }

    @Test
    public void untracksParameterizedWorkOnSchedulingRuntimeException() throws Exception
    {
        final Work work = mock(Work.class);
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);

        doThrow(new RuntimeException()).when(delegateWorkManager).scheduleWork(Matchers.<Work>any(), eq(startTimeout), eq(execContext), Matchers.<WorkListener>any());
View Full Code Here

    }

    @Test
    public void untracksParameterizedWorkOnSchedulingExecutionException() throws Exception
    {
        final Work work = mock(Work.class);
        doThrow(new RuntimeException()).when(work).run();
        long startTimeout = 0;
        ExecutionContext execContext = mock(ExecutionContext.class);
        WorkListener workListener = mock(WorkListener.class);
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.