You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/03/18 13:33:04 UTC
svn commit: r755579 -
/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java
Author: sebb
Date: Wed Mar 18 12:33:03 2009
New Revision: 755579
URL: http://svn.apache.org/viewvc?rev=755579&view=rev
Log:
Test min and max are reflexive; test both nulls
Modified:
commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java
Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java?rev=755579&r1=755578&r2=755579&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java Wed Mar 18 12:33:03 2009
@@ -169,7 +169,7 @@
}
public void testNull() {
- assertTrue(ObjectUtils.NULL != null);
+ assertNotNull(ObjectUtils.NULL);
assertTrue(ObjectUtils.NULL instanceof ObjectUtils.Null);
assertSame(ObjectUtils.NULL, SerializationUtils.clone(ObjectUtils.NULL));
}
@@ -189,8 +189,11 @@
assertSame( nonNullComparable1, ObjectUtils.max( null, nonNullComparable1 ) );
assertSame( nonNullComparable1, ObjectUtils.max( nonNullComparable1, null ) );
assertSame( nonNullComparable1, ObjectUtils.max( nonNullComparable1, nonNullComparable2 ) );
+ assertSame( nonNullComparable2, ObjectUtils.max( nonNullComparable2, nonNullComparable1 ) );
assertSame( nonNullComparable1, ObjectUtils.max( nonNullComparable1, minComparable ) );
assertSame( nonNullComparable1, ObjectUtils.max( minComparable, nonNullComparable1 ) );
+
+ assertNull( ObjectUtils.max(null, null) );
}
public void testMin() {
@@ -206,7 +209,10 @@
assertSame( nonNullComparable1, ObjectUtils.min( null, nonNullComparable1 ) );
assertSame( nonNullComparable1, ObjectUtils.min( nonNullComparable1, null ) );
assertSame( nonNullComparable1, ObjectUtils.min( nonNullComparable1, nonNullComparable2 ) );
+ assertSame( nonNullComparable2, ObjectUtils.min( nonNullComparable2, nonNullComparable1 ) );
assertSame( minComparable, ObjectUtils.min( nonNullComparable1, minComparable ) );
assertSame( minComparable, ObjectUtils.min( minComparable, nonNullComparable1 ) );
+
+ assertNull( ObjectUtils.min(null, null) );
}
}