public List<DateIntervalType> getListOfIntervalTypes() { if (isFixedStrategy()) { return DateIntervalType.FIXED_INTERVALS_SUPPORTED; } return Arrays.asList(DateIntervalType.values()); }
public List<DateIntervalType> getListOfIntervalTypes() { if (isFixedStrategy()) { return DateIntervalType.FIXED_INTERVALS_SUPPORTED; } return Arrays.asList(DateIntervalType.values()); }
for (DateIntervalType type : values()) { long nintervals = millis / getDurationInMillis(type); if (nintervals < maxIntervals) {
for (DateIntervalType type : values()) { long nintervals = millis / getDurationInMillis(type); if (nintervals < maxIntervals) {
@Test public void testDynamicModeInit() { ColumnGroup columnGroup = new ColumnGroup("col", "col", DYNAMIC, 15, HOUR.toString()); presenter.init(columnGroup); verify(view).setFixedModeValue(false); verify(view).clearIntervalTypeSelector(); verify(view, times(DateIntervalType.values().length)).addIntervalTypeItem(any(DateIntervalType.class)); verify(view).setSelectedIntervalTypeIndex(anyInt()); verify(view).setMaxIntervalsVisibility(true); verify(view).setMaxIntervalsValue("15"); verify(view, never()).setFirstDayVisibility(true); verify(view, never()).setFirstMonthVisibility(true); }
@Test public void testDynamicModeInit() { ColumnGroup columnGroup = new ColumnGroup("col", "col", DYNAMIC, 15, HOUR.toString()); presenter.init(columnGroup); verify(view).setFixedModeValue(false); verify(view).clearIntervalTypeSelector(); verify(view, times(DateIntervalType.values().length)).addIntervalTypeItem(any(DateIntervalType.class)); verify(view).setSelectedIntervalTypeIndex(anyInt()); verify(view).setMaxIntervalsVisibility(true); verify(view).setMaxIntervalsValue("15"); verify(view, never()).setFirstDayVisibility(true); verify(view, never()).setFirstMonthVisibility(true); }
for (DateIntervalType type : values()) { long nintervals = millis / getDurationInMillis(type); if (nintervals < maxIntervals) {
@Test public void testFixedIntervalsSupported() throws Exception { for (DateIntervalType type : DateIntervalType.values()) { try { DataSetLookupFactory.newDataSetLookupBuilder().group(COLUMN_DATE).fixed(type, true); if (!DateIntervalType.FIXED_INTERVALS_SUPPORTED.contains(type)) { fail("Missing exception on a not supported fixed interval: " + type); } } catch (Exception e) { if (DateIntervalType.FIXED_INTERVALS_SUPPORTED.contains(type)) { fail("Exception on a supported fixed interval: " + type); } } } }
@Test public void testFixedIntervalsSupported() throws Exception { for (DateIntervalType type : DateIntervalType.values()) { try { DataSetLookupFactory.newDataSetLookupBuilder().group(COLUMN_DATE).fixed(type, true); if (!DateIntervalType.FIXED_INTERVALS_SUPPORTED.contains(type)) { fail("Missing exception on a not supported fixed interval: " + type); } } catch (Exception e) { if (DateIntervalType.FIXED_INTERVALS_SUPPORTED.contains(type)) { fail("Exception on a supported fixed interval: " + type); } } } }