http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java index 75bd48a..b2453a4 100644 --- a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java @@ -32,7 +32,7 @@ import org.junit.Test; * Unit tests {@link DiffBuilder}. */ public class DiffBuilderTest { - + private static final ToStringStyle SHORT_STYLE = ToStringStyle.SHORT_PREFIX_STYLE; private static class TypeTestClass implements Diffable<TypeTestClass> { @@ -78,20 +78,20 @@ public class DiffBuilderTest { .append("objectField", objectField, obj.objectField) .append("objectArrayField", objectArrayField, obj.objectArrayField) .build(); - } + } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, false); } - + @Override public boolean equals(final Object obj) { return EqualsBuilder.reflectionEquals(this, obj, false); } } - - + + @Test public void testBoolean() { final TypeTestClass class1 = new TypeTestClass(); @@ -102,7 +102,7 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Boolean.class, diff.getType()); assertEquals(Boolean.TRUE, diff.getLeft()); - assertEquals(Boolean.FALSE, diff.getRight()); + assertEquals(Boolean.FALSE, diff.getRight()); } @Test @@ -113,13 +113,13 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.booleanArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.booleanArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.booleanArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.booleanArrayField), (Object[]) diff.getRight()); } - + @Test public void testByte() { final TypeTestClass class1 = new TypeTestClass(); @@ -129,9 +129,9 @@ public class DiffBuilderTest { assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); assertEquals(Byte.valueOf(class1.byteField), diff.getLeft()); - assertEquals(Byte.valueOf(class2.byteField), diff.getRight()); + assertEquals(Byte.valueOf(class2.byteField), diff.getRight()); } - + @Test public void testByteArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -140,9 +140,9 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.byteArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.byteArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.byteArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.byteArrayField), (Object[]) diff.getRight()); } @@ -157,8 +157,8 @@ public class DiffBuilderTest { assertEquals(Character.valueOf(class1.charField), diff.getLeft()); assertEquals(Character.valueOf(class2.charField), diff.getRight()); } - - + + @Test public void testCharArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -167,13 +167,13 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.charArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.charArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.charArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.charArrayField), (Object[]) diff.getRight()); } - - + + @Test public void testDouble() { final TypeTestClass class1 = new TypeTestClass(); @@ -184,9 +184,9 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Double.valueOf(class1.doubleField), diff.getLeft()); assertEquals(Double.valueOf(class2.doubleField), diff.getRight()); - } + } + - @Test public void testDoubleArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -195,12 +195,12 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.doubleArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.doubleArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.doubleArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.doubleArrayField), (Object[]) diff.getRight()); } - + @Test public void testFloat() { final TypeTestClass class1 = new TypeTestClass(); @@ -211,9 +211,9 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Float.valueOf(class1.floatField), diff.getLeft()); assertEquals(Float.valueOf(class2.floatField), diff.getRight()); - } + } + - @Test public void testFloatArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -222,13 +222,13 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.floatArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.floatArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.floatArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.floatArrayField), (Object[]) diff.getRight()); - } - - + } + + @Test public void testInt() { final TypeTestClass class1 = new TypeTestClass(); @@ -239,9 +239,9 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Integer.valueOf(class1.intField), diff.getLeft()); assertEquals(Integer.valueOf(class2.intField), diff.getRight()); - } + } + - @Test public void testIntArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -250,12 +250,12 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.intArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.intArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.intArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.intArrayField), (Object[]) diff.getRight()); } - + @Test public void testLong() { final TypeTestClass class1 = new TypeTestClass(); @@ -266,9 +266,9 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Long.valueOf(class1.longField), diff.getLeft()); assertEquals(Long.valueOf(class2.longField), diff.getRight()); - } + } + - @Test public void testLongArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -277,12 +277,12 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.longArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.longArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.longArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.longArrayField), (Object[]) diff.getRight()); } - + @Test public void testShort() { final TypeTestClass class1 = new TypeTestClass(); @@ -293,9 +293,9 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertEquals(Short.valueOf(class1.shortField), diff.getLeft()); assertEquals(Short.valueOf(class2.shortField), diff.getRight()); - } + } + - @Test public void testShortArray() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -304,14 +304,14 @@ public class DiffBuilderTest { final DiffResult list = class1.diff(class2); assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); - assertArrayEquals(ArrayUtils.toObject(class1.shortArrayField), + assertArrayEquals(ArrayUtils.toObject(class1.shortArrayField), (Object[]) diff.getLeft()); - assertArrayEquals(ArrayUtils.toObject(class2.shortArrayField), + assertArrayEquals(ArrayUtils.toObject(class2.shortArrayField), (Object[]) diff.getRight()); } - + @Test - public void testObject() throws Exception { + public void testObject() throws Exception { final TypeTestClass class1 = new TypeTestClass(); final TypeTestClass class2 = new TypeTestClass(); class2.objectField = "Some string"; @@ -319,11 +319,11 @@ public class DiffBuilderTest { assertEquals(1, list.getNumberOfDiffs()); final Diff<?> diff = list.getDiffs().get(0); assertEquals(class1.objectField, diff.getLeft()); - assertEquals(class2.objectField, diff.getRight()); + assertEquals(class2.objectField, diff.getRight()); } - /** - * Test that "left" and "right" are the same instance and are equal. + /** + * Test that "left" and "right" are the same instance and are equal. */ @Test public void testObjectsSameAndEqual() throws Exception { @@ -339,8 +339,8 @@ public class DiffBuilderTest { assertEquals(0, list.getNumberOfDiffs()); } - /** - * Test that "left" and "right" are the same instance but are equal. + /** + * Test that "left" and "right" are the same instance but are equal. */ @Test public void testObjectsNotSameButEqual() throws Exception { @@ -355,8 +355,8 @@ public class DiffBuilderTest { assertEquals(0, list.getNumberOfDiffs()); } - /** - * Test that "left" and "right" are not the same instance and are not equal. + /** + * Test that "left" and "right" are not the same instance and are not equal. */ @Test public void testObjectsNotSameNorEqual() throws Exception { @@ -381,8 +381,8 @@ public class DiffBuilderTest { final Diff<?> diff = list.getDiffs().get(0); assertArrayEquals(class1.objectArrayField, (Object[]) diff.getLeft()); assertArrayEquals(class2.objectArrayField, (Object[]) diff.getRight()); - } - + } + @Test public void testObjectArrayEqual() throws Exception { final TypeTestClass class1 = new TypeTestClass(); @@ -391,9 +391,9 @@ public class DiffBuilderTest { class2.objectArrayField = new Object[] {"string", 1, 2}; final DiffResult list = class1.diff(class2); assertEquals(0, list.getNumberOfDiffs()); - } - - + } + + @Test public void testByteArrayEqualAsObject() throws Exception { final DiffResult list = new DiffBuilder("String1", "String2", SHORT_STYLE) @@ -410,7 +410,7 @@ public class DiffBuilderTest { assertEquals(0, list.getNumberOfDiffs()); } - + @Test public void testDiffResult() { final TypeTestClass class1 = new TypeTestClass(); @@ -425,25 +425,25 @@ public class DiffBuilderTest { } @Test(expected=IllegalArgumentException.class) - public void testNullLhs() { + public void testNullLhs() { new DiffBuilder(null, this, ToStringStyle.DEFAULT_STYLE); } - + @Test(expected=IllegalArgumentException.class) - public void testNullRhs() { + public void testNullRhs() { new DiffBuilder(this, null, ToStringStyle.DEFAULT_STYLE); - } - + } + @Test public void testSameObjectIgnoresAppends() { - final TypeTestClass testClass = new TypeTestClass(); + final TypeTestClass testClass = new TypeTestClass(); final DiffResult list = new DiffBuilder(testClass, testClass, SHORT_STYLE) .append("ignored", false, true) .build(); assertEquals(0, list.getNumberOfDiffs()); } - + @Test public void testSimilarObjectIgnoresAppends() { final TypeTestClass testClass1 = new TypeTestClass(); @@ -453,14 +453,14 @@ public class DiffBuilderTest { .build(); assertEquals(0, list.getNumberOfDiffs()); } - - + + @Test public void testStylePassedToDiffResult() { final TypeTestClass class1 = new TypeTestClass(); DiffResult list = class1.diff(class1); assertEquals(SHORT_STYLE, list.getToStringStyle()); - + class1.style = ToStringStyle.MULTI_LINE_STYLE; list = class1.diff(class1); assertEquals(ToStringStyle.MULTI_LINE_STYLE, list.getToStringStyle());
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/DiffTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/DiffTest.java b/src/test/java/org/apache/commons/lang3/builder/DiffTest.java index 26bf95a..1aff66f 100644 --- a/src/test/java/org/apache/commons/lang3/builder/DiffTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/DiffTest.java @@ -28,12 +28,12 @@ public class DiffTest { private static final String FIELD_NAME = "field"; private static final Diff<Boolean> booleanDiff = new BooleanDiff(FIELD_NAME); - - private static class BooleanDiff extends Diff<Boolean> { + + private static class BooleanDiff extends Diff<Boolean> { private static final long serialVersionUID = 1L; protected BooleanDiff(final String fieldName) { - super(fieldName); + super(fieldName); } @Override @@ -44,27 +44,27 @@ public class DiffTest { @Override public Boolean getRight() { return Boolean.FALSE; - } + } } - + @Test(expected = UnsupportedOperationException.class) public void testCannotModify() { booleanDiff.setValue(Boolean.FALSE); } - + @Test public void testGetFieldName() { assertEquals(FIELD_NAME, booleanDiff.getFieldName()); } - + @Test public void testGetType() { assertEquals(Boolean.class, booleanDiff.getType()); } - + @Test public void testToString() { - assertEquals(String.format("[%s: %s, %s]", FIELD_NAME, booleanDiff.getLeft(), + assertEquals(String.format("[%s: %s, %s]", FIELD_NAME, booleanDiff.getLeft(), booleanDiff.getRight()), booleanDiff.toString()); } } http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java index b5cfdfa..0e0f5f4 100644 --- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -99,7 +99,7 @@ public class EqualsBuilderTest { return b; } } - + static class TestEmptySubObject extends TestObject { public TestEmptySubObject(final int a) { super(a); @@ -150,17 +150,17 @@ public class EqualsBuilderTest { private final TestRecursiveInnerObject a; private final TestRecursiveInnerObject b; private int z; - - public TestRecursiveObject(final TestRecursiveInnerObject a, + + public TestRecursiveObject(final TestRecursiveInnerObject a, final TestRecursiveInnerObject b, final int z) { this.a = a; this.b = b; } - + public TestRecursiveInnerObject getA() { return a; } - + public TestRecursiveInnerObject getB() { return b; } @@ -168,7 +168,7 @@ public class EqualsBuilderTest { public int getZ() { return z; } - + } static class TestRecursiveInnerObject { @@ -176,7 +176,7 @@ public class EqualsBuilderTest { public TestRecursiveInnerObject(final int n) { this.n = n; } - + public int getN() { return n; } @@ -189,20 +189,20 @@ public class EqualsBuilderTest { this.n = n; this.cycle = this; } - + public TestRecursiveCycleObject(final TestRecursiveCycleObject cycle, final int n) { this.n = n; this.cycle = cycle; } - + public int getN() { return n; } - + public TestRecursiveCycleObject getCycle() { return cycle; } - + public void setCycle(final TestRecursiveCycleObject cycle) { this.cycle = cycle; } @@ -223,7 +223,7 @@ public class EqualsBuilderTest { assertFalse(EqualsBuilder.reflectionEquals(null, o2)); assertTrue(EqualsBuilder.reflectionEquals(null, null)); } - + @Test public void testReflectionHierarchyEquals() { testReflectionHierarchyEquals(false); @@ -306,7 +306,7 @@ public class EqualsBuilderTest { * @param toTer Left hand side, equal to to and toBis * @param to2 a different TestObject * @param oToChange a TestObject that will be changed - * @param testTransients whether to test transient instance variables + * @param testTransients whether to test transient instance variables */ private void testReflectionEqualsEquivalenceRelationship( final TestObject to, @@ -371,12 +371,12 @@ public class EqualsBuilderTest { assertTrue(new EqualsBuilder().append(o1, o2).isEquals()); assertFalse(new EqualsBuilder().append(o1, this).isEquals()); - + assertFalse(new EqualsBuilder().append(o1, null).isEquals()); assertFalse(new EqualsBuilder().append(null, o2).isEquals()); assertTrue(new EqualsBuilder().append((Object) null, null).isEquals()); } - + @Test public void testObjectBuild() { final TestObject o1 = new TestObject(4); @@ -387,7 +387,7 @@ public class EqualsBuilderTest { assertEquals(Boolean.TRUE, new EqualsBuilder().append(o1, o2).build()); assertEquals(Boolean.FALSE, new EqualsBuilder().append(o1, this).build()); - + assertEquals(Boolean.FALSE, new EqualsBuilder().append(o1, null).build()); assertEquals(Boolean.FALSE, new EqualsBuilder().append(null, o2).build()); assertEquals(Boolean.TRUE, new EqualsBuilder().append((Object) null, null).build()); @@ -401,17 +401,17 @@ public class EqualsBuilderTest { final TestRecursiveInnerObject i2_2 = new TestRecursiveInnerObject(2); final TestRecursiveInnerObject i3 = new TestRecursiveInnerObject(3); final TestRecursiveInnerObject i4 = new TestRecursiveInnerObject(4); - + final TestRecursiveObject o1_a = new TestRecursiveObject(i1_1, i2_1, 1); final TestRecursiveObject o1_b = new TestRecursiveObject(i1_2, i2_2, 1); final TestRecursiveObject o2 = new TestRecursiveObject(i3, i4, 2); final TestRecursiveObject oNull = new TestRecursiveObject(null, null, 2); - + assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_a).isEquals()); assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_b).isEquals()); - + assertFalse(new EqualsBuilder().setTestRecursive(true).append(o1_a, o2).isEquals()); - + assertTrue(new EqualsBuilder().setTestRecursive(true).append(oNull, oNull).isEquals()); assertFalse(new EqualsBuilder().setTestRecursive(true).append(o1_a, oNull).isEquals()); } @@ -421,7 +421,7 @@ public class EqualsBuilderTest { final TestRecursiveCycleObject o1_a = new TestRecursiveCycleObject(1); final TestRecursiveCycleObject o1_b = new TestRecursiveCycleObject(1); final TestRecursiveCycleObject o2 = new TestRecursiveCycleObject(2); - + assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_a).isEquals()); assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_b).isEquals()); assertFalse(new EqualsBuilder().setTestRecursive(true).append(o1_a, o2).isEquals()); @@ -432,19 +432,19 @@ public class EqualsBuilderTest { final TestRecursiveCycleObject o1_a = new TestRecursiveCycleObject(1); final TestRecursiveCycleObject i1_a = new TestRecursiveCycleObject(o1_a, 100); o1_a.setCycle(i1_a); - + final TestRecursiveCycleObject o1_b = new TestRecursiveCycleObject(1); final TestRecursiveCycleObject i1_b = new TestRecursiveCycleObject(o1_b, 100); o1_b.setCycle(i1_b); - + final TestRecursiveCycleObject o2 = new TestRecursiveCycleObject(2); final TestRecursiveCycleObject i2 = new TestRecursiveCycleObject(o1_b, 200); o2.setCycle(i2); - + assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_a).isEquals()); assertTrue(new EqualsBuilder().setTestRecursive(true).append(o1_a, o1_b).isEquals()); assertFalse(new EqualsBuilder().setTestRecursive(true).append(o1_a, o2).isEquals()); - + assertTrue(EqualsBuilder.reflectionEquals(o1_a, o1_b, false, null, true)); assertFalse(EqualsBuilder.reflectionEquals(o1_a, o2, false, null, true)); } @@ -530,7 +530,7 @@ public class EqualsBuilderTest { equalsBuilder.reset(); assertTrue(equalsBuilder.isEquals()); } - + @Test public void testBoolean() { final boolean o1 = true; @@ -549,7 +549,7 @@ public class EqualsBuilderTest { obj2[0] = new TestObject(4); obj2[1] = new TestObject(5); obj2[2] = null; - + assertTrue(new EqualsBuilder().append(obj1, obj1).isEquals()); assertTrue(new EqualsBuilder().append(obj2, obj2).isEquals()); assertTrue(new EqualsBuilder().append(obj1, obj2).isEquals()); @@ -561,7 +561,7 @@ public class EqualsBuilderTest { assertFalse(new EqualsBuilder().append(obj1, obj2).isEquals()); obj1[2] = null; assertTrue(new EqualsBuilder().append(obj1, obj2).isEquals()); - + obj2 = null; assertFalse(new EqualsBuilder().append(obj1, obj2).isEquals()); obj1 = null; @@ -846,7 +846,7 @@ public class EqualsBuilderTest { assertTrue(new EqualsBuilder().append(array1, array2).isEquals()); array1[1][1] = false; assertFalse(new EqualsBuilder().append(array1, array2).isEquals()); - + // compare 1 dim to 2. final boolean[] array3 = new boolean[]{true, true}; assertFalse(new EqualsBuilder().append(array1, array3).isEquals()); @@ -1052,7 +1052,7 @@ public class EqualsBuilderTest { array1[1] = true; assertFalse(new EqualsBuilder().append(obj1, obj2).isEquals()); } - + public static class TestACanEqualB { private final int a; @@ -1114,7 +1114,7 @@ public class EqualsBuilderTest { return this.b; } } - + /** * Tests two instances of classes that can be equal and that are not "related". The two classes are not subclasses * of each other and do not share a parent aside from Object. @@ -1140,7 +1140,7 @@ public class EqualsBuilderTest { assertTrue(new EqualsBuilder().append(x, y).isEquals()); assertTrue(new EqualsBuilder().append(y, x).isEquals()); } - + /** * Test from http://issues.apache.org/bugzilla/show_bug.cgi?id=33067 */ @@ -1193,7 +1193,7 @@ public class EqualsBuilderTest { this.three = new TestObject(three); } } - + /** * Test cyclical object references which cause a StackOverflowException if * not handled properly. s. LANG-606 @@ -1242,7 +1242,7 @@ public class EqualsBuilderTest { return EqualsBuilder.reflectionEquals(this, obj); } } - + @Test public void testReflectionArrays() throws Exception { @@ -1256,11 +1256,11 @@ public class EqualsBuilderTest { assertFalse(EqualsBuilder.reflectionEquals(o1, o2)); assertTrue(EqualsBuilder.reflectionEquals(o1, o1)); assertTrue(EqualsBuilder.reflectionEquals(o1, o3)); - + final double[] d1 = { 0, 1 }; final double[] d2 = { 2, 3 }; final double[] d3 = { 0, 1 }; - + assertFalse(EqualsBuilder.reflectionEquals(d1, d2)); assertTrue(EqualsBuilder.reflectionEquals(d1, d1)); assertTrue(EqualsBuilder.reflectionEquals(d1, d3)); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java index aa61e02..f39d26a 100644 --- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderAndEqualsBuilderTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -72,9 +72,9 @@ public class HashCodeBuilderAndEqualsBuilderTest { } /** - * Asserts that if <code>lhs</code> equals <code>rhs</code> + * Asserts that if <code>lhs</code> equals <code>rhs</code> * then their hash codes MUST be identical. - * + * * @param lhs The Left-Hand-Side of the equals test * @param rhs The Right-Hand-Side of the equals test * @param testTransients whether to test transient fields http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java index 633f5f5..4ded427 100644 --- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -61,7 +61,7 @@ public class HashCodeBuilderTest { public void testConstructorExEvenFirst() { new HashCodeBuilder(2, 3); } - + @Test(expected=IllegalArgumentException.class) public void testConstructorExEvenSecond() { new HashCodeBuilder(3, 2); @@ -195,7 +195,7 @@ public class HashCodeBuilderTest { obj = new Object(); assertEquals(17 * 37 + obj.hashCode(), new HashCodeBuilder(17, 37).append(obj).toHashCode()); } - + @Test public void testObjectBuild() { Object obj = null; @@ -529,7 +529,7 @@ public class HashCodeBuilderTest { final ReflectionTestCycleB b = new ReflectionTestCycleB(); a.b = b; b.a = a; - + // Used to caused: // java.lang.StackOverflowError // at java.lang.ClassLoader.getCallerClassLoader(Native Method) @@ -559,7 +559,7 @@ public class HashCodeBuilderTest { @Test public void testToHashCodeEqualsHashCode() { final HashCodeBuilder hcb = new HashCodeBuilder(17, 37).append(new Object()).append('a'); - assertEquals("hashCode() is no longer returning the same value as toHashCode() - see LANG-520", + assertEquals("hashCode() is no longer returning the same value as toHashCode() - see LANG-520", hcb.toHashCode(), hcb.hashCode()); } http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java index c60dc05..6f76cfe 100644 --- a/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -224,7 +224,7 @@ public class JsonToStringStyleTest { .append("age", p.age).append("smoker", p.smoker) .toString()); } - + @Test public void testNestingPerson() { final Person p = new Person(){ @@ -357,10 +357,10 @@ public class JsonToStringStyleTest { } catch (final UnsupportedOperationException e) { } } - + /** * An object with nested object structures used to test {@link ToStringStyle.JsonToStringStyle}. - * + * */ static class NestingPerson { /** http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java index 8454c5b..ca02df0 100644 --- a/src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/MultiLineToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,7 +33,7 @@ public class MultiLineToStringStyleTest { private final Integer base = Integer.valueOf(5); private final String baseStr = base.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(base)); - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(ToStringStyle.MULTI_LINE_STYLE); @@ -55,12 +55,12 @@ public class MultiLineToStringStyleTest { public void testAppendSuper() { assertEquals(baseStr + "[" + System.lineSeparator() + "]", new ToStringBuilder(base).appendSuper("Integer@8888[" + System.lineSeparator() + "]").toString()); assertEquals(baseStr + "[" + System.lineSeparator() + " <null>" + System.lineSeparator() + "]", new ToStringBuilder(base).appendSuper("Integer@8888[" + System.lineSeparator() + " <null>" + System.lineSeparator() + "]").toString()); - + assertEquals(baseStr + "[" + System.lineSeparator() + " a=hello" + System.lineSeparator() + "]", new ToStringBuilder(base).appendSuper("Integer@8888[" + System.lineSeparator() + "]").append("a", "hello").toString()); assertEquals(baseStr + "[" + System.lineSeparator() + " <null>" + System.lineSeparator() + " a=hello" + System.lineSeparator() + "]", new ToStringBuilder(base).appendSuper("Integer@8888[" + System.lineSeparator() + " <null>" + System.lineSeparator() + "]").append("a", "hello").toString()); assertEquals(baseStr + "[" + System.lineSeparator() + " a=hello" + System.lineSeparator() + "]", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java index 08c6382..cb08ae0 100644 --- a/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,9 +33,9 @@ public class MultilineRecursiveToStringStyleTest { @Test public void simpleObject() { final Transaction tx = new Transaction("2014.10.15", 100); - final String expected = getClassPrefix(tx) + "[" + BR - + " amount=100.0," + BR - + " date=2014.10.15" + BR + final String expected = getClassPrefix(tx) + "[" + BR + + " amount=100.0," + BR + + " date=2014.10.15" + BR + "]"; assertEquals(expected, toString(tx)); } @@ -45,12 +45,12 @@ public class MultilineRecursiveToStringStyleTest { final Customer customer = new Customer("Douglas Adams"); final Bank bank = new Bank("ASF Bank"); customer.bank = bank; - final String exp = getClassPrefix(customer) + "[" + BR - + " name=Douglas Adams," + BR - + " bank=" + getClassPrefix(bank) + "[" + BR - + " name=ASF Bank" + BR - + " ]," + BR - + " accounts=<null>" + BR + final String exp = getClassPrefix(customer) + "[" + BR + + " name=Douglas Adams," + BR + + " bank=" + getClassPrefix(bank) + "[" + BR + + " name=ASF Bank" + BR + + " ]," + BR + + " accounts=<null>" + BR + "]"; assertEquals(exp, toString(customer)); } @@ -62,18 +62,18 @@ public class MultilineRecursiveToStringStyleTest { final Transaction tx2 = new Transaction("2014.10.15", 50); acc.transactions.add(tx1); acc.transactions.add(tx2); - final String expected = getClassPrefix(acc) + "[" + BR - + " owner=<null>," + BR - + " transactions=" + getClassPrefix(acc.transactions) + "{" + BR - + " " + getClassPrefix(tx1) + "[" + BR - + " amount=100.0," + BR - + " date=2014.10.14" + BR - + " ]," + BR + final String expected = getClassPrefix(acc) + "[" + BR + + " owner=<null>," + BR + + " transactions=" + getClassPrefix(acc.transactions) + "{" + BR + + " " + getClassPrefix(tx1) + "[" + BR + + " amount=100.0," + BR + + " date=2014.10.14" + BR + + " ]," + BR + " " + getClassPrefix(tx2) + "[" + BR - + " amount=50.0," + BR - + " date=2014.10.15" + BR - + " ]" + BR - + " }" + BR + + " amount=50.0," + BR + + " date=2014.10.15" + BR + + " ]" + BR + + " }" + BR + "]"; assertEquals(expected, toString(acc)); } @@ -81,13 +81,13 @@ public class MultilineRecursiveToStringStyleTest { @Test public void noArray() { final WithArrays wa = new WithArrays(); - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + " charArray=<null>," + BR - + " intArray=<null>," + BR - + " doubleArray=<null>," + BR - + " longArray=<null>," + BR - + " stringArray=<null>" + BR + + " intArray=<null>," + BR + + " doubleArray=<null>," + BR + + " longArray=<null>," + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -96,17 +96,17 @@ public class MultilineRecursiveToStringStyleTest { public void boolArray() { final WithArrays wa = new WithArrays(); wa.boolArray = new boolean[] { true, false, true }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray={" + BR - + " true," + BR - + " false," + BR - + " true" + BR - + " }," + BR - + " charArray=<null>," + BR - + " intArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray={" + BR + + " true," + BR + + " false," + BR + + " true" + BR + + " }," + BR + + " charArray=<null>," + BR + + " intArray=<null>," + BR + " doubleArray=<null>," + BR - + " longArray=<null>," + BR - + " stringArray=<null>" + BR + + " longArray=<null>," + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -115,16 +115,16 @@ public class MultilineRecursiveToStringStyleTest { public void charArray() { final WithArrays wa = new WithArrays(); wa.charArray = new char[] { 'a', 'A' }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR - + " charArray={" + BR - + " a," + BR - + " A" + BR - + " }," + BR - + " intArray=<null>," + BR - + " doubleArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + + " charArray={" + BR + + " a," + BR + + " A" + BR + + " }," + BR + + " intArray=<null>," + BR + + " doubleArray=<null>," + BR + " longArray=<null>," + BR - + " stringArray=<null>" + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -133,16 +133,16 @@ public class MultilineRecursiveToStringStyleTest { public void intArray() { final WithArrays wa = new WithArrays(); wa.intArray = new int[] { 1, 2 }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR - + " charArray=<null>," + BR - + " intArray={" + BR - + " 1," + BR - + " 2" + BR - + " }," + BR - + " doubleArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + + " charArray=<null>," + BR + + " intArray={" + BR + + " 1," + BR + + " 2" + BR + + " }," + BR + + " doubleArray=<null>," + BR + " longArray=<null>," + BR - + " stringArray=<null>" + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -151,16 +151,16 @@ public class MultilineRecursiveToStringStyleTest { public void doubleArray() { final WithArrays wa = new WithArrays(); wa.doubleArray = new double[] { 1, 2 }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + " charArray=<null>," + BR - + " intArray=<null>," + BR - + " doubleArray={" + BR - + " 1.0," + BR - + " 2.0" + BR + + " intArray=<null>," + BR + + " doubleArray={" + BR + + " 1.0," + BR + + " 2.0" + BR + " }," + BR - + " longArray=<null>," + BR - + " stringArray=<null>" + BR + + " longArray=<null>," + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -169,16 +169,16 @@ public class MultilineRecursiveToStringStyleTest { public void longArray() { final WithArrays wa = new WithArrays(); wa.longArray = new long[] { 1L, 2L }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + " charArray=<null>," + BR - + " intArray=<null>," + BR - + " doubleArray=<null>," + BR - + " longArray={" + BR - + " 1," + BR + + " intArray=<null>," + BR + + " doubleArray=<null>," + BR + + " longArray={" + BR + + " 1," + BR + " 2" + BR - + " }," + BR - + " stringArray=<null>" + BR + + " }," + BR + + " stringArray=<null>" + BR + "]"; assertEquals(exp, toString(wa)); } @@ -187,30 +187,30 @@ public class MultilineRecursiveToStringStyleTest { public void stringArray() { final WithArrays wa = new WithArrays(); wa.stringArray = new String[] { "a", "A" }; - final String exp = getClassPrefix(wa) + "[" + BR - + " boolArray=<null>," + BR + final String exp = getClassPrefix(wa) + "[" + BR + + " boolArray=<null>," + BR + " charArray=<null>," + BR - + " intArray=<null>," + BR - + " doubleArray=<null>," + BR - + " longArray=<null>," + BR + + " intArray=<null>," + BR + + " doubleArray=<null>," + BR + + " longArray=<null>," + BR + " stringArray={" + BR - + " a," + BR - + " A" + BR - + " }" + BR + + " a," + BR + + " A" + BR + + " }" + BR + "]"; assertEquals(exp, toString(wa)); } - - + + @Test public void testLANG1319() throws Exception { final String[] stringArray = {"1", "2"}; - - final String exp = getClassPrefix(stringArray) + "[" + BR - + " {" + BR - + " 1," + BR - + " 2" + BR - + " }" + BR + + final String exp = getClassPrefix(stringArray) + "[" + BR + + " {" + BR + + " 1," + BR + + " 2" + BR + + " }" + BR + "]"; assertEquals(exp, toString(stringArray)); } http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/NoClassNameToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/NoClassNameToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/NoClassNameToStringStyleTest.java index 73184a5..4865b03 100644 --- a/src/test/java/org/apache/commons/lang3/builder/NoClassNameToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/NoClassNameToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java index d5388a9..defd998 100644 --- a/src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/NoFieldNamesToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,7 +33,7 @@ public class NoFieldNamesToStringStyleTest { private final Integer base = Integer.valueOf(5); private final String baseStr = base.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(base)); - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(ToStringStyle.NO_FIELD_NAMES_STYLE); @@ -45,7 +45,7 @@ public class NoFieldNamesToStringStyleTest { } //---------------------------------------------------------------- - + @Test public void testBlank() { assertEquals(baseStr + "[]", new ToStringBuilder(base).toString()); @@ -55,12 +55,12 @@ public class NoFieldNamesToStringStyleTest { public void testAppendSuper() { assertEquals(baseStr + "[]", new ToStringBuilder(base).appendSuper("Integer@8888[]").toString()); assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").toString()); - + assertEquals(baseStr + "[hello]", new ToStringBuilder(base).appendSuper("Integer@8888[]").append("a", "hello").toString()); assertEquals(baseStr + "[<null>,hello]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").append("a", "hello").toString()); assertEquals(baseStr + "[hello]", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java index dbf36c1..d46dd6d 100644 --- a/src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/RecursiveToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,7 +32,7 @@ public class RecursiveToStringStyleTest { private final Integer base = Integer.valueOf(5); private final String baseStr = base.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(base)); - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(new RecursiveToStringStyle()); @@ -44,7 +44,7 @@ public class RecursiveToStringStyleTest { } //---------------------------------------------------------------- - + @Test public void testBlank() { assertEquals(baseStr + "[]", new ToStringBuilder(base).toString()); @@ -54,25 +54,25 @@ public class RecursiveToStringStyleTest { public void testAppendSuper() { assertEquals(baseStr + "[]", new ToStringBuilder(base).appendSuper("Integer@8888[]").toString()); assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").toString()); - + assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[]").append("a", "hello").toString()); assertEquals(baseStr + "[<null>,a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").append("a", "hello").toString()); assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); final Integer i4 = Integer.valueOf(4); final ArrayList<Object> emptyList = new ArrayList<>(); - + assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).append((Object) null).toString()); assertEquals(baseStr + "[3]", new ToStringBuilder(base).append(i3).toString()); assertEquals(baseStr + "[a=<null>]", new ToStringBuilder(base).append("a", (Object) null).toString()); assertEquals(baseStr + "[a=3]", new ToStringBuilder(base).append("a", i3).toString()); assertEquals(baseStr + "[a=3,b=4]", new ToStringBuilder(base).append("a", i3).append("b", i4).toString()); assertEquals(baseStr + "[a=<Integer>]", new ToStringBuilder(base).append("a", i3, false).toString()); - assertEquals(baseStr + "[a=<size=0>]", new ToStringBuilder(base).append("a", emptyList, false).toString()); + assertEquals(baseStr + "[a=<size=0>]", new ToStringBuilder(base).append("a", emptyList, false).toString()); assertEquals(baseStr + "[a=java.util.ArrayList@" + Integer.toHexString(System.identityHashCode(emptyList)) + "{}]", new ToStringBuilder(base).append("a", emptyList, true).toString()); assertEquals(baseStr + "[a=<size=0>]", new ToStringBuilder(base).append("a", new HashMap<>(), false).toString()); @@ -147,13 +147,13 @@ public class RecursiveToStringStyleTest { * Test boolean field. */ boolean smoker; - + /** * Test Object field. */ Job job; } - + static class Job { /** * Test String field. http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java index d5249d5..7cd899e 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java @@ -42,7 +42,7 @@ import org.junit.Test; * <p> * The tests on the non-thread-safe collections do not pass. * </p> - * + * * @see <a href="https://issues.apache.org/jira/browse/LANG-762">[LANG-762] Handle or document ReflectionToStringBuilder * and ToStringBuilder for collections that are not thread safe</a> * @since 3.1 http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java index dd94c51..4250ddf 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,26 +35,26 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { this.testStringField = b; } } - + private static final String INTEGER_FIELD_NAME = "testIntegerField"; private static final String STRING_FIELD_NAME = "testStringField"; private final TestFixture BOTH_NON_NULL = new TestFixture(0, "str"); private final TestFixture FIRST_NULL = new TestFixture(null, "str"); private final TestFixture SECOND_NULL = new TestFixture(0, null); private final TestFixture BOTH_NULL = new TestFixture(null, null); - + @Test public void test_NonExclude(){ //normal case= String toString = ReflectionToStringBuilder.toString(BOTH_NON_NULL, null, false, false, false, null); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + //make one null toString = ReflectionToStringBuilder.toString(FIRST_NULL, null, false, false, false, null); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + //other one null toString = ReflectionToStringBuilder.toString(SECOND_NULL, null, false, false, false, null); assertTrue(toString.contains(INTEGER_FIELD_NAME)); @@ -65,31 +65,31 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); } - + @Test public void test_excludeNull(){ - + //test normal case String toString = ReflectionToStringBuilder.toString(BOTH_NON_NULL, null, false, false, true, null); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + //make one null toString = ReflectionToStringBuilder.toString(FIRST_NULL, null, false, false, true, null); assertFalse(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + //other one null toString = ReflectionToStringBuilder.toString(SECOND_NULL, null, false, false, true, null); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertFalse(toString.contains(STRING_FIELD_NAME)); - + //both null toString = ReflectionToStringBuilder.toString(BOTH_NULL, null, false, false, true, null); assertFalse(toString.contains(INTEGER_FIELD_NAME)); assertFalse(toString.contains(STRING_FIELD_NAME)); } - + @Test public void test_ConstructorOption(){ ReflectionToStringBuilder builder = new ReflectionToStringBuilder(BOTH_NON_NULL, null, null, null, false, false, true); @@ -97,23 +97,23 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { String toString = builder.toString(); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + builder = new ReflectionToStringBuilder(FIRST_NULL, null, null, null, false, false, true); toString = builder.toString(); assertFalse(toString.contains(INTEGER_FIELD_NAME)); assertTrue(toString.contains(STRING_FIELD_NAME)); - + builder = new ReflectionToStringBuilder(SECOND_NULL, null, null, null, false, false, true); toString = builder.toString(); assertTrue(toString.contains(INTEGER_FIELD_NAME)); assertFalse(toString.contains(STRING_FIELD_NAME)); - + builder = new ReflectionToStringBuilder(BOTH_NULL, null, null, null, false, false, true); toString = builder.toString(); assertFalse(toString.contains(INTEGER_FIELD_NAME)); assertFalse(toString.contains(STRING_FIELD_NAME)); } - + @Test public void test_ConstructorOptionNormal(){ ReflectionToStringBuilder builder = new ReflectionToStringBuilder(BOTH_NULL, null, null, null, false, false, false); @@ -121,24 +121,24 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { String toString = builder.toString(); assertTrue(toString.contains(STRING_FIELD_NAME)); assertTrue(toString.contains(INTEGER_FIELD_NAME)); - + //regression test older constructors ReflectionToStringBuilder oldBuilder = new ReflectionToStringBuilder(BOTH_NULL); toString = oldBuilder.toString(); assertTrue(toString.contains(STRING_FIELD_NAME)); assertTrue(toString.contains(INTEGER_FIELD_NAME)); - + oldBuilder = new ReflectionToStringBuilder(BOTH_NULL, null, null, null, false, false); toString = oldBuilder.toString(); assertTrue(toString.contains(STRING_FIELD_NAME)); assertTrue(toString.contains(INTEGER_FIELD_NAME)); - + oldBuilder = new ReflectionToStringBuilder(BOTH_NULL, null, null); toString = oldBuilder.toString(); assertTrue(toString.contains(STRING_FIELD_NAME)); assertTrue(toString.contains(INTEGER_FIELD_NAME)); } - + @Test public void test_ConstructorOption_ExcludeNull(){ ReflectionToStringBuilder builder = new ReflectionToStringBuilder(BOTH_NULL, null, null, null, false, false, false); @@ -147,12 +147,12 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { String toString = builder.toString(); assertFalse(toString.contains(STRING_FIELD_NAME)); assertFalse(toString.contains(INTEGER_FIELD_NAME)); - + builder = new ReflectionToStringBuilder(BOTH_NULL, null, null, null, false, false, true); toString = builder.toString(); assertFalse(toString.contains(STRING_FIELD_NAME)); assertFalse(toString.contains(INTEGER_FIELD_NAME)); - + ReflectionToStringBuilder oldBuilder = new ReflectionToStringBuilder(BOTH_NULL); oldBuilder.setExcludeNullValues(true); assertTrue(oldBuilder.isExcludeNullValues()); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java index c36d254..aa8909e 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeWithAnnotationTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeWithAnnotationTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeWithAnnotationTest.java index fb237a5..a28cbb1 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeWithAnnotationTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeWithAnnotationTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java index 8cb58e5..2cf2408 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,7 +29,7 @@ import org.junit.Test; * The {@link ToStringStyle} class includes a registry to avoid infinite loops for objects with circular references. We * want to make sure that we do not get concurrency exceptions accessing this registry. * </p> - * + * * @see <a href="https://issues.apache.org/jira/browse/LANG-762">[LANG-762] Handle or document ReflectionToStringBuilder * and ToStringBuilder for collections that are not thread safe</a> * @since 3.1 http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java index e27e9f1..62b8bac 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ShortPrefixToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,7 +33,7 @@ public class ShortPrefixToStringStyleTest { private final Integer base = Integer.valueOf(5); private final String baseStr = "Integer"; - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(ToStringStyle.SHORT_PREFIX_STYLE); @@ -45,7 +45,7 @@ public class ShortPrefixToStringStyleTest { } //---------------------------------------------------------------- - + @Test public void testBlank() { assertEquals(baseStr + "[]", new ToStringBuilder(base).toString()); @@ -55,12 +55,12 @@ public class ShortPrefixToStringStyleTest { public void testAppendSuper() { assertEquals(baseStr + "[]", new ToStringBuilder(base).appendSuper("Integer@8888[]").toString()); assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").toString()); - + assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[]").append("a", "hello").toString()); assertEquals(baseStr + "[<null>,a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[<null>]").append("a", "hello").toString()); assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); @@ -125,5 +125,5 @@ public class ShortPrefixToStringStyleTest { assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).append(array).toString()); assertEquals(baseStr + "[<null>]", new ToStringBuilder(base).append((Object) array).toString()); } - + } http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/SimpleToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/SimpleToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/SimpleToStringStyleTest.java index 1bf18db..63ea46b 100644 --- a/src/test/java/org/apache/commons/lang3/builder/SimpleToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/SimpleToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,7 +32,7 @@ import org.junit.Test; public class SimpleToStringStyleTest { private final Integer base = Integer.valueOf(5); - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(ToStringStyle.SIMPLE_STYLE); @@ -44,7 +44,7 @@ public class SimpleToStringStyleTest { } //---------------------------------------------------------------- - + @Test public void testBlank() { assertEquals("", new ToStringBuilder(base).toString()); @@ -54,12 +54,12 @@ public class SimpleToStringStyleTest { public void testAppendSuper() { assertEquals("", new ToStringBuilder(base).appendSuper("").toString()); assertEquals("<null>", new ToStringBuilder(base).appendSuper("<null>").toString()); - + assertEquals("hello", new ToStringBuilder(base).appendSuper("").append("a", "hello").toString()); assertEquals("<null>,hello", new ToStringBuilder(base).appendSuper("<null>").append("a", "hello").toString()); assertEquals("hello", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java index 17b19d0..fb60bc3 100644 --- a/src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/StandardToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,9 +33,9 @@ public class StandardToStringStyleTest { private final Integer base = Integer.valueOf(5); private final String baseStr = "Integer"; - + private static final StandardToStringStyle STYLE = new StandardToStringStyle(); - + static { STYLE.setUseShortClassName(true); STYLE.setUseIdentityHashCode(false); @@ -48,7 +48,7 @@ public class StandardToStringStyleTest { STYLE.setSummaryObjectStartText("%"); STYLE.setSummaryObjectEndText("%"); } - + @Before public void setUp() throws Exception { ToStringBuilder.setDefaultStyle(STYLE); @@ -60,7 +60,7 @@ public class StandardToStringStyleTest { } //---------------------------------------------------------------- - + @Test public void testBlank() { assertEquals(baseStr + "[]", new ToStringBuilder(base).toString()); @@ -70,12 +70,12 @@ public class StandardToStringStyleTest { public void testAppendSuper() { assertEquals(baseStr + "[]", new ToStringBuilder(base).appendSuper("Integer@8888[]").toString()); assertEquals(baseStr + "[%NULL%]", new ToStringBuilder(base).appendSuper("Integer@8888[%NULL%]").toString()); - + assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[]").append("a", "hello").toString()); assertEquals(baseStr + "[%NULL%,a=hello]", new ToStringBuilder(base).appendSuper("Integer@8888[%NULL%]").append("a", "hello").toString()); assertEquals(baseStr + "[a=hello]", new ToStringBuilder(base).appendSuper(null).append("a", "hello").toString()); } - + @Test public void testObject() { final Integer i3 = Integer.valueOf(3); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/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 8e32287..619b9f2 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java @@ -40,7 +40,7 @@ public class ToStringBuilderTest { private final String baseStr = base.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(base)); /* - * All tests should leave the registry empty. + * All tests should leave the registry empty. */ @After public void after(){ @@ -839,7 +839,7 @@ 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); @@ -870,7 +870,7 @@ public class ToStringBuilderTest { assertEquals(baseStr + "[a=<size=0>]", new ToStringBuilder(base).append("a", (Object) new String[0], false).toString()); assertEquals(baseStr + "[a={}]", new ToStringBuilder(base).append("a", (Object) new String[0], true).toString()); } - + @Test public void testObjectBuild() { final Integer i3 = Integer.valueOf(3); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java index 40dd273..83fa068 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java @@ -40,7 +40,7 @@ import org.junit.Test; * <p> * This test passes but only tests one aspect of the issue. * </p> - * + * * @see <a href="https://issues.apache.org/jira/browse/LANG-762">[LANG-762] Handle or document ReflectionToStringBuilder * and ToStringBuilder for collections that are not thread safe</a> * @since 3.1 http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java index 81a8b83..a2d9d34 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -117,7 +117,7 @@ public class ToStringStyleTest { /** * An object used to test {@link ToStringStyle}. - * + * */ static class Person { /** http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializerTest.java b/src/test/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializerTest.java index caad3b3..5d64378 100644 --- a/src/test/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializerTest.java +++ b/src/test/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializerTest.java @@ -68,7 +68,7 @@ public class CallableBackgroundInitializerTest { exec.shutdown(); exec.awaitTermination(1, TimeUnit.SECONDS); } - + } /** http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/concurrent/CircuitBreakingExceptionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/concurrent/CircuitBreakingExceptionTest.java b/src/test/java/org/apache/commons/lang3/concurrent/CircuitBreakingExceptionTest.java index a794018..df81478 100644 --- a/src/test/java/org/apache/commons/lang3/concurrent/CircuitBreakingExceptionTest.java +++ b/src/test/java/org/apache/commons/lang3/concurrent/CircuitBreakingExceptionTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,54 +28,54 @@ import static org.junit.Assert.assertNull; * JUnit tests for {@link CircuitBreakingException}. */ public class CircuitBreakingExceptionTest extends AbstractExceptionTest { - + @Test(expected = CircuitBreakingException.class) public void testThrowingInformativeException() throws Exception { throw new CircuitBreakingException(EXCEPTION_MESSAGE, generateCause()); } - + @Test(expected = CircuitBreakingException.class) public void testThrowingExceptionWithMessage() throws Exception { throw new CircuitBreakingException(EXCEPTION_MESSAGE); } - + @Test(expected = CircuitBreakingException.class) public void testThrowingExceptionWithCause() throws Exception { throw new CircuitBreakingException(generateCause()); } - + @Test(expected = CircuitBreakingException.class) public void testThrowingEmptyException() throws Exception { throw new CircuitBreakingException(); } - + @Test public void testWithCauseAndMessage() throws Exception { final Exception exception = new CircuitBreakingException(EXCEPTION_MESSAGE, generateCause()); assertNotNull(exception); assertEquals(WRONG_EXCEPTION_MESSAGE, EXCEPTION_MESSAGE, exception.getMessage()); - + final Throwable cause = exception.getCause(); assertNotNull(cause); assertEquals(WRONG_CAUSE_MESSAGE, CAUSE_MESSAGE, cause.getMessage()); } - + @Test public void testWithoutCause() throws Exception { final Exception exception = new CircuitBreakingException(EXCEPTION_MESSAGE); assertNotNull(exception); assertEquals(WRONG_EXCEPTION_MESSAGE, EXCEPTION_MESSAGE, exception.getMessage()); - + final Throwable cause = exception.getCause(); assertNull(cause); } - + @Test public void testWithoutMessage() throws Exception { final Exception exception = new CircuitBreakingException(generateCause()); assertNotNull(exception); assertNotNull(exception.getMessage()); - + final Throwable cause = exception.getCause(); assertNotNull(cause); assertEquals(WRONG_CAUSE_MESSAGE, CAUSE_MESSAGE, cause.getMessage()); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java index f5b74ff..ffa78d6 100644 --- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java +++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java @@ -49,7 +49,7 @@ public class EventListenerSupportTest { assertEquals(0, listeners.length); assertEquals(VetoableChangeListener.class, listeners.getClass().getComponentType()); final VetoableChangeListener[] empty = listeners; - //for fun, show that the same empty instance is used + //for fun, show that the same empty instance is used assertSame(empty, listenerSupport.getListeners()); final VetoableChangeListener listener1 = EasyMock.createNiceMock(VetoableChangeListener.class); @@ -117,7 +117,7 @@ public class EventListenerSupportTest { assertEquals(0, listeners.length); assertEquals(VetoableChangeListener.class, listeners.getClass().getComponentType()); final VetoableChangeListener[] empty = listeners; - //for fun, show that the same empty instance is used + //for fun, show that the same empty instance is used assertSame(empty, listenerSupport.getListeners()); final VetoableChangeListener listener1 = EasyMock.createNiceMock(VetoableChangeListener.class); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java b/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java index 4c8d615..db54742 100644 --- a/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java @@ -41,7 +41,7 @@ import org.junit.Test; /** * @since 3.0 */ -public class EventUtilsTest +public class EventUtilsTest { @Test @@ -53,7 +53,7 @@ public class EventUtilsTest assertTrue(Modifier.isPublic(EventUtils.class.getModifiers())); assertFalse(Modifier.isFinal(EventUtils.class.getModifiers())); } - + @Test public void testAddEventListener() {
