Break up testIdentityToStringStringBuilder into multiple test methods.
This commit is contained in:
parent
22c3047156
commit
10122741ea
|
@ -216,13 +216,21 @@ public class ObjectUtilsTest {
|
||||||
final Integer i = Integer.valueOf(90);
|
final Integer i = Integer.valueOf(90);
|
||||||
final String expected = "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
|
final String expected = "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
|
||||||
|
|
||||||
assertEquals(expected, ObjectUtils.identityToString(i));
|
|
||||||
|
|
||||||
final StringBuilder builder = new StringBuilder();
|
final StringBuilder builder = new StringBuilder();
|
||||||
ObjectUtils.identityToString(builder, i);
|
ObjectUtils.identityToString(builder, i);
|
||||||
assertEquals(expected, builder.toString());
|
assertEquals(expected, builder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIdentityToStringStringBuilderInUse() {
|
||||||
|
final Integer i = Integer.valueOf(90);
|
||||||
|
final String expected = "ABC = java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
|
||||||
|
|
||||||
|
final StringBuilder builder = new StringBuilder("ABC = ");
|
||||||
|
ObjectUtils.identityToString(builder, i);
|
||||||
|
assertEquals(expected, builder.toString());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIdentityToStringStringBuilderNullValue() {
|
public void testIdentityToStringStringBuilderNullValue() {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue