Methods Summary |
---|
public void | testDirectoryCreation()Tests that any necessary directories are attempted to
be created if they don't exist. See bug 9150.
//
// known to fail on JDK 1.1
if (!System.getProperty("java.version").startsWith("1.1.")) {
File newFile = new File("output/newdir/temp.log");
newFile.delete();
File newDir = new File("output/newdir");
newDir.delete();
org.apache.log4j.FileAppender wa = new org.apache.log4j.FileAppender();
wa.setFile("output/newdir/temp.log");
wa.setLayout(new PatternLayout("%m%n"));
wa.activateOptions();
assertTrue(new File("output/newdir/temp.log").exists());
}
|
public void | testGetThresholdReturnType()Tests that the return type of getThreshold is Priority.
Method method = FileAppender.class.getMethod("getThreshold", (Class[]) null);
assertTrue(method.getReturnType() == Priority.class);
|
public void | testIsAsSevereAsThreshold()Tests isAsSevereAsThreshold.
FileAppender appender = new FileAppender();
Priority debug = Level.DEBUG;
assertTrue(appender.isAsSevereAsThreshold(debug));
|
public void | testgetSetThreshold()Tests getThreshold and setThreshold.
FileAppender appender = new FileAppender();
Priority debug = Level.DEBUG;
Priority all = Level.ALL;
assertNull(appender.getThreshold());
appender.setThreshold(debug);
assertTrue(appender.getThreshold() == debug);
|