commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r594387 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
Date Tue, 13 Nov 2007 01:25:43 GMT
Author: bayard
Date: Mon Nov 12 17:25:42 2007
New Revision: 594387

URL: http://svn.apache.org/viewvc?rev=594387&view=rev
Log:
Committing Bjorn's unit test as per LANG-372 to show that this is indeed an issue; and is
expected

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java?rev=594387&r1=594386&r2=594387&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
Mon Nov 12 17:25:42 2007
@@ -971,4 +971,22 @@
         assertEquals("<null>", ReflectionToStringBuilder.toString(null));
     }
 
+    /**
+     * Points out failure to print anything from appendToString methods using MULTI_LINE_STYLE.
+     * See issue LANG-372.
+     */
+    class MultiLineTestObject {
+        Integer i = new Integer(31337);
+        public String toString() {
+            return new ToStringBuilder(this).append("testInt", i).toString();
+        }
+    }
+
+    public void testAppendToStringUsingMultiLineStyle() {
+        MultiLineTestObject obj = new MultiLineTestObject();
+        ToStringBuilder testBuilder = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                                          .appendToString(obj.toString());
+        assertEquals(testBuilder.toString().indexOf("testInt=31337"), -1);
+    }
+
 }



Mime
View raw message