Search in sources :

Example 1 with PathCondition

use of org.apache.logging.log4j.core.appender.rolling.action.PathCondition in project logging-log4j2 by apache.

the class DeleteActionTest method testGetFiltersReturnsConstructorValue.

@Test
public void testGetFiltersReturnsConstructorValue() {
    final PathCondition[] filters = { new FixedCondition(true), new FixedCondition(false) };
    final DeleteAction delete = create("any", true, 0, false, filters);
    assertEquals(Arrays.asList(filters), delete.getPathConditions());
}
Also used : PathCondition(org.apache.logging.log4j.core.appender.rolling.action.PathCondition) DeleteAction(org.apache.logging.log4j.core.appender.rolling.action.DeleteAction) Test(org.junit.Test)

Example 2 with PathCondition

use of org.apache.logging.log4j.core.appender.rolling.action.PathCondition in project logging-log4j2 by apache.

the class IfAllTest method testAccept.

@Test
public void testAccept() {
    final PathCondition TRUE = new FixedCondition(true);
    final PathCondition FALSE = new FixedCondition(false);
    assertTrue(IfAll.createAndCondition(TRUE, TRUE).accept(null, null, null));
    assertFalse(IfAll.createAndCondition(FALSE, TRUE).accept(null, null, null));
    assertFalse(IfAll.createAndCondition(TRUE, FALSE).accept(null, null, null));
    assertFalse(IfAll.createAndCondition(FALSE, FALSE).accept(null, null, null));
}
Also used : PathCondition(org.apache.logging.log4j.core.appender.rolling.action.PathCondition) Test(org.junit.Test)

Aggregations

PathCondition (org.apache.logging.log4j.core.appender.rolling.action.PathCondition)2 Test (org.junit.Test)2 DeleteAction (org.apache.logging.log4j.core.appender.rolling.action.DeleteAction)1