use of com.artezio.arttime.web.criteria.RangePeriodSelector.Range in project ART-TIME by Artezio.
the class CalendarPeriodSelectorTest method testSetCustomPeriod.
@Test
public void testSetCustomPeriod() throws ParseException, NoSuchFieldException {
Period period = new Period(sdf.parse("1-05-2014"), sdf.parse("3-05-2014"));
setField(rangePeriodSelector, "period", period);
setField(rangePeriodSelector, "range", Range.WEEK);
Period expectedPeriod = new Period(sdf.parse("1-05-2014"), sdf.parse("3-05-2014"));
PowerMock.mockStatic(Locale.class);
expect(Locale.getDefault()).andReturn(Locale.US);
rangePeriodSelector.setCustomPeriod();
Range actualRange = (Range) getField(rangePeriodSelector, "range");
Period actualPeriod = (Period) getField(rangePeriodSelector, "period");
assertEquals(Range.CUSTOM, actualRange);
assertEquals(expectedPeriod, actualPeriod);
}
Aggregations