commons-commits mailing list archives

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

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

Modified:
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFullyBoundPredicate.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestTransposedPredicate.java

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestBoundPredicate.java
Mon Oct 24 21:07:48 2011
@@ -17,8 +17,10 @@
 package org.apache.commons.functor.adapter;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.Predicate;
@@ -47,11 +49,11 @@ public class TestBoundPredicate extends 
     public void testTest() throws Exception {
         {
             Predicate p = new BoundPredicate(new UnaryFunctionUnaryPredicate<Boolean>(Identity.<Boolean>instance()),Boolean.TRUE);
-            assertEquals(true,p.test());
+            assertTrue(p.test());
         }
         {
             Predicate p = new BoundPredicate(new UnaryFunctionUnaryPredicate<Boolean>(Identity.<Boolean>instance()),Boolean.FALSE);
-            assertEquals(false,p.test());
+            assertFalse(p.test());
         }
     }
 

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFullyBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFullyBoundPredicate.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFullyBoundPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestFullyBoundPredicate.java
Mon Oct 24 21:07:48 2011
@@ -19,6 +19,7 @@ package org.apache.commons.functor.adapt
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.Predicate;
@@ -48,7 +49,7 @@ public class TestFullyBoundPredicate ext
         Predicate p = new FullyBoundPredicate(
                 new BinaryFunctionBinaryPredicate<Object, Boolean>(RightIdentity.<Object,
Boolean> function()), "foo",
                 Boolean.TRUE);
-        assertEquals(true, p.test());
+        assertTrue(p.test());
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestPredicateFunction.java
Mon Oct 24 21:07:48 2011
@@ -36,7 +36,7 @@ public class TestPredicateFunction exten
 
     @Override
     protected Object makeFunctor() {
-        return new PredicateFunction(Constant.of(true));
+        return new PredicateFunction(Constant.of(Boolean.TRUE));
     }
 
     // Tests

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundPredicate.java
Mon Oct 24 21:07:48 2011
@@ -17,8 +17,10 @@
 package org.apache.commons.functor.adapter;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.UnaryPredicate;
@@ -47,8 +49,8 @@ public class TestRightBoundPredicate ext
     public void testTest() throws Exception {
         UnaryPredicate<Boolean> f = new RightBoundPredicate<Boolean>(
                 new BinaryFunctionBinaryPredicate<Boolean, Object>(LeftIdentity.<Boolean,
Object> function()), "foo");
-        assertEquals(true, f.test(Boolean.TRUE));
-        assertEquals(false, f.test(Boolean.FALSE));
+        assertTrue(f.test(Boolean.TRUE));
+        assertFalse(f.test(Boolean.FALSE));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
Mon Oct 24 21:07:48 2011
@@ -65,7 +65,7 @@ public class TestConstant extends BaseFu
 
     @Test
     public void testConstantTrue() throws Exception {
-        Constant<Object> truePred = new Constant<Object>(true);
+        Constant<Object> truePred = new Constant<Object>(Boolean.TRUE);
         assertTrue(truePred.test());
         assertTrue(truePred.test(null));
         assertTrue(truePred.test(null,null));
@@ -77,7 +77,7 @@ public class TestConstant extends BaseFu
 
     @Test
     public void testConstantFalse() throws Exception {
-        Constant<Object> falsePred = new Constant<Object>(false);
+        Constant<Object> falsePred = new Constant<Object>(Boolean.FALSE);
         assertTrue(!falsePred.test());
         assertTrue(!falsePred.test(null));
         assertTrue(!falsePred.test(null,null));

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java
Mon Oct 24 21:07:48 2011
@@ -77,7 +77,7 @@ public class TestLeftIdentity extends Ba
         assertObjectsAreEqual(f,LeftIdentity.FUNCTION);
         assertObjectsAreNotEqual(f,RightIdentity.FUNCTION);
         assertObjectsAreNotEqual(f,Constant.of("abcde"));
-        assertObjectsAreNotEqual(f,Constant.of(true));
+        assertObjectsAreNotEqual(f,Constant.of(Boolean.TRUE));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestTransposedPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestTransposedPredicate.java?rev=1188380&r1=1188379&r2=1188380&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestTransposedPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestTransposedPredicate.java
Mon Oct 24 21:07:48 2011
@@ -17,8 +17,10 @@
 package org.apache.commons.functor.core.composite;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.BinaryPredicate;
@@ -48,8 +50,8 @@ public class TestTransposedPredicate ext
     public void testEvaluate() throws Exception {
         BinaryPredicate<Boolean, Boolean> p = new TransposedPredicate<Boolean, Boolean>(BinaryFunctionBinaryPredicate
                 .adapt(LeftIdentity.<Boolean, Boolean> function()));
-        assertEquals(true,p.test(Boolean.FALSE,Boolean.TRUE));
-        assertEquals(false,p.test(Boolean.TRUE,Boolean.FALSE));
+        assertTrue(p.test(Boolean.FALSE,Boolean.TRUE));
+        assertFalse(p.test(Boolean.TRUE,Boolean.FALSE));
     }
 
     @Test



Mime
View raw message