Package javax.resource.spi.work

Examples of javax.resource.spi.work.WorkListener


    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);
        trackingWorkManager.setWorkListenerWrapperFactory(workListenerWrapperFactory);
View Full Code Here


    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()
        {
            @Override
View Full Code Here

    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

    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

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

    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

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

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

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

        doAnswer(new Answer()
        {
View Full Code Here

    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

    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.WorkListener

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.