commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevencasw...@apache.org
Subject svn commit: r234403 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IllegalClassExceptionTest.java
Date Mon, 22 Aug 2005 00:51:52 GMT
Author: stevencaswell
Date: Sun Aug 21 17:51:50 2005
New Revision: 234403

URL: http://svn.apache.org/viewcvs?rev=234403&view=rev
Log:
increase IllegalClassException test coverage as reported by clover

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

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IllegalClassExceptionTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IllegalClassExceptionTest.java?rev=234403&r1=234402&r2=234403&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IllegalClassExceptionTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IllegalClassExceptionTest.java
Sun Aug 21 17:51:50 2005
@@ -61,6 +61,20 @@
         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() {
@@ -73,6 +87,19 @@
             new IllegalClassException(String.class, Integer.class);
         assertEquals(
             "Expected: java.lang.String, actual: java.lang.Integer",
+            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());
     }
 



---------------------------------------------------------------------
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