commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r689979 - /commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
Date Thu, 28 Aug 2008 20:59:24 GMT
Author: mbenson
Date: Thu Aug 28 13:59:24 2008
New Revision: 689979

URL: http://svn.apache.org/viewvc?rev=689979&view=rev
Log:
sanity

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

Modified: commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java?rev=689979&r1=689978&r2=689979&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
(original)
+++ commons/sandbox/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
Thu Aug 28 13:59:24 2008
@@ -62,30 +62,32 @@
 
     public void testTest() throws Exception {
         IsEqual<Object, Object> p = new IsEqual<Object, Object>();
-        assertTrue("For symmetry, two nulls should be equal",p.test(null,null));
-        assertTrue(p.test("foo","foo"));
-        assertTrue(!p.test(null,"foo"));
-        assertTrue(!p.test("foo",null));
-        assertTrue(p.test(new Integer(3),new Integer(3)));
-        assertTrue(!p.test(null,new Integer(3)));
-        assertTrue(!p.test(new Integer(3),null));
+        assertTrue("For symmetry, two nulls should be equal", p.test(null, null));
+        assertTrue(p.test("foo", "foo"));
+        assertFalse(p.test(null, "foo"));
+        assertFalse(p.test("foo", null));
+        assertTrue(p.test(new Integer(3), new Integer(3)));
+        assertFalse(p.test(null, new Integer(3)));
+        assertFalse(p.test(new Integer(3), null));
 
-        assertTrue(!p.test(new Integer(3),new Integer(4)));
-        assertTrue(!p.test(new Integer(4),new Integer(3)));
-        assertTrue(!p.test("3",new Integer(3)));
-        assertTrue(!p.test(new Integer(3),"3"));
+        assertFalse(p.test(new Integer(3), new Integer(4)));
+        assertFalse(p.test(new Integer(4), new Integer(3)));
+        assertFalse(p.test("3", new Integer(3)));
+        assertFalse(p.test(new Integer(3), "3"));
     }
 
     public void testEquals() throws Exception {
         BinaryPredicate<Object, Object> f = new IsEqual<Object, Object>();
-        assertEquals(f,f);
+        assertEquals(f, f);
 
-        assertObjectsAreEqual(f,new IsEqual<Object, Object>());
-        assertObjectsAreEqual(f,IsEqual.instance());
-        assertObjectsAreNotEqual(f,Constant.truePredicate());
+        assertObjectsAreEqual(f, new IsEqual<Object, Object>());
+        assertObjectsAreEqual(f, IsEqual.instance());
+        assertObjectsAreNotEqual(f, Constant.truePredicate());
     }
 
     public void testConstant() throws Exception {
-        assertEquals(IsEqual.instance(),IsEqual.instance());
+        assertEquals(IsEqual.instance(), IsEqual.instance());
+        assertNotSame(IsEqual.instance(), IsEqual.instance());
+        assertSame(IsEqual.INSTANCE, IsEqual.INSTANCE);
     }
 }



Mime
View raw message