commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r399141 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
Date Wed, 03 May 2006 04:59:10 GMT
Author: bayard
Date: Tue May  2 21:59:09 2006
New Revision: 399141

URL: http://svn.apache.org/viewcvs?rev=399141&view=rev
Log:
Committing a failing test (StackOverflow) as a part of #36061

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

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java?rev=399141&r1=399140&r2=399141&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java
Tue May  2 21:59:09 2006
@@ -946,4 +946,24 @@
     public void testReflectionNull() {
         assertEquals("<null>", ReflectionToStringBuilder.toString(null));
     }
+
+    public void testObjectCycle() {
+        ObjectCycle a = new ObjectCycle();
+        ObjectCycle b = new ObjectCycle();
+        a.obj = b;
+        b.obj = a;
+       
+        String expected = toBaseString(a) + "[" + toBaseString(b) + "[" + toBaseString(a)
+ "]]";
+        assertEquals(expected, a.toString());
+        validateEmptyReflectionRegistry();
+    }
+    
+    static class ObjectCycle {
+        Object obj;
+       
+        public String toString() {
+            return new ToStringBuilder(this).append(obj).toString();
+        }
+    }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message