net.sourceforge.sqlunit.matchers
Class AllOrNothingMatcher

java.lang.Object
  extended by net.sourceforge.sqlunit.matchers.AllOrNothingMatcher
All Implemented Interfaces:
IMatcher

public class AllOrNothingMatcher
extends java.lang.Object
implements IMatcher

The AllOrNothingMatcher is an implementation of the IMatcher interface used to define rulesets for matching columns in SQLUnit. This implementation is of no particular use, except as a template for other useful matchers and for testing. Based on the argument supplied to it via the argument map, it will either always returns true or false for the column being matched.

Version:
$Revision: 1.3 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
AllOrNothingMatcher()
          Default constructor as per contract with IMatcher.
 
Method Summary
 boolean isEqual(java.lang.String source, java.lang.String target, java.util.Map args)
          Returns true if the key "match" in the args Map contains the String "true", else always returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllOrNothingMatcher

public AllOrNothingMatcher()
Default constructor as per contract with IMatcher.

Method Detail

isEqual

public final boolean isEqual(java.lang.String source,
                             java.lang.String target,
                             java.util.Map args)
                      throws SQLUnitException
Returns true if the key "match" in the args Map contains the String "true", else always returns false. The source and target are effectively no-ops in this matcher.

Specified by:
isEqual in interface IMatcher
Parameters:
source - the String representing the source to be matched.
target - the String representing the target to be matched.
args - a Map of name value pairs of arguments passed in.
Returns:
true if the matching strategy results in success.
Throws:
SQLUnitException - if the matching failed for some reason.