Committing Bjorn's unit test as per LANG-372 to show that this is indeed an issue; and is expected

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@594387 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2007-11-13 01:25:42 +00:00
parent f7a005e41b
commit 930b389bac
1 changed files with 18 additions and 0 deletions

View File

@ -971,4 +971,22 @@ public class ToStringBuilderTest extends TestCase {
assertEquals("<null>", ReflectionToStringBuilder.toString(null)); 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);
}
} }