Methods Summary |
---|
public void | testBadUnicodeEscape()Test for bug 40944.
Did not catch IllegalArgumentException on Properties.load
and close input stream.
String fileName = "output/badescape.properties";
FileWriter writer = new FileWriter(fileName);
writer.write("log4j.rootLogger=\\uXX41");
writer.close();
PropertyConfigurator.configure(fileName);
File file = new File(fileName);
assertTrue(file.delete()) ;
assertFalse(file.exists());
|
public void | testReset()Test processing of log4j.reset property, see bug 17531.
VectorAppender appender = new VectorAppender();
appender.setName("A1");
Logger.getRootLogger().addAppender(appender);
Properties props = new Properties();
props.put("log4j.reset", "true");
PropertyConfigurator.configure(props);
assertNull(Logger.getRootLogger().getAppender("A1"));
LogManager.resetConfiguration();
|
public void | testURL()Test for bug 40944.
configure(URL) never closed opened stream.
File file = new File("output/unclosed.properties");
FileWriter writer = new FileWriter(file);
writer.write("log4j.rootLogger=debug");
writer.close();
URL url = file.toURL();
PropertyConfigurator.configure(url);
assertTrue(file.delete());
assertFalse(file.exists());
|
public void | testURLBadEscape()Test for bug 40944.
configure(URL) did not catch IllegalArgumentException and
did not close stream.
File file = new File("output/urlbadescape.properties");
FileWriter writer = new FileWriter(file);
writer.write("log4j.rootLogger=\\uXX41");
writer.close();
URL url = file.toURL();
PropertyConfigurator.configure(url);
assertTrue(file.delete());
assertFalse(file.exists());
|