* This test shows that performing Log4j to SLF4J conversion has no impact on
* JCL implementation
*/
public void testLog4jOverJclConversion() {
// running log4j to slf4j conversion
LineConverter log4jConverter = new LineConverter(new Log4jRuleSet());
// no changes on LogFactory import
assertEquals("import org.apache.commons.logging.LogFactory;", log4jConverter
.getOneLineReplacement("import org.apache.commons.logging.LogFactory;"));
// no changes on Log import
assertEquals("import org.apache.commons.logging.Log;", log4jConverter
.getOneLineReplacement("import org.apache.commons.logging.Log;"));
// no changes on Log instanciation using Logfactory.getLog
assertEquals(
"public static Log mylog1 = LogFactory.getLog(MyClass.class);",
log4jConverter
.getOneLineReplacement("public static Log mylog1 = LogFactory.getLog(MyClass.class);"));
// no changes on log instanciation using LogFactory.getFactory().getInstance
assertEquals(
"public Log mylog=LogFactory.getFactory().getInstance(MyClass.class);",
log4jConverter
.getOneLineReplacement("public Log mylog=LogFactory.getFactory().getInstance(MyClass.class);"));
}