/*
 * Copyright 2002-2005 The Apache Software Foundation.
 * 
 * Licensed 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.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.lang;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;

/**
 * JUnit tests.
 * 
 * @author Matthew Hawthorne
 * @version $Id$
 * @see IllegalClassException
 */
public class IllegalClassExceptionTest extends TestCase {

    public static void main(String[] args) {
        TestRunner.run(suite());
    }

    public static Test suite() {
        return new TestSuite(IllegalClassExceptionTest.class);
    }

    public IllegalClassExceptionTest(String testName) {
        super(testName);
    }

    // testConstructor_classArgs

    public void testConstructor_classArgs_allNullInput() {
        new IllegalClassException(null, null);
    }

    public void testConstructor_classArgs_nullExpected() {
        new IllegalClassException(null, String.class);
    }

    public void testConstructor_classArgs_nullActual() {
        new IllegalClassException(String.class, null);
    }

    //  testConstructor_stringArg

    public void testConstructor_stringArg_nullInput() {
        new IllegalClassException(null);
    }

    // testGetMessage

    public void testGetMessage_classArgs_nullInput() {
        final Throwable t = new IllegalClassException(null, null);
        assertEquals("Expected: null, actual: null", t.getMessage());
    }

    public void testGetMessage_classArgs_normalInput() {
        final Throwable t =
            new IllegalClassException(String.class, Integer.class);
        assertEquals(
            "Expected: java.lang.String, actual: java.lang.Integer",
            t.getMessage());
    }

    public void testGetMessage_stringArg_nullInput() {
        final Throwable t = new IllegalClassException(null);
        assertEquals(null, t.getMessage());
    }

    public void testGetMessage_stringArg_validInput() {
        final String message = "message";
        final Throwable t = new IllegalClassException(message);
        assertEquals(message, t.getMessage());
    }

} // IllegalClassExceptionTest

@@ -1737,32 +1737,461 @@
 n(null);%0A    %7D%0A%0A
+    // testConstructor_classObjectArgs%0A%0A    public void testConstructor_classObjectArgs_allNullInput() %7B%0A        new IllegalClassException(null, (Object) null);%0A    %7D%0A%0A    public void testConstructor_classObjectArgs_nullExpected() %7B%0A        new IllegalClassException(null, new Object());%0A    %7D%0A%0A    public void testConstructor_classObjectArgs_nullActual() %7B%0A        new IllegalClassException(String.class, (Object) null);%0A    %7D%0A%0A
     // testGetMe
@@ -2668,32 +2668,530 @@
 sage());%0A    %7D%0A%0A
+    public void testGetMessage_classObjectArgs_nullInput() %7B%0A        final Throwable t = new IllegalClassException(null, (Object) null);%0A        assertEquals(%22Expected: null, actual: null%22, t.getMessage());%0A    %7D%0A%0A    public void testGetMessage_classObjectArgs_normalInput() %7B%0A        final Throwable t =%0A            new IllegalClassException(String.class, new Object());%0A        assertEquals(%0A            %22Expected: java.lang.String, actual: java.lang.Object%22,%0A            t.getMessage());%0A    %7D%0A%0A
     public void 

increase IllegalClassException test coverage as reported by clover