You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2011/01/30 10:04:51 UTC

svn commit: r1065236 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java

Author: bayard
Date: Sun Jan 30 09:04:51 2011
New Revision: 1065236

URL: http://svn.apache.org/viewvc?rev=1065236&view=rev
Log:
Adding more tests to Pair

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java?rev=1065236&r1=1065235&r2=1065236&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/PairTest.java Sun Jan 30 09:04:51 2011
@@ -18,6 +18,7 @@ package org.apache.commons.lang3;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNull;
 
 import java.io.ByteArrayInputStream;
@@ -58,6 +59,11 @@ public class PairTest {
     public void testEquals() throws Exception {
         assertEquals(Pair.of(null, "foo"), Pair.of(null, "foo"));
         assertFalse(Pair.of("foo", 0).equals(Pair.of("foo", null)));
+        assertFalse(Pair.of("foo", "bar").equals(Pair.of("xyz", "bar")));
+
+        Pair p = Pair.of("foo", "bar");
+        assertTrue(p.equals(p));
+        assertFalse(p.equals(new Object()));
     }
 
     @Test