1
0

Update from Logj 1 to the Log4j 2 API compatibility layer (#231)

* Update from Logj1 to the 2 API compatibility layer

* Update from Logj1 to the 2 API compatibility layer
This commit is contained in:
Gary Gregory
2024-03-16 18:30:40 -04:00
committed by GitHub
parent 8b47845c35
commit c1e4fefc56
6 changed files with 72 additions and 18 deletions

View File

@@ -147,9 +147,7 @@ public abstract class StandardTests extends TestCase {
public void testCreateFactory() {
final LogFactory factory = LogFactory.getFactory();
assertNotNull("LogFactory exists", factory);
assertEquals("LogFactory class",
"org.apache.commons.logging.impl.LogFactoryImpl",
factory.getClass().getName());
assertEquals("LogFactory class", "org.apache.commons.logging.impl.LogFactoryImpl", factory.getClass().getName());
final String[] names = factory.getAttributeNames();
assertNotNull("Names exists", names);

View File

@@ -45,6 +45,8 @@ public class ApiClasspathStandardTestCase extends TestCase {
final PathableClassLoader child = new PathableClassLoader(parent);
child.addLogicalLib("log4j12");
child.addLogicalLib("log4j2-api");
child.addLogicalLib("log4j2-core");
child.addLogicalLib("commons-logging");
child.addLogicalLib("testclasses");

View File

@@ -42,6 +42,8 @@ public class AppClasspathStandardTestCase extends TestCase {
loader.useExplicitLoader("junit.", Test.class.getClassLoader());
loader.addLogicalLib("testclasses");
loader.addLogicalLib("log4j12");
loader.addLogicalLib("log4j2-api");
loader.addLogicalLib("log4j2-core");
loader.addLogicalLib("commons-logging");
final Class testClass = loader.loadClass(

View File

@@ -44,6 +44,8 @@ public class ChildClasspathStandardTestCase extends TestCase {
final PathableClassLoader child = new PathableClassLoader(parent);
child.addLogicalLib("testclasses");
child.addLogicalLib("log4j12");
child.addLogicalLib("log4j2-api");
child.addLogicalLib("log4j2-core");
child.addLogicalLib("commons-logging");
final Class testClass = child.loadClass(

View File

@@ -42,6 +42,8 @@ public class ParentClasspathStandardTestCase extends TestCase {
parent.useExplicitLoader("junit.", Test.class.getClassLoader());
parent.addLogicalLib("commons-logging");
parent.addLogicalLib("log4j12");
parent.addLogicalLib("log4j2-api");
parent.addLogicalLib("log4j2-core");
final PathableClassLoader child = new PathableClassLoader(parent);
child.addLogicalLib("testclasses");