commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [2/4] [lang] Adding testcase to cover a missing branch.
Date Mon, 01 May 2017 09:48:45 GMT
Adding testcase to cover a missing branch.


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

Branch: refs/heads/master
Commit: 9766e22b42b7b3f3923cb9c2502dfc2dd5d0a5b0
Parents: ece2f25
Author: Basha <arbasha@paypalcorp.com>
Authored: Sat Apr 29 20:05:58 2017 +0530
Committer: Basha <arbasha@paypalcorp.com>
Committed: Sat Apr 29 20:06:31 2017 +0530

----------------------------------------------------------------------
 .../commons/lang3/builder/ToStringBuilderTest.java    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/9766e22b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
index b218329..8e32287 100644
--- a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.lang3.builder;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assume.assumeFalse;
@@ -838,6 +839,19 @@ public class ToStringBuilderTest {
         assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).append(null, (boolean[])
null, false).toString());
         assertEquals(baseStr + "[<size=4>]", new ToStringBuilder(base).append(null,
array, false).toString());
     }
+    
+    @Test
+    public void testConstructToStringBuilder(){
+        ToStringBuilder stringBuilder1 = new ToStringBuilder(base, null, null);
+        ToStringBuilder stringBuilder2 = new ToStringBuilder(base, ToStringStyle.DEFAULT_STYLE,
new StringBuffer(1024));
+        assertEquals(ToStringStyle.DEFAULT_STYLE, stringBuilder1.getStyle());
+        assertNotNull(stringBuilder1.getStringBuffer());
+        assertNotNull(stringBuilder1.toString());
+        assertEquals(ToStringStyle.DEFAULT_STYLE, stringBuilder2.getStyle());
+        assertNotNull(stringBuilder2.getStringBuffer());
+        assertNotNull(stringBuilder2.toString());
+    }
+
 
     @Test
     public void testObject() {


Mime
View raw message