Remove extra blank lines
This commit is contained in:
@@ -70,7 +70,6 @@ public abstract class LogFactory {
|
||||
// library and JCL have the necessary permissions even when the untrusted
|
||||
// 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
|
||||
* 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;
|
||||
|
||||
|
||||
/**
|
||||
* The previously constructed {@code LogFactory} instances, keyed by
|
||||
* the {@code ClassLoader} with which it was created.
|
||||
*/
|
||||
protected static Hashtable<ClassLoader, LogFactory> factories;
|
||||
|
||||
|
||||
/**
|
||||
* Previously constructed {@code LogFactory} instance as in the
|
||||
* {@code factories} map, but for the case where
|
||||
@@ -531,7 +528,6 @@ public abstract class LogFactory {
|
||||
return classLoader;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check cached factories (keyed by contextClassLoader)
|
||||
*
|
||||
@@ -689,7 +685,6 @@ public abstract class LogFactory {
|
||||
return props;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current context class loader.
|
||||
* <p>
|
||||
@@ -755,7 +750,6 @@ public abstract class LogFactory {
|
||||
// Identify the class loader we will be using
|
||||
final ClassLoader contextClassLoader = getContextClassLoaderInternal();
|
||||
|
||||
|
||||
// This is an odd enough situation to report about. This
|
||||
// output will be a nuisance on JDK1.1, as the system
|
||||
// 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
|
||||
* the property can be read if JCL has been granted the appropriate
|
||||
|
||||
@@ -41,7 +41,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -8649807923527610591L;
|
||||
|
||||
|
||||
/**
|
||||
* This member variable simply ensures that any attempt to initialize
|
||||
* 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. */
|
||||
private boolean classAndMethodFound;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a named instance of this Logger.
|
||||
*
|
||||
@@ -80,7 +78,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
logger = getLogger();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs a message with {@code java.util.logging.Level.FINE}.
|
||||
*
|
||||
|
||||
@@ -41,7 +41,6 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
*/
|
||||
protected static final Level dummyLevel = Level.FINE;
|
||||
|
||||
|
||||
/**
|
||||
* The underlying Logger implementation we are using.
|
||||
*/
|
||||
|
||||
@@ -80,14 +80,12 @@ public class LogFactoryImpl extends LogFactory {
|
||||
*/
|
||||
private static final String[] EMPTY_STRING_ARRAY = {};
|
||||
|
||||
|
||||
/**
|
||||
* The name ({@code org.apache.commons.logging.Log}) of the system
|
||||
* property identifying our {@link Log} implementation class.
|
||||
*/
|
||||
public static final String LOG_PROPERTY = "org.apache.commons.logging.Log";
|
||||
|
||||
|
||||
/**
|
||||
* The deprecated system property used for backwards compatibility with
|
||||
* old versions of JCL.
|
||||
@@ -165,7 +163,6 @@ public class LogFactoryImpl extends LogFactory {
|
||||
return LogFactory.getClassLoader(clazz);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the context ClassLoader.
|
||||
* 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 };
|
||||
|
||||
|
||||
/**
|
||||
* The one-argument {@code setLogFactory} method of the selected
|
||||
* {@link org.apache.commons.logging.Log} method, if it exists.
|
||||
@@ -654,7 +650,6 @@ public class LogFactoryImpl extends LogFactory {
|
||||
return attributes.get(name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an array containing the names of all currently defined
|
||||
* configuration attributes. If there are no such attributes, a zero
|
||||
@@ -753,7 +748,6 @@ public class LogFactoryImpl extends LogFactory {
|
||||
return Boolean.parseBoolean(val);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attempt to find an attribute (see method setAttribute) or a
|
||||
* system property with the provided name and return its value.
|
||||
|
||||
@@ -40,14 +40,12 @@ public class LogKitLogger implements Log, Serializable {
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 3768538055836059519L;
|
||||
|
||||
|
||||
/** Logging goes to this {@code LogKit} logger */
|
||||
protected transient volatile Logger logger;
|
||||
|
||||
/** Name of this logger */
|
||||
protected String name;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs {@code LogKitLogger} which wraps the {@code LogKit}
|
||||
* logger with given name.
|
||||
@@ -59,7 +57,6 @@ public class LogKitLogger implements Log, Serializable {
|
||||
this.logger = getLogger();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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}.
|
||||
*
|
||||
|
||||
@@ -74,7 +74,6 @@ public class SimpleLog implements Log, Serializable {
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 136942970684951178L;
|
||||
|
||||
|
||||
/** All system properties used by {@code SimpleLog} start with this */
|
||||
static protected final String systemPrefix = "org.apache.commons.logging.simplelog.";
|
||||
|
||||
@@ -110,7 +109,6 @@ public class SimpleLog implements Log, Serializable {
|
||||
*/
|
||||
static protected DateFormat dateFormatter;
|
||||
|
||||
|
||||
/** "Trace" level logging. */
|
||||
public static final int LOG_LEVEL_TRACE = 1;
|
||||
/** "Debug" level logging. */
|
||||
@@ -130,7 +128,6 @@ public class SimpleLog implements Log, Serializable {
|
||||
/** Enable no logging levels */
|
||||
public static final int LOG_LEVEL_OFF = LOG_LEVEL_FATAL + 1;
|
||||
|
||||
|
||||
// Initialize class attributes.
|
||||
// Load properties file, if found.
|
||||
// Override with system properties.
|
||||
@@ -242,7 +239,6 @@ public class SimpleLog implements Log, Serializable {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static String getStringProperty(final String name) {
|
||||
String prop = null;
|
||||
try {
|
||||
@@ -259,11 +255,9 @@ public class SimpleLog implements Log, Serializable {
|
||||
/** The name of this simple log instance */
|
||||
protected volatile String logName;
|
||||
|
||||
|
||||
/** The current log level */
|
||||
protected volatile int currentLogLevel;
|
||||
|
||||
|
||||
/** The short name of this simple log instance */
|
||||
private volatile String shortLogName;
|
||||
|
||||
@@ -312,7 +306,6 @@ public class SimpleLog implements Log, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs a message with
|
||||
* {@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}.
|
||||
*
|
||||
|
||||
@@ -92,7 +92,6 @@ public final class Slf4jLogFactory extends LogFactory {
|
||||
log(INFO_INT, message, t);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDebugEnabled() {
|
||||
return logger.isDebugEnabled(MARKER);
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.apache.commons.logging;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Generic tests that can be applied to any log adapter by
|
||||
* subclassing this class and defining method getLogObject
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* limitations under the license.
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.commons.logging;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
@@ -95,7 +95,6 @@ public class LoadTestCase extends TestCase {
|
||||
static private String[] LOG_PCKG = {"org.apache.commons.logging",
|
||||
"org.apache.commons.logging.impl"};
|
||||
|
||||
|
||||
private ClassLoader origContextClassLoader;
|
||||
|
||||
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
|
||||
* (expected to be a UserClass loaded via a custom class loader), passing
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.commons.logging;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.config;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests that verify that the process of configuring logging on startup
|
||||
* works correctly by selecting the file with the highest priority.
|
||||
@@ -41,8 +39,6 @@ import junit.framework.TestCase;
|
||||
*/
|
||||
public class FirstPriorityConfigTestCase extends TestCase {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -99,7 +95,6 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that the config file being used is the one containing
|
||||
* the desired configId value.
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.config;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests that verify that the process of configuring logging on startup
|
||||
* works correctly by selecting the file with the highest priority.
|
||||
@@ -48,8 +46,6 @@ import junit.framework.TestCase;
|
||||
|
||||
public class PriorityConfigTestCase extends TestCase {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -117,7 +113,6 @@ public class PriorityConfigTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that the config file being used is the one containing
|
||||
* the desired configId value.
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.commons.logging.impl;
|
||||
|
||||
import java.lang.ref.ReferenceQueue;
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
|
||||
/**
|
||||
* TestCase for Jdk14 logging when the commons-logging-api jar file is in
|
||||
* the parent classpath and commons-logging.jar is in the child.
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
|
||||
package org.apache.commons.logging.jdk14;
|
||||
|
||||
|
||||
import org.apache.commons.logging.PathableClassLoader;
|
||||
import org.apache.commons.logging.PathableTestSuite;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
|
||||
/**
|
||||
* TestCase for Jdk14 logging when the commons-logging jar file is in
|
||||
* the parent classpath.
|
||||
@@ -31,7 +29,6 @@ import junit.framework.Test;
|
||||
|
||||
public class CustomConfigFullTestCase extends CustomConfigTestCase {
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -56,7 +53,6 @@ public class CustomConfigFullTestCase extends CustomConfigTestCase {
|
||||
return new PathableTestSuite(testClass, child);
|
||||
}
|
||||
|
||||
|
||||
public CustomConfigFullTestCase(final String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.jdk14;
|
||||
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -34,7 +33,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
|
||||
/**
|
||||
* <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
|
||||
@@ -45,8 +43,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
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
|
||||
* 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
|
||||
* class loader, return the contents of the corresponding .class file.
|
||||
@@ -107,7 +100,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -130,33 +122,26 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
return new PathableTestSuite(testClass, cl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>The customized {@code Handler} we will be using.</p>
|
||||
*/
|
||||
protected TestHandler handler;
|
||||
|
||||
|
||||
/**
|
||||
* <p>The underlying {@code Handler}s we will be using.</p>
|
||||
*/
|
||||
protected Handler handlers[];
|
||||
|
||||
|
||||
/**
|
||||
* <p>The underlying {@code Logger} we will be using.</p>
|
||||
*/
|
||||
protected Logger logger;
|
||||
|
||||
|
||||
/**
|
||||
* <p>The underlying {@code LogManager} we will be using.</p>
|
||||
*/
|
||||
protected LogManager manager;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* <p>The message levels that should have been logged.</p>
|
||||
*/
|
||||
@@ -178,7 +163,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
// Check the log instance
|
||||
@Override
|
||||
protected void checkLog() {
|
||||
@@ -233,9 +217,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
handler.flush();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Log the messages with exceptions
|
||||
protected void logExceptionMessages() {
|
||||
final Throwable t = new DummyException();
|
||||
@@ -247,7 +228,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
log.fatal("fatal", t);
|
||||
}
|
||||
|
||||
|
||||
// Log the plain messages
|
||||
protected void logPlainMessages() {
|
||||
log.trace("trace"); // Should not actually get logged
|
||||
@@ -258,7 +238,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
log.fatal("fatal");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets up instance variables required by this test case.
|
||||
*/
|
||||
@@ -272,7 +251,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
setUpLog(this.getClass().getName());
|
||||
}
|
||||
|
||||
|
||||
// Set up handlers instance
|
||||
protected void setUpHandlers() throws Exception {
|
||||
Logger parent = logger;
|
||||
@@ -300,15 +278,11 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
handler = (TestHandler) handlers[0];
|
||||
}
|
||||
|
||||
|
||||
// Set up logger instance
|
||||
protected void setUpLogger(final String name) throws Exception {
|
||||
logger = Logger.getLogger(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Set up LogManager instance
|
||||
protected void setUpManager(final String config) throws Exception {
|
||||
manager = LogManager.getLogManager();
|
||||
@@ -318,7 +292,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
is.close();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@@ -330,7 +303,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
manager = null;
|
||||
}
|
||||
|
||||
|
||||
// Test logging message strings with exceptions
|
||||
public void testExceptionMessages() throws Exception {
|
||||
|
||||
@@ -339,7 +311,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Test logging plain message strings
|
||||
public void testPlainMessages() throws Exception {
|
||||
|
||||
@@ -348,7 +319,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Test pristine Handlers instances
|
||||
public void testPristineHandlers() {
|
||||
|
||||
@@ -359,7 +329,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Test pristine Logger instance
|
||||
public void testPristineLogger() {
|
||||
|
||||
@@ -377,7 +346,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Test Serializability of Log instance
|
||||
@Override
|
||||
public void testSerializable() throws Exception {
|
||||
@@ -387,5 +355,4 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.jdk14;
|
||||
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
@@ -31,7 +30,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* <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
|
||||
@@ -108,7 +106,6 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
log = LogFactory.getLog(name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
|
||||
@@ -16,14 +16,12 @@
|
||||
*/
|
||||
package org.apache.commons.logging.jdk14;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Test implementation of {@code java.util.logging.Handler}.</p>
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.log4j;
|
||||
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
@@ -31,7 +30,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract set of tests that can be executed with various classpaths set.
|
||||
* <p>
|
||||
@@ -169,7 +167,6 @@ public abstract class StandardTests extends TestCase {
|
||||
checkLoggingEvents(logEvents, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that we can log messages without exceptions.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.apache.commons.logging.impl.LogFactoryImpl;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests for Log4J logging that emulate a webapp running within
|
||||
* a container where the commons-logging-api jar file is in
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.apache.commons.logging.impl.LogFactoryImpl;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests for Log4J logging that emulate a webapp running within
|
||||
* a container where all the necessary libs are in the child.
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.log4j.log4j12;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.log4j.StandardTests;
|
||||
@@ -36,8 +35,6 @@ public class TestAppender extends AppenderSkeleton {
|
||||
// The set of logged events for this appender
|
||||
private final List events;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@@ -45,8 +42,6 @@ public class TestAppender extends AppenderSkeleton {
|
||||
events = logEvents;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void append(final LoggingEvent event) {
|
||||
final StandardTests.LogEvent lev = new StandardTests.LogEvent();
|
||||
@@ -68,16 +63,13 @@ public class TestAppender extends AppenderSkeleton {
|
||||
events.add(lev);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean requiresLayout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.logkit;
|
||||
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
@@ -38,9 +37,6 @@ import junit.framework.Test;
|
||||
|
||||
public class StandardTestCase extends AbstractLogTest {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -57,15 +53,11 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
return new PathableTestSuite(testClass, loader);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>The {@link LogFactory} implementation we have selected.</p>
|
||||
*/
|
||||
protected LogFactory factory;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* <p>The {@link Log} implementation we have selected.</p>
|
||||
*/
|
||||
@@ -99,7 +91,6 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
return new LogKitLogger(this.getClass().getName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets up instance variables required by this test case.
|
||||
*/
|
||||
@@ -143,8 +134,6 @@ public class StandardTestCase extends AbstractLogTest {
|
||||
checkStandard();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Test Serializability of standard instance
|
||||
public void testSerializable() throws Exception {
|
||||
checkStandard();
|
||||
|
||||
@@ -81,8 +81,6 @@ public class NoOpLogTestCase extends AbstractLogTest {
|
||||
System.getProperties().remove("org.apache.commons.logging.Log");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Test Serializability of standard instance
|
||||
public void testSerializable() throws Exception {
|
||||
Log log = LogFactory.getLog(this.getClass().getName());
|
||||
|
||||
@@ -43,7 +43,6 @@ import junit.framework.TestCase;
|
||||
|
||||
public class ChildFirstTestCase extends TestCase {
|
||||
|
||||
|
||||
/**
|
||||
* Sets up a custom class loader hierarchy for this test case.
|
||||
* The hierarchy is:
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.io.FilePermission;
|
||||
import java.security.Permission;
|
||||
import java.security.Permissions;
|
||||
|
||||
|
||||
/**
|
||||
* Custom implementation of a security manager, so we can control the
|
||||
* security environment for tests in this package.
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.apache.commons.logging.impl.ServletContextCleaner;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests for ServletContextCleaner utility class.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.simple;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -30,7 +29,6 @@ import org.apache.commons.logging.impl.SimpleLog;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
|
||||
/**
|
||||
* <p>TestCase for simple logging when running with custom configuration
|
||||
* properties.</p>
|
||||
@@ -204,8 +202,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
setUpLog("DecoratedLogger");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tear down instance variables required by this test case.
|
||||
*/
|
||||
@@ -215,7 +211,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
expected = null;
|
||||
}
|
||||
|
||||
|
||||
// Test logging message strings with exceptions
|
||||
public void testExceptionMessages() throws Exception {
|
||||
((DecoratedSimpleLog) log).clearCache();
|
||||
@@ -223,7 +218,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
checkExpected();
|
||||
}
|
||||
|
||||
|
||||
// Test logging plain message strings
|
||||
public void testPlainMessages() throws Exception {
|
||||
((DecoratedSimpleLog) log).clearCache();
|
||||
@@ -231,7 +225,6 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
checkExpected();
|
||||
}
|
||||
|
||||
|
||||
// Test Serializability of standard instance
|
||||
@Override
|
||||
public void testSerializable() throws Exception {
|
||||
|
||||
@@ -26,13 +26,11 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Tests custom date time format configuration
|
||||
*/
|
||||
public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
* <p>
|
||||
@@ -57,7 +55,6 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
return new PathableTestSuite(testClass, loader);
|
||||
}
|
||||
|
||||
|
||||
/** Checks that the date time format has been successfully set */
|
||||
@Override
|
||||
protected void checkDecoratedDateTime() {
|
||||
@@ -77,8 +74,6 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
||||
assertTrue(((DecoratedSimpleLog) log).getShowDateTime());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets up system properties required by this unit test. Here, we
|
||||
* set up the props defined in the parent class setProperties method,
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
|
||||
package org.apache.commons.logging.simple;
|
||||
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.impl.SimpleLog;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Decorated instance of SimpleLog to expose internal state and
|
||||
* support buffered output.</p>
|
||||
@@ -32,9 +30,6 @@ import org.apache.commons.logging.impl.SimpleLog;
|
||||
|
||||
public class DecoratedSimpleLog extends SimpleLog {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generated serial version ID.
|
||||
*/
|
||||
@@ -43,54 +38,40 @@ public class DecoratedSimpleLog extends SimpleLog {
|
||||
// Cache of logged records
|
||||
protected ArrayList cache = new ArrayList();
|
||||
|
||||
|
||||
|
||||
public DecoratedSimpleLog(final String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
// Clear cache
|
||||
public void clearCache() {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
|
||||
// Return cache
|
||||
public List getCache() {
|
||||
return this.cache;
|
||||
}
|
||||
|
||||
|
||||
public String getDateTimeFormat() {
|
||||
return dateTimeFormat;
|
||||
}
|
||||
|
||||
|
||||
public DateFormat getDateTimeFormatter() {
|
||||
return dateFormatter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getLogName() {
|
||||
return logName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean getShowDateTime() {
|
||||
return showDateTime;
|
||||
}
|
||||
|
||||
|
||||
public boolean getShowShortName() {
|
||||
return showShortName;
|
||||
}
|
||||
|
||||
|
||||
// Cache logged messages
|
||||
@Override
|
||||
protected void log(final int type, final Object message, final Throwable t) {
|
||||
@@ -100,5 +81,4 @@ public class DecoratedSimpleLog extends SimpleLog {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.simple;
|
||||
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
@@ -32,7 +31,6 @@ import org.apache.commons.logging.impl.SimpleLog;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* <p>TestCase for simple logging when running with zero configuration
|
||||
* other than selecting the SimpleLog implementation.</p>
|
||||
@@ -167,14 +165,12 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
// Test pristine DecoratedSimpleLog instance
|
||||
public void testPristineDecorated() {
|
||||
setUpDecorated("DecoratedLogger");
|
||||
checkDecorated();
|
||||
}
|
||||
|
||||
|
||||
// Test pristine LogFactory instance
|
||||
public void testPristineFactory() {
|
||||
assertNotNull("LogFactory exists", factory);
|
||||
@@ -187,13 +183,11 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
assertEquals("Names empty", 0, names.length);
|
||||
}
|
||||
|
||||
|
||||
// Test pristine Log instance
|
||||
public void testPristineLog() {
|
||||
checkStandard();
|
||||
}
|
||||
|
||||
|
||||
// Test Serializability of standard instance
|
||||
public void testSerializable() throws Exception {
|
||||
|
||||
|
||||
@@ -15,16 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.commons.logging.simple;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class LogRecord implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Generated serial version ID.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.tccl.log;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -29,7 +28,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* 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 =
|
||||
MY_LOG_PKG + ".MyLog";
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -103,7 +100,6 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that MyLog is only loadable via the tccl.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.tccl.log;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -28,7 +27,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Verify that by default the standard LogFactoryImpl class loads a
|
||||
* custom Log implementation via the TCCL.
|
||||
@@ -42,7 +40,6 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
public static final String MY_LOG_IMPL =
|
||||
MY_LOG_PKG + ".MyLog";
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -103,7 +100,6 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that MyLogFactoryImpl is only loadable via the tccl.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.tccl.logfactory;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Verify that a commons-logging.properties file can prevent a custom
|
||||
* 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 =
|
||||
MY_LOG_FACTORY_PKG + ".MyLogFactoryImpl";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -105,7 +101,6 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that MyLogFactoryImpl is only loadable via the tccl.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.commons.logging.tccl.logfactory;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -27,7 +26,6 @@ import org.apache.commons.logging.PathableTestSuite;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Verify that by default a custom LogFactoryImpl is loaded from the
|
||||
* tccl class loader.
|
||||
@@ -35,8 +33,6 @@ import junit.framework.TestCase;
|
||||
|
||||
public class TcclEnabledTestCase extends TestCase {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the tests included in this test suite.
|
||||
*/
|
||||
@@ -99,7 +95,6 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
LogFactory.releaseAll();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify that MyLogFactoryImpl is only loadable via the tccl.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user