commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1188386 - in /commons/proper/functor/trunk/src/test/java/org/apache/commons/functor: adapter/ core/collection/ core/composite/
Date Mon, 24 Oct 2011 21:13:53 GMT
Author: sebb
Date: Mon Oct 24 21:13:52 2011
New Revision: 1188386

URL: http://svn.apache.org/viewvc?rev=1188386&view=rev
Log:
Tidy tests - unnecessary Boolean boxing

Modified:
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestConditionalBinaryProcedure.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryCompositeBinaryPredicate.java

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java?rev=1188386&r1=1188385&r2=1188386&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBinaryPredicateBinaryFunction.java
Mon Oct 24 21:13:52 2011
@@ -43,13 +43,13 @@ public class TestBinaryPredicateBinaryFu
     @Test
     public void testTestWhenTrue() throws Exception {
         BinaryFunction<Object, Object, Boolean> f = new BinaryPredicateBinaryFunction<Object,
Object>(Constant.TRUE);
-        assertTrue(f.evaluate(null,null));
+        assertEquals(Boolean.TRUE, f.evaluate(null,null));
     }
 
     @Test
     public void testTestWhenFalse() throws Exception {
         BinaryFunction<Object, Object, Boolean> f = new BinaryPredicateBinaryFunction<Object,
Object>(Constant.FALSE);
-        assertFalse(f.evaluate(null,null));
+        assertEquals(Boolean.FALSE, f.evaluate(null,null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java?rev=1188386&r1=1188385&r2=1188386&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
Mon Oct 24 21:13:52 2011
@@ -117,7 +117,7 @@ public class TestIsEmpty extends BaseFun
         assertEquals(p,p);
         assertObjectsAreEqual(p,new IsEmpty());
         assertObjectsAreEqual(p,IsEmpty.instance());
-        assertObjectsAreNotEqual(p,new Constant(true));
+        assertObjectsAreNotEqual(p,new Constant(Boolean.TRUE));
     }
 
 }

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestConditionalBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestConditionalBinaryProcedure.java?rev=1188386&r1=1188385&r2=1188386&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestConditionalBinaryProcedure.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestConditionalBinaryProcedure.java
Mon Oct 24 21:13:52 2011
@@ -55,13 +55,13 @@ public class TestConditionalBinaryProced
             right);
         assertEquals(0,left.count);
         assertEquals(0,right.count);
-        p.run(true, null);
+        p.run(Boolean.TRUE, null);
         assertEquals(1,left.count);
         assertEquals(0,right.count);
-        p.run(false, null);
+        p.run(Boolean.FALSE, null);
         assertEquals(1,left.count);
         assertEquals(1,right.count);
-        p.run(true, null);
+        p.run(Boolean.TRUE, null);
         assertEquals(2,left.count);
         assertEquals(1,right.count);
     }

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryCompositeBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryCompositeBinaryPredicate.java?rev=1188386&r1=1188385&r2=1188386&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryCompositeBinaryPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryCompositeBinaryPredicate.java
Mon Oct 24 21:13:52 2011
@@ -17,6 +17,7 @@
 package org.apache.commons.functor.core.composite;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.BinaryPredicate;
@@ -52,8 +53,8 @@ public class TestUnaryCompositeBinaryPre
                 RightIdentity.PREDICATE,
                 Constant.FALSE,
                 new Identity<Boolean>());
-        assertEquals(true,f.test(Boolean.TRUE,Boolean.TRUE));
-        assertEquals(true,f.test(null,Boolean.TRUE));
+        assertTrue(f.test(Boolean.TRUE,Boolean.TRUE));
+        assertTrue(f.test(null,Boolean.TRUE));
     }
 
     @Test



Mime
View raw message