@Test(expected = NullPointerException.class) public void testEmptyIsFalse() { assertFalse(IfNot.createNotCondition(null).accept(null, null, null)); }
@Test public void testBeforeTreeWalk() { final CountingCondition counter = new CountingCondition(true); final IfNot not = IfNot.createNotCondition(counter); not.beforeFileTreeWalk(); assertEquals(1, counter.getBeforeFileTreeWalkCount()); }
/** * Create an IfNot PathCondition. * * @param condition The condition to negate. * @return An IfNot PathCondition. */ @PluginFactory public static IfNot createNotCondition( @PluginElement("PathConditions") final PathCondition condition) { return new IfNot(condition); }
@Test public void test() { assertTrue(new FixedCondition(true).accept(null, null, null)); assertFalse(IfNot.createNotCondition(new FixedCondition(true)).accept(null, null, null)); assertFalse(new FixedCondition(false).accept(null, null, null)); assertTrue(IfNot.createNotCondition(new FixedCondition(false)).accept(null, null, null)); }