commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [lang] Break up testIdentityToStringStringBuilder into multiple test methods.
Date Fri, 10 Nov 2017 18:54:18 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 22c304715 -> 10122741e


Break up testIdentityToStringStringBuilder into multiple test methods.

Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/10122741
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/10122741
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/10122741

Branch: refs/heads/master
Commit: 10122741eac52e218771f30c6dc2c0aca54ff006
Parents: 22c3047
Author: Gary Gregory <ggregory@apache.org>
Authored: Fri Nov 10 11:54:14 2017 -0700
Committer: Gary Gregory <ggregory@apache.org>
Committed: Fri Nov 10 11:54:14 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/commons/lang3/ObjectUtilsTest.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/10122741/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
index 445e5e2..06b97e2 100644
--- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
@@ -216,14 +216,22 @@ public class ObjectUtilsTest {
         final Integer i = Integer.valueOf(90);
         final String expected = "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
 
-        assertEquals(expected, ObjectUtils.identityToString(i));
-
         final StringBuilder builder = new StringBuilder();
         ObjectUtils.identityToString(builder, i);
         assertEquals(expected, builder.toString());
     }
 
     @Test
+    public void testIdentityToStringStringBuilderInUse() {
+        final Integer i = Integer.valueOf(90);
+        final String expected = "ABC = java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
+
+        final StringBuilder builder = new StringBuilder("ABC = ");
+        ObjectUtils.identityToString(builder, i);
+        assertEquals(expected, builder.toString());
+    }
+
+    @Test
     public void testIdentityToStringStringBuilderNullValue() {
         try {
             ObjectUtils.identityToString(new StringBuilder(), null);


Mime
View raw message