Package org.mockito.internal.matchers

Examples of org.mockito.internal.matchers.ArrayEquals


    }

    // link subprocedure to buildNewOperation invocation.
    final AtomicInteger i = new AtomicInteger(0); // NOTE: would be racy if not an AtomicInteger
    Mockito.when(subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i.getAndIncrement();
          LOG.debug("Task size:" + subprocs.size() + ", getting:" + index);
View Full Code Here


    // pass out a task per member
    final int[] i = new int[] { 0 };
    Mockito.when(
      subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i[0];
          Subprocedure commit = cohortTasks.get(index);
View Full Code Here

      VerificationMode prepare, VerificationMode commit, VerificationMode cleanup,
      VerificationMode finish, boolean opHasError) throws Exception {

    // make sure we build the correct number of cohort members
    Mockito.verify(subprocFactory, Mockito.times(cohortNames.size())).buildSubprocedure(
      Mockito.eq(opName), (byte[]) Mockito.argThat(new ArrayEquals(data)));
    // verify that we ran each of the operations cleanly
    int j = 0;
    for (Subprocedure op : cohortTasks) {
      LOG.debug("Checking mock:" + (j++));
      waitAndVerifySubproc(op, prepare, commit, cleanup, finish, opHasError);
View Full Code Here

    }

    // link subprocedure to buildNewOperation invocation.
    final AtomicInteger i = new AtomicInteger(0); // NOTE: would be racy if not an AtomicInteger
    Mockito.when(subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i.getAndIncrement();
          LOG.debug("Task size:" + subprocs.size() + ", getting:" + index);
View Full Code Here

    // pass out a task per member
    final int[] i = new int[] { 0 };
    Mockito.when(
      subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i[0];
          Subprocedure commit = cohortTasks.get(index);
View Full Code Here

      VerificationMode prepare, VerificationMode commit, VerificationMode cleanup,
      VerificationMode finish, boolean opHasError) throws Exception {

    // make sure we build the correct number of cohort members
    Mockito.verify(subprocFactory, Mockito.times(cohortNames.size())).buildSubprocedure(
      Mockito.eq(opName), (byte[]) Mockito.argThat(new ArrayEquals(data)));
    // verify that we ran each of the operations cleanly
    int j = 0;
    for (Subprocedure op : cohortTasks) {
      LOG.debug("Checking mock:" + (j++));
      waitAndVerifySubproc(op, prepare, commit, cleanup, finish, opHasError);
View Full Code Here

    }

    // link subprocedure to buildNewOperation invocation.
    final AtomicInteger i = new AtomicInteger(0); // NOTE: would be racy if not an AtomicInteger
    Mockito.when(subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i.getAndIncrement();
          LOG.debug("Task size:" + subprocs.size() + ", getting:" + index);
View Full Code Here

    // pass out a task per member
    final int[] i = new int[] { 0 };
    Mockito.when(
      subprocFactory.buildSubprocedure(Mockito.eq(opName),
        (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
      new Answer<Subprocedure>() {
        @Override
        public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
          int index = i[0];
          Subprocedure commit = cohortTasks.get(index);
View Full Code Here

      VerificationMode prepare, VerificationMode commit, VerificationMode cleanup,
      VerificationMode finish, boolean opHasError) throws Exception {

    // make sure we build the correct number of cohort members
    Mockito.verify(subprocFactory, Mockito.times(cohortNames.size())).buildSubprocedure(
      Mockito.eq(opName), (byte[]) Mockito.argThat(new ArrayEquals(data)));
    // verify that we ran each of the operations cleanly
    int j = 0;
    for (Subprocedure op : cohortTasks) {
      LOG.debug("Checking mock:" + (j++));
      waitAndVerifySubproc(op, prepare, commit, cleanup, finish, opHasError);
View Full Code Here

   
    protected List<Matcher> argumentsToMatchers() {
        List<Matcher> matchers = new ArrayList<Matcher>(arguments.length);
        for (Object arg : arguments) {
            if (arg != null && arg.getClass().isArray()) {
                matchers.add(new ArrayEquals(arg));
            } else {
                matchers.add(new Equals(arg));
            }
        }
        return matchers;
View Full Code Here

TOP

Related Classes of org.mockito.internal.matchers.ArrayEquals

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.