Package org.mockito

Examples of org.mockito.InOrder


    task.waitForCompleted();

    // make sure we mocked correctly
    prepareOperation.ensureRan();
    // we never got an exception
    InOrder inorder = inOrder(spy, controller);
    inorder.verify(spy).sendGlobalBarrierStart();
    inorder.verify(controller).sendGlobalBarrierAcquire(task, procData, expected);
    inorder.verify(spy).sendGlobalBarrierReached();
    inorder.verify(controller).sendGlobalBarrierReached(eq(task), anyListOf(String.class));
  }
View Full Code Here


    member.submitSubprocedure(subproc1);
    // and wait for it to finish
    subproc.waitForLocallyCompleted();

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spy);
    order.verify(spy).acquireBarrier();
    order.verify(mockMemberComms).sendMemberAcquired(eq(spy));
    order.verify(spy).insideBarrier();
    order.verify(mockMemberComms).sendMemberCompleted(eq(spy));
    order.verify(mockMemberComms, never()).sendMemberAborted(eq(spy),
        any(ForeignException.class));
  }
View Full Code Here

    member.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    member.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spySub);
    order.verify(spySub).acquireBarrier();
    // Later phases not run
    order.verify(mockMemberComms, never()).sendMemberAcquired(eq(spySub));
    order.verify(spySub, never()).insideBarrier();
    order.verify(mockMemberComms, never()).sendMemberCompleted(eq(spySub));
    // error recovery path exercised
    order.verify(spySub).cancel(anyString(), any(Exception.class));
    order.verify(spySub).cleanup(any(Exception.class));
  }
View Full Code Here

    member.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    member.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spySub);
    order.verify(spySub).acquireBarrier();
    order.verify(mockMemberComms).sendMemberAcquired(eq(spySub));

    // Later phases not run
    order.verify(spySub, never()).insideBarrier();
    order.verify(mockMemberComms, never()).sendMemberCompleted(eq(spySub));
    // error recovery path exercised
    order.verify(spySub).cancel(anyString(), any(Exception.class));
    order.verify(spySub).cleanup(any(Exception.class));
  }
View Full Code Here

    member.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    member.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spySub);
    order.verify(spySub).acquireBarrier();
    order.verify(mockMemberComms).sendMemberAcquired(eq(spySub));
    // Later phases not run
    order.verify(spySub, never()).insideBarrier();
    order.verify(mockMemberComms, never()).sendMemberCompleted(eq(spySub));
    // error recovery path exercised
    order.verify(spySub).cancel(anyString(), any(Exception.class));
    order.verify(spySub).cleanup(any(Exception.class));
  }
View Full Code Here

    member.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    member.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spySub);
    order.verify(spySub).acquireBarrier();
    order.verify(mockMemberComms).sendMemberAcquired(eq(spySub));
    order.verify(spySub).insideBarrier();

    // Later phases not run
    order.verify(mockMemberComms, never()).sendMemberCompleted(eq(spySub));
    // error recovery path exercised
    order.verify(spySub).cancel(anyString(), any(Exception.class));
    order.verify(spySub).cleanup(any(Exception.class));
  }
View Full Code Here

    member.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    member.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spySub);
    order.verify(spySub).acquireBarrier();
    order.verify(mockMemberComms).sendMemberAcquired(eq(spySub));
    order.verify(spySub).insideBarrier();
    order.verify(mockMemberComms).sendMemberCompleted(eq(spySub));
    // error recovery path exercised
    order.verify(spySub).cancel(anyString(), any(Exception.class));
    order.verify(spySub).cleanup(any(Exception.class));
  }
View Full Code Here

    memberSpy.submitSubprocedure(subproc);
    // if the operation doesn't die properly, then this will timeout
    memberSpy.closeAndWait(TIMEOUT);

    // make sure everything ran in order
    InOrder order = inOrder(mockMemberComms, spy, dispSpy);
    // make sure we acquire.
    order.verify(spy).acquireBarrier();
    order.verify(mockMemberComms, never()).sendMemberAcquired(spy);

    // TODO Need to do another refactor to get this to propagate to the coordinator.
    // make sure we pass a remote exception back the controller
//    order.verify(mockMemberComms).sendMemberAborted(eq(spy),
//      any(ExternalException.class));
View Full Code Here

    }

    public void testStartFromNoStore() throws Exception
    {
        _store.configureConfigStore(_virtualHost, _recoveryHandler);
        InOrder inorder = inOrder(_recoveryHandler);
        inorder.verify(_recoveryHandler).beginConfigurationRecovery(eq(_store), eq(0));
        inorder.verify(_recoveryHandler,never()).configuredObject(any(UUID.class),anyString(),anyMap());
        inorder.verify(_recoveryHandler).completeConfigurationRecovery();
        _store.close();
    }
View Full Code Here

        _store.configureConfigStore(_virtualHost, _recoveryHandler);
        _store.close();

        _store.configureConfigStore(_virtualHost, _recoveryHandler);
        InOrder inorder = inOrder(_recoveryHandler);

        // first time the config version should be the initial version - 0
        inorder.verify(_recoveryHandler).beginConfigurationRecovery(eq(_store), eq(0));

        // second time the config version should be the updated version
        inorder.verify(_recoveryHandler).beginConfigurationRecovery(eq(_store), eq(NEW_CONFIG_VERSION));

        _store.close();
    }
View Full Code Here

TOP

Related Classes of org.mockito.InOrder

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.