|
From: Steve F. <sm...@us...> - 2002-10-20 23:20:38
|
Update of /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock
In directory usw-pr-cvs1:/tmp/cvs-serv27037/source/com/b13media/mock
Modified Files:
P.java
Log Message:
fixed not -> IsNot (caused infinite loop)
Added helpers for creating arrays of Predicates,
perhaps these should be overloaded on Mock.
Index: P.java
===================================================================
RCS file: /cvsroot/mockobjects/nat/jmock/source/com/b13media/mock/P.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- P.java 22 May 2002 10:02:58 -0000 1.1.1.1
+++ P.java 20 Oct 2002 23:20:35 -0000 1.2
@@ -69,7 +69,7 @@
}
public static Predicate not( Predicate p ) {
- return not(p);
+ return new IsNot(p);
}
public static Predicate and( Predicate p1, Predicate p2 ) {
@@ -82,5 +82,20 @@
public static Predicate isA( Class c ) {
return new IsInstanceOf(c);
+ }
+
+ /**
+ * Helper methods for succinctly constructing Predicate arrays
+ */
+ public static Predicate[] arg(Predicate p) {
+ return new Predicate[] {p};
+ }
+
+ public static Predicate[] args(Predicate p1, Predicate p2) {
+ return new Predicate[] {p1, p2};
+ }
+
+ public static Predicate[] args(Predicate p1, Predicate p2, Predicate p3) {
+ return new Predicate[] {p1, p2, p3};
}
}
|