use of org.apache.logging.log4j.core.appender.rolling.action.DeleteAction in project logging-log4j2 by apache.
the class DeleteActionTest method testGetOptionsReturnsEmptySetIfNotFollowingLinks.
@Test
public void testGetOptionsReturnsEmptySetIfNotFollowingLinks() {
final DeleteAction delete = createAnyFilter("any", false, 0, false);
assertEquals(Collections.emptySet(), delete.getOptions());
}
use of org.apache.logging.log4j.core.appender.rolling.action.DeleteAction in project logging-log4j2 by apache.
the class DeleteActionTest method testCreateFileVisitorReturnsDeletingVisitor.
@Test
public void testCreateFileVisitorReturnsDeletingVisitor() {
final DeleteAction delete = createAnyFilter("any", true, 0, false);
final FileVisitor<Path> visitor = delete.createFileVisitor(delete.getBasePath(), delete.getPathConditions());
assertTrue(visitor instanceof DeletingVisitor);
}
use of org.apache.logging.log4j.core.appender.rolling.action.DeleteAction in project logging-log4j2 by apache.
the class DeleteActionTest method create.
private static DeleteAction create(final String path, final boolean followLinks, final int maxDepth, final boolean testMode, final PathCondition[] conditions) {
final Configuration config = new BasicConfigurationFactory().new BasicConfiguration();
final DeleteAction delete = DeleteAction.createDeleteAction(path, followLinks, maxDepth, testMode, null, conditions, null, config);
return delete;
}
use of org.apache.logging.log4j.core.appender.rolling.action.DeleteAction in project logging-log4j2 by apache.
the class DeleteActionTest method testGetOptionsReturnsSetWithFollowLinksIfFollowingLinks.
@Test
public void testGetOptionsReturnsSetWithFollowLinksIfFollowingLinks() {
final DeleteAction delete = createAnyFilter("any", true, 0, false);
assertEquals(EnumSet.of(FileVisitOption.FOLLOW_LINKS), delete.getOptions());
}
Aggregations