1 3 package test.jmock.core.constraint; 4 5 import junit.framework.AssertionFailedError; 6 import junit.framework.TestCase; 7 import org.jmock.core.Constraint; 8 import test.jmock.core.testsupport.AlwaysFalse; 9 import test.jmock.core.testsupport.AlwaysTrue; 10 11 12 public abstract class AbstractConstraintsTest extends TestCase 13 { 14 protected static final Constraint TRUE_CONSTRAINT = AlwaysTrue.INSTANCE; 15 protected static final Constraint FALSE_CONSTRAINT = AlwaysFalse.INSTANCE; 16 17 protected static final Constraint NEVER_EVALUATED = new Constraint() 18 { 19 public boolean eval( Object o ) { 20 throw new AssertionFailedError("constraint should not have been evaluated"); 21 } 22 23 public StringBuffer describeTo( StringBuffer buffer ) { 24 return buffer.append("NEVER_EVALUATED"); 25 } 26 }; 27 28 protected static final Object ARGUMENT_IGNORED = new Object (); 29 protected static final Object ANY_NON_NULL_ARGUMENT = new Object (); 30 } 31 | Popular Tags |