KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > jmock > core > constraint > AbstractConstraintsTest


1 /* Copyright (c) 2000-2004 jMock.org
2  */

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 JavaDoc o ) {
20             throw new AssertionFailedError("constraint should not have been evaluated");
21         }
22
23         public StringBuffer JavaDoc describeTo( StringBuffer JavaDoc buffer ) {
24             return buffer.append("NEVER_EVALUATED");
25         }
26     };
27
28     protected static final Object JavaDoc ARGUMENT_IGNORED = new Object JavaDoc();
29     protected static final Object JavaDoc ANY_NON_NULL_ARGUMENT = new Object JavaDoc();
30 }
31
Popular Tags