1
0

Remove extra blank lines

This commit is contained in:
Gary Gregory
2023-11-26 10:08:31 -05:00
parent b7bca0f8cc
commit f80e102dde
37 changed files with 0 additions and 178 deletions

View File

@@ -70,7 +70,6 @@ public abstract class LogFactory {
// library and JCL have the necessary permissions even when the untrusted // library and JCL have the necessary permissions even when the untrusted
// caller does not. That's a pretty hard route to exploit though. // caller does not. That's a pretty hard route to exploit though.
/** /**
* The name ({@code priority}) of the key in the configuration file used to * The name ({@code priority}) of the key in the configuration file used to
* specify the priority of that particular configuration file. The associated value * specify the priority of that particular configuration file. The associated value
@@ -204,14 +203,12 @@ public abstract class LogFactory {
*/ */
private static final int MAX_BROKEN_SERVICES = 3; private static final int MAX_BROKEN_SERVICES = 3;
/** /**
* The previously constructed {@code LogFactory} instances, keyed by * The previously constructed {@code LogFactory} instances, keyed by
* the {@code ClassLoader} with which it was created. * the {@code ClassLoader} with which it was created.
*/ */
protected static Hashtable<ClassLoader, LogFactory> factories; protected static Hashtable<ClassLoader, LogFactory> factories;
/** /**
* Previously constructed {@code LogFactory} instance as in the * Previously constructed {@code LogFactory} instance as in the
* {@code factories} map, but for the case where * {@code factories} map, but for the case where
@@ -531,7 +528,6 @@ public abstract class LogFactory {
return classLoader; return classLoader;
} }
/** /**
* Check cached factories (keyed by contextClassLoader) * Check cached factories (keyed by contextClassLoader)
* *
@@ -689,7 +685,6 @@ public abstract class LogFactory {
return props; return props;
} }
/** /**
* Returns the current context class loader. * Returns the current context class loader.
* <p> * <p>
@@ -755,7 +750,6 @@ public abstract class LogFactory {
// Identify the class loader we will be using // Identify the class loader we will be using
final ClassLoader contextClassLoader = getContextClassLoaderInternal(); final ClassLoader contextClassLoader = getContextClassLoaderInternal();
// This is an odd enough situation to report about. This // This is an odd enough situation to report about. This
// output will be a nuisance on JDK1.1, as the system // output will be a nuisance on JDK1.1, as the system
// class loader is null in that environment. // class loader is null in that environment.
@@ -1076,7 +1070,6 @@ public abstract class LogFactory {
}); });
} }
/** /**
* Read the specified system property, using an AccessController so that * Read the specified system property, using an AccessController so that
* the property can be read if JCL has been granted the appropriate * the property can be read if JCL has been granted the appropriate

View File

@@ -41,7 +41,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = -8649807923527610591L; private static final long serialVersionUID = -8649807923527610591L;
/** /**
* This member variable simply ensures that any attempt to initialize * This member variable simply ensures that any attempt to initialize
* this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. * this class in a pre-1.4 JVM will result in an ExceptionInInitializerError.
@@ -69,7 +68,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
/** Class and method found flag. */ /** Class and method found flag. */
private boolean classAndMethodFound; private boolean classAndMethodFound;
/** /**
* Constructs a named instance of this Logger. * Constructs a named instance of this Logger.
* *
@@ -80,7 +78,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
logger = getLogger(); logger = getLogger();
} }
/** /**
* Logs a message with {@code java.util.logging.Level.FINE}. * Logs a message with {@code java.util.logging.Level.FINE}.
* *

View File

@@ -41,7 +41,6 @@ public class Jdk14Logger implements Log, Serializable {
*/ */
protected static final Level dummyLevel = Level.FINE; protected static final Level dummyLevel = Level.FINE;
/** /**
* The underlying Logger implementation we are using. * The underlying Logger implementation we are using.
*/ */

View File

@@ -80,14 +80,12 @@ public class LogFactoryImpl extends LogFactory {
*/ */
private static final String[] EMPTY_STRING_ARRAY = {}; private static final String[] EMPTY_STRING_ARRAY = {};
/** /**
* The name ({@code org.apache.commons.logging.Log}) of the system * The name ({@code org.apache.commons.logging.Log}) of the system
* property identifying our {@link Log} implementation class. * property identifying our {@link Log} implementation class.
*/ */
public static final String LOG_PROPERTY = "org.apache.commons.logging.Log"; public static final String LOG_PROPERTY = "org.apache.commons.logging.Log";
/** /**
* The deprecated system property used for backwards compatibility with * The deprecated system property used for backwards compatibility with
* old versions of JCL. * old versions of JCL.
@@ -165,7 +163,6 @@ public class LogFactoryImpl extends LogFactory {
return LogFactory.getClassLoader(clazz); return LogFactory.getClassLoader(clazz);
} }
/** /**
* Gets the context ClassLoader. * Gets the context ClassLoader.
* This method is a workaround for a java 1.2 compiler bug. * This method is a workaround for a java 1.2 compiler bug.
@@ -273,7 +270,6 @@ public class LogFactoryImpl extends LogFactory {
*/ */
protected Class[] logConstructorSignature = { String.class }; protected Class[] logConstructorSignature = { String.class };
/** /**
* The one-argument {@code setLogFactory} method of the selected * The one-argument {@code setLogFactory} method of the selected
* {@link org.apache.commons.logging.Log} method, if it exists. * {@link org.apache.commons.logging.Log} method, if it exists.
@@ -654,7 +650,6 @@ public class LogFactoryImpl extends LogFactory {
return attributes.get(name); return attributes.get(name);
} }
/** /**
* Return an array containing the names of all currently defined * Return an array containing the names of all currently defined
* configuration attributes. If there are no such attributes, a zero * configuration attributes. If there are no such attributes, a zero
@@ -753,7 +748,6 @@ public class LogFactoryImpl extends LogFactory {
return Boolean.parseBoolean(val); return Boolean.parseBoolean(val);
} }
/** /**
* Attempt to find an attribute (see method setAttribute) or a * Attempt to find an attribute (see method setAttribute) or a
* system property with the provided name and return its value. * system property with the provided name and return its value.

View File

@@ -40,14 +40,12 @@ public class LogKitLogger implements Log, Serializable {
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = 3768538055836059519L; private static final long serialVersionUID = 3768538055836059519L;
/** Logging goes to this {@code LogKit} logger */ /** Logging goes to this {@code LogKit} logger */
protected transient volatile Logger logger; protected transient volatile Logger logger;
/** Name of this logger */ /** Name of this logger */
protected String name; protected String name;
/** /**
* Constructs {@code LogKitLogger} which wraps the {@code LogKit} * Constructs {@code LogKitLogger} which wraps the {@code LogKit}
* logger with given name. * logger with given name.
@@ -59,7 +57,6 @@ public class LogKitLogger implements Log, Serializable {
this.logger = getLogger(); this.logger = getLogger();
} }
/** /**
* Logs a message with {@code org.apache.log.Priority.DEBUG}. * Logs a message with {@code org.apache.log.Priority.DEBUG}.
* *
@@ -73,7 +70,6 @@ public class LogKitLogger implements Log, Serializable {
} }
} }
/** /**
* Logs a message with {@code org.apache.log.Priority.DEBUG}. * Logs a message with {@code org.apache.log.Priority.DEBUG}.
* *

View File

@@ -74,7 +74,6 @@ public class SimpleLog implements Log, Serializable {
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = 136942970684951178L; private static final long serialVersionUID = 136942970684951178L;
/** All system properties used by {@code SimpleLog} start with this */ /** All system properties used by {@code SimpleLog} start with this */
static protected final String systemPrefix = "org.apache.commons.logging.simplelog."; static protected final String systemPrefix = "org.apache.commons.logging.simplelog.";
@@ -110,7 +109,6 @@ public class SimpleLog implements Log, Serializable {
*/ */
static protected DateFormat dateFormatter; static protected DateFormat dateFormatter;
/** "Trace" level logging. */ /** "Trace" level logging. */
public static final int LOG_LEVEL_TRACE = 1; public static final int LOG_LEVEL_TRACE = 1;
/** "Debug" level logging. */ /** "Debug" level logging. */
@@ -130,7 +128,6 @@ public class SimpleLog implements Log, Serializable {
/** Enable no logging levels */ /** Enable no logging levels */
public static final int LOG_LEVEL_OFF = LOG_LEVEL_FATAL + 1; public static final int LOG_LEVEL_OFF = LOG_LEVEL_FATAL + 1;
// Initialize class attributes. // Initialize class attributes.
// Load properties file, if found. // Load properties file, if found.
// Override with system properties. // Override with system properties.
@@ -242,7 +239,6 @@ public class SimpleLog implements Log, Serializable {
}); });
} }
private static String getStringProperty(final String name) { private static String getStringProperty(final String name) {
String prop = null; String prop = null;
try { try {
@@ -259,11 +255,9 @@ public class SimpleLog implements Log, Serializable {
/** The name of this simple log instance */ /** The name of this simple log instance */
protected volatile String logName; protected volatile String logName;
/** The current log level */ /** The current log level */
protected volatile int currentLogLevel; protected volatile int currentLogLevel;
/** The short name of this simple log instance */ /** The short name of this simple log instance */
private volatile String shortLogName; private volatile String shortLogName;
@@ -312,7 +306,6 @@ public class SimpleLog implements Log, Serializable {
} }
} }
/** /**
* Logs a message with * Logs a message with
* {@code org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG}. * {@code org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG}.
@@ -369,7 +362,6 @@ public class SimpleLog implements Log, Serializable {
} }
} }
/** /**
* Log a message with {@code org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL}. * Log a message with {@code org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL}.
* *

View File

@@ -92,7 +92,6 @@ public final class Slf4jLogFactory extends LogFactory {
log(INFO_INT, message, t); log(INFO_INT, message, t);
} }
@Override @Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isDebugEnabled(MARKER); return logger.isDebugEnabled(MARKER);

View File

@@ -18,7 +18,6 @@ package org.apache.commons.logging;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Generic tests that can be applied to any log adapter by * Generic tests that can be applied to any log adapter by
* subclassing this class and defining method getLogObject * subclassing this class and defining method getLogObject

View File

@@ -15,7 +15,6 @@
* limitations under the license. * limitations under the license.
*/ */
package org.apache.commons.logging; package org.apache.commons.logging;
import java.io.Closeable; import java.io.Closeable;

View File

@@ -95,7 +95,6 @@ public class LoadTestCase extends TestCase {
static private String[] LOG_PCKG = {"org.apache.commons.logging", static private String[] LOG_PCKG = {"org.apache.commons.logging",
"org.apache.commons.logging.impl"}; "org.apache.commons.logging.impl"};
private ClassLoader origContextClassLoader; private ClassLoader origContextClassLoader;
private void execute(final Class cls) throws Exception { private void execute(final Class cls) throws Exception {
@@ -126,7 +125,6 @@ public class LoadTestCase extends TestCase {
} }
/** /**
* Call the static setAllowFlawedContext method on the specified class * Call the static setAllowFlawedContext method on the specified class
* (expected to be a UserClass loaded via a custom class loader), passing * (expected to be a UserClass loaded via a custom class loader), passing

View File

@@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
package org.apache.commons.logging; package org.apache.commons.logging;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.config; package org.apache.commons.logging.config;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Tests that verify that the process of configuring logging on startup * Tests that verify that the process of configuring logging on startup
* works correctly by selecting the file with the highest priority. * works correctly by selecting the file with the highest priority.
@@ -41,8 +39,6 @@ import junit.framework.TestCase;
*/ */
public class FirstPriorityConfigTestCase extends TestCase { public class FirstPriorityConfigTestCase extends TestCase {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -99,7 +95,6 @@ public class FirstPriorityConfigTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that the config file being used is the one containing * Verify that the config file being used is the one containing
* the desired configId value. * the desired configId value.

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.config; package org.apache.commons.logging.config;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Tests that verify that the process of configuring logging on startup * Tests that verify that the process of configuring logging on startup
* works correctly by selecting the file with the highest priority. * works correctly by selecting the file with the highest priority.
@@ -48,8 +46,6 @@ import junit.framework.TestCase;
public class PriorityConfigTestCase extends TestCase { public class PriorityConfigTestCase extends TestCase {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -117,7 +113,6 @@ public class PriorityConfigTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that the config file being used is the one containing * Verify that the config file being used is the one containing
* the desired configId value. * the desired configId value.

View File

@@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
package org.apache.commons.logging.impl; package org.apache.commons.logging.impl;
import java.lang.ref.ReferenceQueue; import java.lang.ref.ReferenceQueue;

View File

@@ -22,7 +22,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
/** /**
* TestCase for Jdk14 logging when the commons-logging-api jar file is in * TestCase for Jdk14 logging when the commons-logging-api jar file is in
* the parent classpath and commons-logging.jar is in the child. * the parent classpath and commons-logging.jar is in the child.

View File

@@ -17,13 +17,11 @@
package org.apache.commons.logging.jdk14; package org.apache.commons.logging.jdk14;
import org.apache.commons.logging.PathableClassLoader; import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite; import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
/** /**
* TestCase for Jdk14 logging when the commons-logging jar file is in * TestCase for Jdk14 logging when the commons-logging jar file is in
* the parent classpath. * the parent classpath.
@@ -31,7 +29,6 @@ import junit.framework.Test;
public class CustomConfigFullTestCase extends CustomConfigTestCase { public class CustomConfigFullTestCase extends CustomConfigTestCase {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -56,7 +53,6 @@ public class CustomConfigFullTestCase extends CustomConfigTestCase {
return new PathableTestSuite(testClass, child); return new PathableTestSuite(testClass, child);
} }
public CustomConfigFullTestCase(final String name) { public CustomConfigFullTestCase(final String name) {
super(name); super(name);
} }

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.jdk14; package org.apache.commons.logging.jdk14;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@@ -34,7 +33,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
/** /**
* <p>TestCase for JDK 1.4 logging when running on a JDK 1.4 system with * <p>TestCase for JDK 1.4 logging when running on a JDK 1.4 system with
* custom configuration, so that JDK 1.4 should be selected and an appropriate * custom configuration, so that JDK 1.4 should be selected and an appropriate
@@ -45,8 +43,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
protected static final String HANDLER_NAME = "org.apache.commons.logging.jdk14.TestHandler"; protected static final String HANDLER_NAME = "org.apache.commons.logging.jdk14.TestHandler";
/** /**
* Make a class available in the system class loader even when its classfile is * Make a class available in the system class loader even when its classfile is
* not present in the classpath configured for that class loader. This only * not present in the classpath configured for that class loader. This only
@@ -82,9 +78,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
} }
/** /**
* Given the name of a class that is somewhere in the classpath of the provided * Given the name of a class that is somewhere in the classpath of the provided
* class loader, return the contents of the corresponding .class file. * class loader, return the contents of the corresponding .class file.
@@ -107,7 +100,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
return baos.toByteArray(); return baos.toByteArray();
} }
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -130,33 +122,26 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
return new PathableTestSuite(testClass, cl); return new PathableTestSuite(testClass, cl);
} }
/** /**
* <p>The customized {@code Handler} we will be using.</p> * <p>The customized {@code Handler} we will be using.</p>
*/ */
protected TestHandler handler; protected TestHandler handler;
/** /**
* <p>The underlying {@code Handler}s we will be using.</p> * <p>The underlying {@code Handler}s we will be using.</p>
*/ */
protected Handler handlers[]; protected Handler handlers[];
/** /**
* <p>The underlying {@code Logger} we will be using.</p> * <p>The underlying {@code Logger} we will be using.</p>
*/ */
protected Logger logger; protected Logger logger;
/** /**
* <p>The underlying {@code LogManager} we will be using.</p> * <p>The underlying {@code LogManager} we will be using.</p>
*/ */
protected LogManager manager; protected LogManager manager;
/** /**
* <p>The message levels that should have been logged.</p> * <p>The message levels that should have been logged.</p>
*/ */
@@ -178,7 +163,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
super(name); super(name);
} }
// Check the log instance // Check the log instance
@Override @Override
protected void checkLog() { protected void checkLog() {
@@ -233,9 +217,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
handler.flush(); handler.flush();
} }
// Log the messages with exceptions // Log the messages with exceptions
protected void logExceptionMessages() { protected void logExceptionMessages() {
final Throwable t = new DummyException(); final Throwable t = new DummyException();
@@ -247,7 +228,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
log.fatal("fatal", t); log.fatal("fatal", t);
} }
// Log the plain messages // Log the plain messages
protected void logPlainMessages() { protected void logPlainMessages() {
log.trace("trace"); // Should not actually get logged log.trace("trace"); // Should not actually get logged
@@ -258,7 +238,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
log.fatal("fatal"); log.fatal("fatal");
} }
/** /**
* Sets up instance variables required by this test case. * Sets up instance variables required by this test case.
*/ */
@@ -272,7 +251,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
setUpLog(this.getClass().getName()); setUpLog(this.getClass().getName());
} }
// Set up handlers instance // Set up handlers instance
protected void setUpHandlers() throws Exception { protected void setUpHandlers() throws Exception {
Logger parent = logger; Logger parent = logger;
@@ -300,15 +278,11 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
handler = (TestHandler) handlers[0]; handler = (TestHandler) handlers[0];
} }
// Set up logger instance // Set up logger instance
protected void setUpLogger(final String name) throws Exception { protected void setUpLogger(final String name) throws Exception {
logger = Logger.getLogger(name); logger = Logger.getLogger(name);
} }
// Set up LogManager instance // Set up LogManager instance
protected void setUpManager(final String config) throws Exception { protected void setUpManager(final String config) throws Exception {
manager = LogManager.getLogManager(); manager = LogManager.getLogManager();
@@ -318,7 +292,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
is.close(); is.close();
} }
/** /**
* Tear down instance variables required by this test case. * Tear down instance variables required by this test case.
*/ */
@@ -330,7 +303,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
manager = null; manager = null;
} }
// Test logging message strings with exceptions // Test logging message strings with exceptions
public void testExceptionMessages() throws Exception { public void testExceptionMessages() throws Exception {
@@ -339,7 +311,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
// Test logging plain message strings // Test logging plain message strings
public void testPlainMessages() throws Exception { public void testPlainMessages() throws Exception {
@@ -348,7 +319,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
// Test pristine Handlers instances // Test pristine Handlers instances
public void testPristineHandlers() { public void testPristineHandlers() {
@@ -359,7 +329,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
// Test pristine Logger instance // Test pristine Logger instance
public void testPristineLogger() { public void testPristineLogger() {
@@ -377,7 +346,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
// Test Serializability of Log instance // Test Serializability of Log instance
@Override @Override
public void testSerializable() throws Exception { public void testSerializable() throws Exception {
@@ -387,5 +355,4 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
} }
} }

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.jdk14; package org.apache.commons.logging.jdk14;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
@@ -31,7 +30,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* <p>TestCase for JDK 1.4 logging when running on a JDK 1.4 system with * <p>TestCase for JDK 1.4 logging when running on a JDK 1.4 system with
* zero configuration, and with Log4J not present (so JDK 1.4 logging * zero configuration, and with Log4J not present (so JDK 1.4 logging
@@ -108,7 +106,6 @@ public class DefaultConfigTestCase extends TestCase {
log = LogFactory.getLog(name); log = LogFactory.getLog(name);
} }
/** /**
* Tear down instance variables required by this test case. * Tear down instance variables required by this test case.
*/ */

View File

@@ -16,14 +16,12 @@
*/ */
package org.apache.commons.logging.jdk14; package org.apache.commons.logging.jdk14;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.logging.Handler; import java.util.logging.Handler;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
/** /**
* <p>Test implementation of {@code java.util.logging.Handler}.</p> * <p>Test implementation of {@code java.util.logging.Handler}.</p>
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.log4j; package org.apache.commons.logging.log4j;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
@@ -31,7 +30,6 @@ import org.apache.commons.logging.LogFactory;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Abstract set of tests that can be executed with various classpaths set. * Abstract set of tests that can be executed with various classpaths set.
* <p> * <p>
@@ -169,7 +167,6 @@ public abstract class StandardTests extends TestCase {
checkLoggingEvents(logEvents, true); checkLoggingEvents(logEvents, true);
} }
/** /**
* Verify that we can log messages without exceptions. * Verify that we can log messages without exceptions.
*/ */

View File

@@ -25,7 +25,6 @@ import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Tests for Log4J logging that emulate a webapp running within * Tests for Log4J logging that emulate a webapp running within
* a container where the commons-logging-api jar file is in * a container where the commons-logging-api jar file is in

View File

@@ -25,7 +25,6 @@ import org.apache.commons.logging.impl.LogFactoryImpl;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Tests for Log4J logging that emulate a webapp running within * Tests for Log4J logging that emulate a webapp running within
* a container where all the necessary libs are in the child. * a container where all the necessary libs are in the child.

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.log4j.log4j12; package org.apache.commons.logging.log4j.log4j12;
import java.util.List; import java.util.List;
import org.apache.commons.logging.log4j.StandardTests; import org.apache.commons.logging.log4j.StandardTests;
@@ -36,8 +35,6 @@ public class TestAppender extends AppenderSkeleton {
// The set of logged events for this appender // The set of logged events for this appender
private final List events; private final List events;
/** /**
* Constructor. * Constructor.
*/ */
@@ -45,8 +42,6 @@ public class TestAppender extends AppenderSkeleton {
events = logEvents; events = logEvents;
} }
@Override @Override
protected void append(final LoggingEvent event) { protected void append(final LoggingEvent event) {
final StandardTests.LogEvent lev = new StandardTests.LogEvent(); final StandardTests.LogEvent lev = new StandardTests.LogEvent();
@@ -68,16 +63,13 @@ public class TestAppender extends AppenderSkeleton {
events.add(lev); events.add(lev);
} }
@Override @Override
public void close() { public void close() {
} }
@Override @Override
public boolean requiresLayout() { public boolean requiresLayout() {
return false; return false;
} }
} }

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.logkit; package org.apache.commons.logging.logkit;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
@@ -38,9 +37,6 @@ import junit.framework.Test;
public class StandardTestCase extends AbstractLogTest { public class StandardTestCase extends AbstractLogTest {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -57,15 +53,11 @@ public class StandardTestCase extends AbstractLogTest {
return new PathableTestSuite(testClass, loader); return new PathableTestSuite(testClass, loader);
} }
/** /**
* <p>The {@link LogFactory} implementation we have selected.</p> * <p>The {@link LogFactory} implementation we have selected.</p>
*/ */
protected LogFactory factory; protected LogFactory factory;
/** /**
* <p>The {@link Log} implementation we have selected.</p> * <p>The {@link Log} implementation we have selected.</p>
*/ */
@@ -99,7 +91,6 @@ public class StandardTestCase extends AbstractLogTest {
return new LogKitLogger(this.getClass().getName()); return new LogKitLogger(this.getClass().getName());
} }
/** /**
* Sets up instance variables required by this test case. * Sets up instance variables required by this test case.
*/ */
@@ -143,8 +134,6 @@ public class StandardTestCase extends AbstractLogTest {
checkStandard(); checkStandard();
} }
// Test Serializability of standard instance // Test Serializability of standard instance
public void testSerializable() throws Exception { public void testSerializable() throws Exception {
checkStandard(); checkStandard();

View File

@@ -81,8 +81,6 @@ public class NoOpLogTestCase extends AbstractLogTest {
System.getProperties().remove("org.apache.commons.logging.Log"); System.getProperties().remove("org.apache.commons.logging.Log");
} }
// Test Serializability of standard instance // Test Serializability of standard instance
public void testSerializable() throws Exception { public void testSerializable() throws Exception {
Log log = LogFactory.getLog(this.getClass().getName()); Log log = LogFactory.getLog(this.getClass().getName());

View File

@@ -43,7 +43,6 @@ import junit.framework.TestCase;
public class ChildFirstTestCase extends TestCase { public class ChildFirstTestCase extends TestCase {
/** /**
* Sets up a custom class loader hierarchy for this test case. * Sets up a custom class loader hierarchy for this test case.
* The hierarchy is: * The hierarchy is:

View File

@@ -21,7 +21,6 @@ import java.io.FilePermission;
import java.security.Permission; import java.security.Permission;
import java.security.Permissions; import java.security.Permissions;
/** /**
* Custom implementation of a security manager, so we can control the * Custom implementation of a security manager, so we can control the
* security environment for tests in this package. * security environment for tests in this package.

View File

@@ -24,7 +24,6 @@ import org.apache.commons.logging.impl.ServletContextCleaner;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Tests for ServletContextCleaner utility class. * Tests for ServletContextCleaner utility class.
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.simple; package org.apache.commons.logging.simple;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@@ -30,7 +29,6 @@ import org.apache.commons.logging.impl.SimpleLog;
import junit.framework.Test; import junit.framework.Test;
/** /**
* <p>TestCase for simple logging when running with custom configuration * <p>TestCase for simple logging when running with custom configuration
* properties.</p> * properties.</p>
@@ -204,8 +202,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
setUpLog("DecoratedLogger"); setUpLog("DecoratedLogger");
} }
/** /**
* Tear down instance variables required by this test case. * Tear down instance variables required by this test case.
*/ */
@@ -215,7 +211,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
expected = null; expected = null;
} }
// Test logging message strings with exceptions // Test logging message strings with exceptions
public void testExceptionMessages() throws Exception { public void testExceptionMessages() throws Exception {
((DecoratedSimpleLog) log).clearCache(); ((DecoratedSimpleLog) log).clearCache();
@@ -223,7 +218,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
checkExpected(); checkExpected();
} }
// Test logging plain message strings // Test logging plain message strings
public void testPlainMessages() throws Exception { public void testPlainMessages() throws Exception {
((DecoratedSimpleLog) log).clearCache(); ((DecoratedSimpleLog) log).clearCache();
@@ -231,7 +225,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
checkExpected(); checkExpected();
} }
// Test Serializability of standard instance // Test Serializability of standard instance
@Override @Override
public void testSerializable() throws Exception { public void testSerializable() throws Exception {

View File

@@ -26,13 +26,11 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
/** /**
* Tests custom date time format configuration * Tests custom date time format configuration
*/ */
public class DateTimeCustomConfigTestCase extends CustomConfigTestCase { public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
* <p> * <p>
@@ -57,7 +55,6 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
return new PathableTestSuite(testClass, loader); return new PathableTestSuite(testClass, loader);
} }
/** Checks that the date time format has been successfully set */ /** Checks that the date time format has been successfully set */
@Override @Override
protected void checkDecoratedDateTime() { protected void checkDecoratedDateTime() {
@@ -77,8 +74,6 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
assertTrue(((DecoratedSimpleLog) log).getShowDateTime()); assertTrue(((DecoratedSimpleLog) log).getShowDateTime());
} }
/** /**
* Sets up system properties required by this unit test. Here, we * Sets up system properties required by this unit test. Here, we
* set up the props defined in the parent class setProperties method, * set up the props defined in the parent class setProperties method,

View File

@@ -17,14 +17,12 @@
package org.apache.commons.logging.simple; package org.apache.commons.logging.simple;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.commons.logging.impl.SimpleLog; import org.apache.commons.logging.impl.SimpleLog;
/** /**
* <p>Decorated instance of SimpleLog to expose internal state and * <p>Decorated instance of SimpleLog to expose internal state and
* support buffered output.</p> * support buffered output.</p>
@@ -32,9 +30,6 @@ import org.apache.commons.logging.impl.SimpleLog;
public class DecoratedSimpleLog extends SimpleLog { public class DecoratedSimpleLog extends SimpleLog {
/** /**
* Generated serial version ID. * Generated serial version ID.
*/ */
@@ -43,54 +38,40 @@ public class DecoratedSimpleLog extends SimpleLog {
// Cache of logged records // Cache of logged records
protected ArrayList cache = new ArrayList(); protected ArrayList cache = new ArrayList();
public DecoratedSimpleLog(final String name) { public DecoratedSimpleLog(final String name) {
super(name); super(name);
} }
// Clear cache // Clear cache
public void clearCache() { public void clearCache() {
cache.clear(); cache.clear();
} }
// Return cache // Return cache
public List getCache() { public List getCache() {
return this.cache; return this.cache;
} }
public String getDateTimeFormat() { public String getDateTimeFormat() {
return dateTimeFormat; return dateTimeFormat;
} }
public DateFormat getDateTimeFormatter() { public DateFormat getDateTimeFormatter() {
return dateFormatter; return dateFormatter;
} }
public String getLogName() { public String getLogName() {
return logName; return logName;
} }
public boolean getShowDateTime() { public boolean getShowDateTime() {
return showDateTime; return showDateTime;
} }
public boolean getShowShortName() { public boolean getShowShortName() {
return showShortName; return showShortName;
} }
// Cache logged messages // Cache logged messages
@Override @Override
protected void log(final int type, final Object message, final Throwable t) { protected void log(final int type, final Object message, final Throwable t) {
@@ -100,5 +81,4 @@ public class DecoratedSimpleLog extends SimpleLog {
} }
} }

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.simple; package org.apache.commons.logging.simple;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
@@ -32,7 +31,6 @@ import org.apache.commons.logging.impl.SimpleLog;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* <p>TestCase for simple logging when running with zero configuration * <p>TestCase for simple logging when running with zero configuration
* other than selecting the SimpleLog implementation.</p> * other than selecting the SimpleLog implementation.</p>
@@ -167,14 +165,12 @@ public class DefaultConfigTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
// Test pristine DecoratedSimpleLog instance // Test pristine DecoratedSimpleLog instance
public void testPristineDecorated() { public void testPristineDecorated() {
setUpDecorated("DecoratedLogger"); setUpDecorated("DecoratedLogger");
checkDecorated(); checkDecorated();
} }
// Test pristine LogFactory instance // Test pristine LogFactory instance
public void testPristineFactory() { public void testPristineFactory() {
assertNotNull("LogFactory exists", factory); assertNotNull("LogFactory exists", factory);
@@ -187,13 +183,11 @@ public class DefaultConfigTestCase extends TestCase {
assertEquals("Names empty", 0, names.length); assertEquals("Names empty", 0, names.length);
} }
// Test pristine Log instance // Test pristine Log instance
public void testPristineLog() { public void testPristineLog() {
checkStandard(); checkStandard();
} }
// Test Serializability of standard instance // Test Serializability of standard instance
public void testSerializable() throws Exception { public void testSerializable() throws Exception {

View File

@@ -15,16 +15,12 @@
* limitations under the License. * limitations under the License.
*/ */
package org.apache.commons.logging.simple; package org.apache.commons.logging.simple;
import java.io.Serializable; import java.io.Serializable;
public class LogRecord implements Serializable { public class LogRecord implements Serializable {
/** /**
* Generated serial version ID. * Generated serial version ID.
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.tccl.log; package org.apache.commons.logging.tccl.log;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@@ -29,7 +28,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Verify that by default LogFactoryImpl is loaded from the tccl class loader. * Verify that by default LogFactoryImpl is loaded from the tccl class loader.
*/ */
@@ -42,7 +40,6 @@ public class TcclDisabledTestCase extends TestCase {
public static final String MY_LOG_IMPL = public static final String MY_LOG_IMPL =
MY_LOG_PKG + ".MyLog"; MY_LOG_PKG + ".MyLog";
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -103,7 +100,6 @@ public class TcclDisabledTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that MyLog is only loadable via the tccl. * Verify that MyLog is only loadable via the tccl.
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.tccl.log; package org.apache.commons.logging.tccl.log;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@@ -28,7 +27,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Verify that by default the standard LogFactoryImpl class loads a * Verify that by default the standard LogFactoryImpl class loads a
* custom Log implementation via the TCCL. * custom Log implementation via the TCCL.
@@ -42,7 +40,6 @@ public class TcclEnabledTestCase extends TestCase {
public static final String MY_LOG_IMPL = public static final String MY_LOG_IMPL =
MY_LOG_PKG + ".MyLog"; MY_LOG_PKG + ".MyLog";
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -103,7 +100,6 @@ public class TcclEnabledTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that MyLogFactoryImpl is only loadable via the tccl. * Verify that MyLogFactoryImpl is only loadable via the tccl.
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.tccl.logfactory; package org.apache.commons.logging.tccl.logfactory;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Verify that a commons-logging.properties file can prevent a custom * Verify that a commons-logging.properties file can prevent a custom
* LogFactoryImpl being loaded from the tccl class loader. * LogFactoryImpl being loaded from the tccl class loader.
@@ -41,8 +39,6 @@ public class TcclDisabledTestCase extends TestCase {
public static final String MY_LOG_FACTORY_IMPL = public static final String MY_LOG_FACTORY_IMPL =
MY_LOG_FACTORY_PKG + ".MyLogFactoryImpl"; MY_LOG_FACTORY_PKG + ".MyLogFactoryImpl";
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -105,7 +101,6 @@ public class TcclDisabledTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that MyLogFactoryImpl is only loadable via the tccl. * Verify that MyLogFactoryImpl is only loadable via the tccl.
*/ */

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.tccl.logfactory; package org.apache.commons.logging.tccl.logfactory;
import java.net.URL; import java.net.URL;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
/** /**
* Verify that by default a custom LogFactoryImpl is loaded from the * Verify that by default a custom LogFactoryImpl is loaded from the
* tccl class loader. * tccl class loader.
@@ -35,8 +33,6 @@ import junit.framework.TestCase;
public class TcclEnabledTestCase extends TestCase { public class TcclEnabledTestCase extends TestCase {
/** /**
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
@@ -99,7 +95,6 @@ public class TcclEnabledTestCase extends TestCase {
LogFactory.releaseAll(); LogFactory.releaseAll();
} }
/** /**
* Verify that MyLogFactoryImpl is only loadable via the tccl. * Verify that MyLogFactoryImpl is only loadable via the tccl.
*/ */