use of org.ff4j.strategy.time.ReleaseDateFlipStrategy in project ff4j by ff4j.
the class ReleaseDateFlipStrategyTest method testInvalidDate.
@Test(expected = IllegalArgumentException.class)
public void testInvalidDate() {
ReleaseDateFlipStrategy rds2 = new ReleaseDateFlipStrategy(new Date());
Map<String, String> params = new HashMap<String, String>();
params.put("releaseDate", "invalid");
rds2.init("f1", params);
}
use of org.ff4j.strategy.time.ReleaseDateFlipStrategy in project ff4j by ff4j.
the class ReleaseDateFlipStrategyTest method testFutureOK.
@Test
public void testFutureOK() throws ParseException {
Feature f = ff4j.getFeature("future1");
ReleaseDateFlipStrategy rds = (ReleaseDateFlipStrategy) f.getFlippingStrategy();
Assert.assertFalse(rds.evaluate("future1", null, null));
}
use of org.ff4j.strategy.time.ReleaseDateFlipStrategy in project ff4j by ff4j.
the class ReleaseDateFlipStrategyTest method testPastDayOK.
@Test
public void testPastDayOK() throws ParseException {
Feature f = ff4j.getFeature("past1");
ReleaseDateFlipStrategy rds = (ReleaseDateFlipStrategy) f.getFlippingStrategy();
Assert.assertTrue(rds.evaluate("past1", null, null));
}
use of org.ff4j.strategy.time.ReleaseDateFlipStrategy in project ff4j by ff4j.
the class ReleaseDateFlipStrategyTest method testInitProgrammatically.
@Test
public void testInitProgrammatically() {
new ReleaseDateFlipStrategy("2016-01-01-12:00");
ReleaseDateFlipStrategy rds2 = new ReleaseDateFlipStrategy(new Date());
rds2.setReleaseDate(new Date());
}
Aggregations