org.apache.hivemind.test
Class RegexpMatcher

java.lang.Object
  extended by org.easymock.AbstractMatcher
      extended by org.apache.hivemind.test.AbstractArgumentMatcher
          extended by org.apache.hivemind.test.RegexpMatcher
All Implemented Interfaces:
ArgumentMatcher, org.easymock.ArgumentsMatcher

public class RegexpMatcher
extends AbstractArgumentMatcher

A ArgumentMatcher implementation that treats the expected value (provided while training the mock object) as a Perl5 Regular expression, which is matched against the actual value.

Since:
1.1
Author:
Howard Lewis Ship

Constructor Summary
RegexpMatcher()
           
 
Method Summary
 boolean compareArguments(java.lang.Object expected, java.lang.Object actual)
          Compares an expected argument value (provided when training the mock object), against the actual argument value.
 
Methods inherited from class org.apache.hivemind.test.AbstractArgumentMatcher
argumentMatches
 
Methods inherited from class org.easymock.AbstractMatcher
argumentToString, matches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexpMatcher

public RegexpMatcher()
Method Detail

compareArguments

public boolean compareArguments(java.lang.Object expected,
                                java.lang.Object actual)
Description copied from interface: ArgumentMatcher
Compares an expected argument value (provided when training the mock object), against the actual argument value. This method is only invoked if both arguments are non-null and not the same object (based on identity comparison, not equals()).

Parameters:
expected - The expected argument value
actual - The actual argument value
Returns:
true if the two objects can be considered the same, false otherwise.


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.