Examples of ArrayEquals


Examples of org.easymock.internal.matchers.ArrayEquals

import org.easymock.internal.matchers.ArrayEquals;

public class ArrayMatcher extends AbstractMatcher {
    public String argumentToString(Object argument) {
        StringBuffer result = new StringBuffer();
        new ArrayEquals(argument).appendTo(result);
        return result.toString();
    }
View Full Code Here

Examples of org.easymock.internal.matchers.ArrayEquals

        new ArrayEquals(argument).appendTo(result);
        return result.toString();
    }

    public boolean argumentMatches(Object expected, Object actual) {
        return new ArrayEquals(expected).matches(actual);
    }
View Full Code Here

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

Examples of org.mockito.internal.matchers.ArrayEquals

    // 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

Examples of org.mockito.internal.matchers.ArrayEquals

      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

Examples of org.mockito.internal.matchers.ArrayEquals

     * @param value
     *            the given array.
     * @return <code>null</code>.
     */
    public static <T> T[] aryEq(T[] value) {
        return reportMatcher(new ArrayEquals(value)).returnNull();
    }
View Full Code Here

Examples of org.mockito.internal.matchers.ArrayEquals

     * @param value
     *            the given array.
     * @return <code>null</code>.
     */
    public static short[] aryEq(short[] value) {
        return reportMatcher(new ArrayEquals(value)).returnNull();
    }
View Full Code Here

Examples of org.mockito.internal.matchers.ArrayEquals

     * @param value
     *            the given array.
     * @return <code>null</code>.
     */
    public static long[] aryEq(long[] value) {
        return reportMatcher(new ArrayEquals(value)).returnNull();
    }
View Full Code Here

Examples of org.mockito.internal.matchers.ArrayEquals

     * @param value
     *            the given array.
     * @return <code>null</code>.
     */
    public static int[] aryEq(int[] value) {
        return reportMatcher(new ArrayEquals(value)).returnNull();      
    }
View Full Code Here

Examples of org.mockito.internal.matchers.ArrayEquals

     * @param value
     *            the given array.
     * @return <code>null</code>.
     */
    public static float[] aryEq(float[] value) {
        return reportMatcher(new ArrayEquals(value)).returnNull();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.