use of org.ff4j.strategy.time.OfficeHourStrategy in project ff4j by ff4j.
the class OfficeHourStrategyTest method testOfficeHourEmptyExpression.
@Test
public void testOfficeHourEmptyExpression() {
OfficeHourStrategy ohs = new OfficeHourStrategy();
ohs.parseIntervalsExpression(null);
ohs.parseIntervalsExpression("");
ohs.matches(Calendar.getInstance(), null);
ohs.evaluate("f1", new InMemoryFeatureStore(), null);
ohs.evaluate("f1", new InMemoryFeatureStore(), new FlippingExecutionContext());
}
use of org.ff4j.strategy.time.OfficeHourStrategy in project ff4j by ff4j.
the class OfficeHourStrategyTest method testOfficeHour.
@Test
public void testOfficeHour() {
OfficeHourStrategy ohs = new OfficeHourStrategy();
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("monday", "08:00-12:00,13:30-18:00");
initParams.put("tuesday", "08:00-12:00,13:30-18:00");
initParams.put("wednesday", "08:00-12:00,13:30-18:00");
initParams.put("thursday", "08:00-12:00,13:30-18:00");
initParams.put("friday", "08:00-12:00,13:30-18:00");
initParams.put("saturday", "08:00-12:00,13:30-18:00");
initParams.put("sunday", "08:00-12:00,13:30-18:00");
initParams.put("publicHolidays", "2015-01-01,2015-05-01,2015-12-25");
initParams.put("specialOpenings", "[08:00-12:00]@2015-01-01;[08:00-12:00]@2015-01-02");
ohs.init("f1", initParams);
}
use of org.ff4j.strategy.time.OfficeHourStrategy in project ff4j by ff4j.
the class OfficeHourStrategyTest method testOfficeHour2.
@Test
public void testOfficeHour2() {
OfficeHourStrategy ohs = new OfficeHourStrategy();
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("monday", "08:00-12:00,13:30-18:00");
initParams.put("tuesday", "08:00-12:00,13:30-18:00");
initParams.put("wednesday", "08:00-12:00,13:30-18:00");
initParams.put("thursday", "08:00-12:00,13:30-18:00");
initParams.put("friday", "08:00-12:00,13:30-18:00");
initParams.put("saturday", "08:00-12:00,13:30-18:00");
initParams.put("sunday", "08:00-12:00,13:30-18:00");
ohs.init("f1", initParams);
}
use of org.ff4j.strategy.time.OfficeHourStrategy in project ff4j by ff4j.
the class OfficeHourStrategyTest method testOfficeHour3.
@Test(expected = IllegalArgumentException.class)
public void testOfficeHour3() {
OfficeHourStrategy ohs = new OfficeHourStrategy();
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("publicHolidays", "20152-01-xx01,2015-05-01,2015-12-25");
ohs.init("f1", initParams);
}
use of org.ff4j.strategy.time.OfficeHourStrategy in project ff4j by ff4j.
the class OfficeHourStrategyTest method testOfficeHour5.
@Test(expected = IllegalArgumentException.class)
public void testOfficeHour5() {
OfficeHourStrategy ohs = new OfficeHourStrategy();
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("specialOpenings", "[08:00-12:00]@2ss015-01-01;[08:00-12:00]@2015-01-02");
ohs.init("f1", initParams);
}
Aggregations