/*
 * Copyright 2001-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.logging.noop;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.NoOpLog;
import org.apache.commons.logging.AbstractLogTest;

/**
 * Tests for NoOpLog logging adapter.
 * <p>
 * This simply applies the tests defined in AbstractLogTest to this class.
 */
public class NoOpLogTestCase extends AbstractLogTest
{

	/**
	 * Override the abstract method from the parent class so that the
     * inherited tests can access the right Log object type. 
	 */
	public Log getLogObject()
	{
		return (Log) new NoOpLog(this.getClass().getName());
	}
}

@@ -21,9 +21,9 @@
 -200
-5
+6
  The
@@ -673,38 +673,229 @@
 ort 
-org.apache.commons.logging.Log
+java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.ObjectInputStream;%0Aimport java.io.ObjectOutputStream;%0A%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory
 ;%0Aim
@@ -1179,234 +1179,2054 @@
 t%0A%7B%0A
-%0A%09/**%0A%09 * Override the abstract method from the parent class so that the%0A     * inherited tests can access the right Log object type. %0A%09 */%0A%09public Log getLogObject()%0A%09%7B%0A%09%09return (Log) new NoOpLog(this.getClass().getName());%0A%09
+    /**%0A     * Set up instance variables required by this test case.%0A     */%0A    public void setUp() throws Exception %7B%0A        LogFactory.releaseAll();%0A%0A        System.setProperty(%0A                %22org.apache.commons.logging.Log%22,%0A                %22org.apache.commons.logging.impl.NoOpLog%22);%0A    %7D%0A%0A    /**%0A     * Tear down instance variables required by this test case.%0A     */%0A    public void tearDown() %7B%0A        LogFactory.releaseAll();%0A    %7D%0A    %0A    /**%0A%09 * Override the abstract method from the parent class so that the%0A     * inherited tests can access the right Log object type. %0A%09 */%0A%09public Log getLogObject()%0A%09%7B%0A%09%09return (Log) new NoOpLog(this.getClass().getName());%0A%09%7D%0A%0A    // Test Serializability of standard instance%0A    public void testSerializable() throws Exception %7B%0A        Log log = LogFactory.getLog(this.getClass().getName());%0A        checkLog(log);%0A%0A        // Serialize and deserialize the instance%0A        ByteArrayOutputStream baos = new ByteArrayOutputStream();%0A        ObjectOutputStream oos = new ObjectOutputStream(baos);%0A        oos.writeObject(log);%0A        oos.close();%0A        ByteArrayInputStream bais =%0A            new ByteArrayInputStream(baos.toByteArray());%0A        ObjectInputStream ois = new ObjectInputStream(bais);%0A        log = (Log) ois.readObject();%0A        ois.close();%0A%0A        checkLog(log);%0A    %7D%0A%0A%0A    // -------------------------------------------------------- Support Methods%0A%0A    private void checkLog(Log log) %7B%0A%0A        assertNotNull(%22Log exists%22, log);%0A        assertEquals(%22Log class%22,%0A                     %22org.apache.commons.logging.impl.NoOpLog%22,%0A                     log.getClass().getName());%0A%0A        // Can we call level checkers with no exceptions?%0A        // Note that *everything* is permanently disabled for NoOpLog%0A        assertFalse(log.isTraceEnabled());%0A        assertFalse(log.isDebugEnabled());%0A        assertFalse(log.isInfoEnabled());%0A        assertFalse(log.isWarnEnabled());%0A        assertFalse(log.isErrorEnabled());%0A        assertFalse(log.isFatalEnabled());%0A    
 %7D%0A%7D%0A

Add Serializable tests for NoOpLog.