commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r666136 - /commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java
Date Tue, 10 Jun 2008 14:44:44 GMT
Author: mbenson
Date: Tue Jun 10 07:44:43 2008
New Revision: 666136

URL: http://svn.apache.org/viewvc?rev=666136&view=rev
Log:
unchecked

Modified:
    commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java

Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java?rev=666136&r1=666135&r2=666136&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java
(original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java
Tue Jun 10 07:44:43 2008
@@ -44,7 +44,7 @@
     // ------------------------------------------------------------------------
 
     protected Object makeFunctor() {
-        return new BinaryOr(new Constant(false),new Constant(true));
+        return new BinaryOr<Object, Object>(Constant.FALSE, Constant.TRUE);
     }
 
     // Lifecycle
@@ -62,55 +62,55 @@
     // ------------------------------------------------------------------------
 
     public void testTrue() throws Exception {
-        assertTrue((new BinaryOr(new Constant(true))).test("xyzzy",new Integer(3)));
-        assertTrue((new BinaryOr(new Constant(false),new Constant(true))).test("xyzzy",new
Integer(3)));
-        assertTrue((new BinaryOr(new Constant(false),new Constant(false),new Constant(true))).test("xyzzy",new
Integer(3)));
+        assertTrue((new BinaryOr<Object, Object>(Constant.TRUE)).test("xyzzy",new Integer(3)));
+        assertTrue((new BinaryOr<Object, Object>(Constant.FALSE,Constant.TRUE)).test("xyzzy",new
Integer(3)));
+        assertTrue((new BinaryOr<Object, Object>(Constant.FALSE, Constant.FALSE, Constant.TRUE)).test("xyzzy",new
Integer(3)));
 
-        BinaryOr p = new BinaryOr(new Constant(true));
+        BinaryOr<Object, Object> p = new BinaryOr<Object, Object>(Constant.TRUE);
         assertTrue(p.test("xyzzy",new Integer(3)));
         for (int i=0;i<10;i++) {
-            p.or(new Constant(i%2==0));
+            p.or(Constant.of(i%2==0));
             assertTrue(p.test("xyzzy",new Integer(3)));
         }
 
-        BinaryOr q = new BinaryOr(new Constant(true));
+        BinaryOr<Object, Object> q = new BinaryOr<Object, Object>(Constant.TRUE);
         assertTrue(q.test("xyzzy",new Integer(3)));
         for (int i=0;i<10;i++) {
-            q.or(new Constant(i%2==0));
+            q.or(Constant.of(i%2==0));
             assertTrue(q.test("xyzzy",new Integer(3)));
         }
 
-        BinaryOr r = new BinaryOr(p,q);
+        BinaryOr<Object, Object> r = new BinaryOr<Object, Object>(p,q);
         assertTrue(r.test("xyzzy",new Integer(3)));
     }
 
     public void testFalse() throws Exception {
-        assertTrue(!(new BinaryOr()).test("xyzzy",new Integer(3)));
-        assertTrue(!(new BinaryOr(new Constant(false))).test("xyzzy",new Integer(3)));
-        assertTrue(!(new BinaryOr(new Constant(false),new Constant(false))).test("xyzzy",new
Integer(3)));
-        assertTrue(!(new BinaryOr(new Constant(false),new Constant(false),new Constant(false))).test("xyzzy",new
Integer(3)));
+        assertTrue(!(new BinaryOr<Object, Object>()).test("xyzzy",new Integer(3)));
+        assertTrue(!(new BinaryOr<Object, Object>(Constant.FALSE)).test("xyzzy",new
Integer(3)));
+        assertTrue(!(new BinaryOr<Object, Object>(Constant.FALSE,Constant.FALSE)).test("xyzzy",new
Integer(3)));
+        assertTrue(!(new BinaryOr<Object, Object>(Constant.FALSE,Constant.FALSE,Constant.FALSE)).test("xyzzy",new
Integer(3)));
 
-        BinaryOr p = new BinaryOr(new Constant(false));
+        BinaryOr<Object, Object> p = new BinaryOr<Object, Object>(Constant.FALSE);
         assertTrue(!p.test("xyzzy",new Integer(3)));
         for (int i=0;i<10;i++) {
-            p.or(new Constant(false));
+            p.or(Constant.FALSE);
             assertTrue(!p.test("xyzzy",new Integer(3)));
         }
 
-        BinaryOr q = new BinaryOr(new Constant(false));
+        BinaryOr<Object, Object> q = new BinaryOr<Object, Object>(Constant.FALSE);
         assertTrue(!q.test("xyzzy",new Integer(3)));
         for (int i=0;i<10;i++) {
-            q.or(new Constant(false));
+            q.or(Constant.FALSE);
             assertTrue(!q.test("xyzzy",new Integer(3)));
         }
 
-        BinaryOr r = new BinaryOr(p,q);
+        BinaryOr<Object, Object> r = new BinaryOr<Object, Object>(p,q);
         assertTrue(!r.test("xyzzy",new Integer(3)));
     }
 
     public void testDuplicateAdd() throws Exception {
-        BinaryPredicate p = new Constant(true);
-        BinaryOr q = new BinaryOr(p,p);
+        BinaryPredicate<Object, Object> p = Constant.TRUE;
+        BinaryOr<Object, Object> q = new BinaryOr<Object, Object>(p,p);
         assertTrue(q.test("xyzzy",new Integer(3)));
         for (int i=0;i<10;i++) {
             q.or(p);
@@ -119,32 +119,32 @@
     }
 
     public void testEquals() throws Exception {
-        BinaryOr p = new BinaryOr();
+        BinaryOr<Object, Object> p = new BinaryOr<Object, Object>();
         assertEquals(p,p);
 
-        BinaryOr q = new BinaryOr();
+        BinaryOr<Object, Object> q = new BinaryOr<Object, Object>();
         assertObjectsAreEqual(p,q);
 
-        BinaryAnd r = new BinaryAnd();
+        BinaryAnd<Object, Object> r = new BinaryAnd<Object, Object>();
         assertObjectsAreNotEqual(p,r);
 
         for (int i=0;i<3;i++) {
-            p.or(Constant.truePredicate());
+            p.or(Constant.TRUE);
             assertObjectsAreNotEqual(p,q);
-            q.or(Constant.truePredicate());
+            q.or(Constant.TRUE);
             assertObjectsAreEqual(p,q);
-            r.and(Constant.truePredicate());
+            r.and(Constant.TRUE);
             assertObjectsAreNotEqual(p,r);
 
-            p.or(new BinaryOr(Constant.truePredicate(),Constant.falsePredicate()));
+            p.or(new BinaryOr<Object, Object>(Constant.truePredicate(),Constant.FALSE));
             assertObjectsAreNotEqual(p,q);
-            q.or(new BinaryOr(Constant.truePredicate(),Constant.falsePredicate()));
+            q.or(new BinaryOr<Object, Object>(Constant.truePredicate(),Constant.FALSE));
             assertObjectsAreEqual(p,q);
-            r.and(new BinaryOr(Constant.truePredicate(),Constant.falsePredicate()));
+            r.and(new BinaryOr<Object, Object>(Constant.truePredicate(),Constant.FALSE));
             assertObjectsAreNotEqual(p,r);
         }
 
-        assertObjectsAreNotEqual(p,Constant.truePredicate());
+        assertObjectsAreNotEqual(p,Constant.TRUE);
     }
 
 }



Mime
View raw message