Package javax.resource.spi.work

Examples of javax.resource.spi.work.ExecutionContext


    @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);

        try
View Full Code Here


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

        doAnswer(new Answer()
        {
            @Override
View Full Code Here

    @Test
    public void wrapsWorkListenerOnParameterizedStartWork() 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);

        WorkListenerWrapperFactory workListenerWrapperFactory = mock(WorkListenerWrapperFactory.class);
        when(workListenerWrapperFactory.create(work, workListener)).thenReturn(wrappedWorkListener);
View Full Code Here

    @Test
    public void tracksParameterizedWorkStart() 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);
        doAnswer(new Answer()
        {
View Full Code Here

    @Test
    public void untracksWorkOnParameterizedStartWorkException() 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).startWork(Matchers.<Work>any(), eq(startTimeout), eq(execContext), Matchers.<WorkListener>any());

        try
View Full Code Here

    @Test
    public void untracksWorkOnParameterizedStartRuntimeException() 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).startWork(Matchers.<Work>any(), eq(startTimeout), eq(execContext), Matchers.<WorkListener>any());

        try
View Full Code Here

    @Test
    public void untracksWorkOnParameterizedStartExecutionException() 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(work).run();

        final ArgumentCaptor<Work> argument = ArgumentCaptor.forClass(Work.class);
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);

        doAnswer(new Answer()
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());

        try
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());

        try
View Full Code Here

TOP

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

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.