increase IllegalClassException test coverage as reported by clover

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@234403 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Caswell 2005-08-22 00:51:50 +00:00
parent 98e0d26cc9
commit 795e0d8874
1 changed files with 27 additions and 0 deletions

View File

@ -61,6 +61,20 @@ public class IllegalClassExceptionTest extends TestCase {
new IllegalClassException(null);
}
// testConstructor_classObjectArgs
public void testConstructor_classObjectArgs_allNullInput() {
new IllegalClassException(null, (Object) null);
}
public void testConstructor_classObjectArgs_nullExpected() {
new IllegalClassException(null, new Object());
}
public void testConstructor_classObjectArgs_nullActual() {
new IllegalClassException(String.class, (Object) null);
}
// testGetMessage
public void testGetMessage_classArgs_nullInput() {
@ -76,6 +90,19 @@ public class IllegalClassExceptionTest extends TestCase {
t.getMessage());
}
public void testGetMessage_classObjectArgs_nullInput() {
final Throwable t = new IllegalClassException(null, (Object) null);
assertEquals("Expected: null, actual: null", t.getMessage());
}
public void testGetMessage_classObjectArgs_normalInput() {
final Throwable t =
new IllegalClassException(String.class, new Object());
assertEquals(
"Expected: java.lang.String, actual: java.lang.Object",
t.getMessage());
}
public void testGetMessage_stringArg_nullInput() {
final Throwable t = new IllegalClassException(null);
assertEquals(null, t.getMessage());