commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject svn commit: r1365377 [2/2] - in /commons/proper/functor/trunk/src: main/java/org/apache/commons/functor/adapter/ test/java/org/apache/commons/functor/adapter/
Date Wed, 25 Jul 2012 00:59:26 GMT
Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestProcedureUnaryProcedure.java
Wed Jul 25 00:59:23 2012
@@ -19,11 +19,13 @@ 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.UnaryProcedure;
 import org.apache.commons.functor.core.Constant;
 import org.apache.commons.functor.core.NoOp;
+import org.apache.commons.functor.core.composite.Sequence;
 import org.junit.Test;
 
 /**
@@ -54,6 +56,8 @@ public class TestProcedureUnaryProcedure
         assertEquals(p,p);
         assertObjectsAreEqual(p,new ProcedureUnaryProcedure<Object>(NoOp.INSTANCE));
         assertObjectsAreNotEqual(p,NoOp.INSTANCE);
+        assertObjectsAreNotEqual(p,new ProcedureUnaryProcedure<Object>(new Sequence()));
+        assertTrue(!p.equals(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundFunction.java
Wed Jul 25 00:59:23 2012
@@ -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.UnaryFunction;
@@ -57,6 +58,9 @@ public class TestRightBoundFunction exte
         assertObjectsAreNotEqual(f,Constant.of("xyzzy"));
         assertObjectsAreNotEqual(f,new RightBoundFunction<Object, Object>(RightIdentity.FUNCTION,"xyzzy"));
         assertObjectsAreNotEqual(f,new RightBoundFunction<Object, Object>(LeftIdentity.FUNCTION,"bar"));
+        assertObjectsAreNotEqual(f,new RightBoundFunction<Object, Object>(LeftIdentity.FUNCTION,null));
+        assertObjectsAreEqual(new RightBoundFunction<Object, Object>(LeftIdentity.FUNCTION,null),new
RightBoundFunction<Object, Object>(LeftIdentity.FUNCTION,null));
+        assertTrue(!f.equals(null));
     }
 
     @Test

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=1365377&r1=1365376&r2=1365377&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
Wed Jul 25 00:59:23 2012
@@ -61,6 +61,8 @@ public class TestRightBoundPredicate ext
         assertObjectsAreNotEqual(f, new RightBoundPredicate<Boolean>(Constant.FALSE,
"xyzzy"));
         assertObjectsAreNotEqual(f, new RightBoundPredicate<Boolean>(Constant.TRUE,
"foo"));
         assertObjectsAreNotEqual(f, new RightBoundPredicate<Boolean>(Constant.TRUE,
null));
+        assertObjectsAreEqual(new RightBoundPredicate<Boolean>(Constant.TRUE, null),
new RightBoundPredicate<Boolean>(Constant.TRUE, null));
+        assertTrue(!f.equals(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestRightBoundProcedure.java
Wed Jul 25 00:59:23 2012
@@ -19,11 +19,13 @@ 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.UnaryProcedure;
 import org.apache.commons.functor.core.LeftIdentity;
 import org.apache.commons.functor.core.NoOp;
+import org.apache.commons.functor.core.composite.BinarySequence;
 import org.junit.Test;
 
 /**
@@ -59,6 +61,9 @@ public class TestRightBoundProcedure ext
         assertObjectsAreNotEqual(f,new RightBoundProcedure<Object>(new BinaryFunctionBinaryProcedure<Object,
Object>(LeftIdentity.FUNCTION),"xyzzy"));
         assertObjectsAreNotEqual(f,new RightBoundProcedure<Object>(NoOp.INSTANCE,"foo"));
         assertObjectsAreNotEqual(f,new RightBoundProcedure<Object>(NoOp.INSTANCE,null));
+        assertObjectsAreEqual(new RightBoundProcedure<Object>(NoOp.INSTANCE,null),new
RightBoundProcedure<Object>(NoOp.INSTANCE,null));
+        assertObjectsAreNotEqual(new RightBoundProcedure<Object>(new BinarySequence<Object,
Object>(),null),new RightBoundProcedure<Object>(NoOp.INSTANCE,null));
+        assertTrue(!f.equals(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryPredicate.java
Wed Jul 25 00:59:23 2012
@@ -61,6 +61,7 @@ public class TestUnaryFunctionUnaryPredi
         assertObjectsAreEqual(p,new UnaryFunctionUnaryPredicate<Object>(Constant.TRUE));
         assertObjectsAreNotEqual(p,Constant.TRUE);
         assertObjectsAreNotEqual(p,new UnaryFunctionUnaryPredicate<Object>(Constant.FALSE));
+        assertTrue(!p.equals(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryFunctionUnaryProcedure.java
Wed Jul 25 00:59:23 2012
@@ -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.UnaryFunction;
@@ -65,6 +66,7 @@ public class TestUnaryFunctionUnaryProce
         assertObjectsAreEqual(p,new UnaryFunctionUnaryProcedure<Object>(Constant.of("K")));
         assertObjectsAreNotEqual(p,NoOp.INSTANCE);
         assertObjectsAreNotEqual(p,new UnaryFunctionUnaryProcedure<Object>(Constant.of("J")));
+        assertTrue(!p.equals(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryPredicateUnaryFunction.java
Wed Jul 25 00:59:23 2012
@@ -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.UnaryFunction;
@@ -60,11 +61,12 @@ public class TestUnaryPredicateUnaryFunc
         assertObjectsAreEqual(f,new UnaryPredicateUnaryFunction<Object>(Constant.TRUE));
         assertObjectsAreNotEqual(f,Constant.of("x"));
         assertObjectsAreNotEqual(f,new UnaryPredicateUnaryFunction<Object>(Constant.FALSE));
+        assertTrue(!f.equals(null));
     }
 
     @Test
     public void testAdaptNull() throws Exception {
-        assertNull(UnaryFunctionUnaryPredicate.adapt(null));
+        assertNull(UnaryPredicateUnaryFunction.adapt(null));
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java?rev=1365377&r1=1365376&r2=1365377&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/adapter/TestUnaryProcedureUnaryFunction.java
Wed Jul 25 00:59:23 2012
@@ -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.UnaryFunction;
@@ -60,11 +61,12 @@ public class TestUnaryProcedureUnaryFunc
             }
         }));
         assertObjectsAreNotEqual(f,Constant.of(null));
+        assertTrue(!f.equals(null));
     }
 
     @Test
     public void testAdaptNull() throws Exception {
-        assertNull(UnaryFunctionUnaryProcedure.adapt(null));
+        assertNull(UnaryProcedureUnaryFunction.adapt(null));
     }
 
     @Test



Mime
View raw message