View Javadoc

1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.matcher;
4   
5   /***
6    * <p>
7    * An ArgMatcher allows different rules to be set for matching arguments to
8    * mock methods.  Each implementation of ArgMatcher will define a specific
9    * rule for matching of an argument.
10   * </p>
11   * 
12   * <p>
13   * Several common implementations of ArgMatchers are provided with VirtualMock,
14   * and users can create their own custom implementations to define their own
15   * custom matching rules.
16   * </p>
17   *
18   * @author Chad Woolley
19   * @version $Revision: 1.5 $
20   */
21  public interface ArgMatcher {
22      /***
23       * The method that VirtualMock will call to perform matching of an
24       * argument.  If the expected argument matches against the actual
25       * argument, then true should be returned.  If not, false should be
26       * returned.
27       *
28       * @param expectedArgument The expected argument value that was passed when
29       *        the mocked call was recorded
30       * @param actualArgument The actual argument value that was passed when the
31       *        class under test invoked the recorded call.
32       *
33       * @return true if verification passes, false if it does not
34       */
35      boolean matches(Object expectedArgument, Object actualArgument);
36  }