Skip to content
Browse files

Trying to find cause of Gump (and other) failures

Ensure that registry starts out empty

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1297125 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent a3a2af7 commit 1f9b6d187115955fcd3fc3a9588f21ef10ea8c87 @sebbASF sebbASF committed Mar 5, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
View
11 src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
@@ -170,6 +170,7 @@ public void testReflectionLongArray() {
@Test
public void testReflectionIntArray() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
int[] array = new int[] { 1, 2, -3, 4 };
String baseStr = this.toBaseString(array);
assertEquals(baseStr + "[{1,2,-3,4}]", ToStringBuilder.reflectionToString(array));
@@ -180,6 +181,7 @@ public void testReflectionIntArray() {
@Test
public void testReflectionShortArray() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
short[] array = new short[] { 1, 2, -3, 4 };
String baseStr = this.toBaseString(array);
assertEquals(baseStr + "[{1,2,-3,4}]", ToStringBuilder.reflectionToString(array));
@@ -200,6 +202,7 @@ public void testReflectionyteArray() {
@Test
public void testReflectionCharArray() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
char[] array = new char[] { 'A', '2', '_', 'D' };
String baseStr = this.toBaseString(array);
assertEquals(baseStr + "[{A,2,_,D}]", ToStringBuilder.reflectionToString(array));
@@ -283,6 +286,7 @@ public void testReflectionhortArrayArray() {
@Test
public void testReflectionByteArrayArray() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
byte[][] array = new byte[][] { { 1, 2 }, null, { 5 } };
String baseStr = this.toBaseString(array);
assertEquals(baseStr + "[{{1,2},<null>,{5}}]", ToStringBuilder.reflectionToString(array));
@@ -293,6 +297,7 @@ public void testReflectionByteArrayArray() {
@Test
public void testReflectionCharArrayArray() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
char[][] array = new char[][] { { 'A', 'B' }, null, { 'p' } };
String baseStr = this.toBaseString(array);
assertEquals(baseStr + "[{{A,B},<null>,{p}}]", ToStringBuilder.reflectionToString(array));
@@ -547,6 +552,7 @@ public String toString() {
*/
@Test
public void testSimpleReflectionObjectCycle() throws Exception {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
SimpleReflectionTestFixture simple = new SimpleReflectionTestFixture();
simple.o = simple;
assertEquals(this.toBaseString(simple) + "[o=" + this.toBaseString(simple) + "]", simple.toString());
@@ -560,6 +566,7 @@ public void testSimpleReflectionObjectCycle() throws Exception {
*/
@Test
public void testSelfInstanceVarReflectionObjectCycle() throws Exception {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
SelfInstanceVarReflectionTestFixture test = new SelfInstanceVarReflectionTestFixture();
assertEquals(this.toBaseString(test) + "[typeIsSelf=" + this.toBaseString(test) + "]", test.toString());
this.validateNullToStringStyleRegistry();
@@ -586,14 +593,15 @@ public void testSelfInstanceTwoVarsReflectionObjectCycle() throws Exception {
*/
@Test
public void testReflectionObjectCycle() throws Exception {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
ReflectionTestCycleA a = new ReflectionTestCycleA();
ReflectionTestCycleB b = new ReflectionTestCycleB();
a.b = b;
b.a = a;
assertEquals(
this.toBaseString(a) + "[b=" + this.toBaseString(b) + "[a=" + this.toBaseString(a) + "]]",
a.toString());
- this.validateNullToStringStyleRegistry();
+ validateNullToStringStyleRegistry();
}
/**
@@ -918,6 +926,7 @@ public void testBooleanArrayArray() {
@Test
public void testObjectCycle() {
+ validateNullToStringStyleRegistry(); // Ensure registry starts out empty
ObjectCycle a = new ObjectCycle();
ObjectCycle b = new ObjectCycle();
a.obj = b;

0 comments on commit 1f9b6d1

Please sign in to comment.
Something went wrong with that request. Please try again.