use of org.apache.logging.log4j.core.appender.rolling.action.DeletingVisitor in project logging-log4j2 by apache.
the class DeleteActionTest method testCreateFileVisitorTestModeIsActionTestMode.
@Test
public void testCreateFileVisitorTestModeIsActionTestMode() {
final DeleteAction delete = createAnyFilter("any", true, 0, false);
assertFalse(delete.isTestMode());
final FileVisitor<Path> visitor = delete.createFileVisitor(delete.getBasePath(), delete.getPathConditions());
assertTrue(visitor instanceof DeletingVisitor);
assertFalse(((DeletingVisitor) visitor).isTestMode());
final DeleteAction deleteTestMode = createAnyFilter("any", true, 0, true);
assertTrue(deleteTestMode.isTestMode());
final FileVisitor<Path> testVisitor = deleteTestMode.createFileVisitor(delete.getBasePath(), delete.getPathConditions());
assertTrue(testVisitor instanceof DeletingVisitor);
assertTrue(((DeletingVisitor) testVisitor).isTestMode());
}
use of org.apache.logging.log4j.core.appender.rolling.action.DeletingVisitor 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);
}
Aggregations