@Test(dataProvider="axisTestData") public void testAxisShiftWhenTimeRunsOut(TimeAxisSubsequentBoundsSetting jumpSetting, double padding) throws Exception { PlotView testPlot = new PlotView.Builder(PlotterPlot.class).build(); testPlot.setTimeAxisSubsequentSetting(jumpSetting); testPlot.setTimePadding(padding); AbstractPlottingPackage plot = Mockito.mock(AbstractPlottingPackage.class); List<AbstractPlottingPackage> subPlots = Collections.singletonList(plot); Field subPlotField = testPlot.getClass().getDeclaredField("subPlots"); subPlotField.setAccessible(true); subPlotField.set(testPlot, subPlots); PlotViewManifestation pvm = Mockito.mock(PlotViewManifestation.class); Mockito.when(pvm.getCurrentMCTTime()).thenReturn(8L); TimeXYAxis timeAxis = new TimeXYAxis(XYDimension.X); timeAxis.setStart(0); timeAxis.setEnd(7); Field timeAxisField = testPlot.getClass().getDeclaredField("plotTimeAxis"); timeAxisField.setAccessible(true); timeAxisField.set(testPlot, timeAxis); Field plotUserField = testPlot.getClass().getDeclaredField("plotUser"); plotUserField.setAccessible(true); plotUserField.set(testPlot, pvm); Method m = testPlot.getClass().getDeclaredMethod("timeReachedEnd", new Class[0]); m.setAccessible(true); m.invoke(testPlot, new Object[0]); Mockito.verify(plot, Mockito.atLeastOnce()).setTimeAxisStartAndStop(Mockito.anyLong(), Mockito.anyLong()); Mockito.verify(plot, Mockito.atMost(1)).setTimeAxisStartAndStop(Mockito.anyLong(), Mockito.anyLong()); }
@Override public long getCurrentMCTTime() { return plotUser.getCurrentMCTTime(); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public long getCurrentMCTTime() { return plotUser.getCurrentMCTTime(); } }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public long getCurrentMCTTime() { return plotUser.getCurrentMCTTime(); } private  PlotView(Builder builder); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public long getCurrentMCTTime() { return plotUser.getCurrentMCTTime(); } private  PlotView(Builder builder); void setManifestation(PlotViewManifestation theManifestation); @Override JPanel getPlotPanel(); @Override void addDataSet(String dataSetName); @Override void addDataSet(String dataSetName, Color plottingColor); @Override void addDataSet(String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, AbstractLegendEntry legendEntry); void addPopupMenus(); List<Map<String, LineSettings>> getLineSettings(); void setLineSettings(
			List<Map<String, LineSettings>> lineSettings); @Override boolean isKnownDataSet(String setName); @Override void refreshDisplay(); void initialDataRequest(); @Override void updateLegend(String dataSetName, FeedProvider.RenderingInfo info); @Override LimitAlarmState getNonTimeMaxAlarmState(int subGroupIndex); @Override LimitAlarmState getNonTimeMinAlarmState(int subGroupIndex); @Override void showTimeSyncLine(GregorianCalendar time); @Override void removeTimeSyncLine(); @Override boolean isTimeSyncLineVisible(); @Override void initiateGlobalTimeSync(GregorianCalendar time); @Override void updateGlobalTimeSync(GregorianCalendar time); @Override void notifyGlobalTimeSyncFinished(); @Override boolean inTimeSyncMode(); @Override double getNonTimeMaxCurrentlyDisplayed(); @Override double getNonTimeMinCurrentlyDisplayed(); @Override String toString(); Pinnable getTimeAxisUserPin(); AbbreviatingPlotLabelingAlgorithm getPlotLabelingAlgorithm(); void setPlotLabelingAlgorithm(AbbreviatingPlotLabelingAlgorithm thePlotLabelingAlgorithm); @Override AbstractPlottingPackage returnPlottingPackage(); @Override void setCompressionEnabled(boolean compression); @Override boolean isCompressionEnabled(); @Override void requestPlotData(GregorianCalendar startTime, GregorianCalendar endTime); @Override void informUpdateDataEventStarted(); @Override void informUpdateFromFeedEventStarted(); @Override void informUpdateDataEventCompleted(); @Override void informUpdateFromFeedEventCompleted(); @Override long getCurrentMCTTime(); PlotViewManifestation getPlotUser(); @Override boolean plotMatchesSetting(PlotConfiguration settings); @Override void updateTimeAxis(PlotSubject subject, long startTime, long endTime); @Override void updateResetButtons(); @Override void clearAllDataFromPlot(); @Override Pinnable createPin(); @Override boolean isPinned(); @Override List<AbstractPlottingPackage> getSubPlots(); @Override Axis getTimeAxis(); void addData(Map<String, SortedMap<Long, Double>> dataForPlot); void addData(String feedID, long time, double value); void setPlotTimeAxis(AbstractAxis axis); AbstractAxis getPlotTimeAxis(); @Override void plotAxisChanged(PlotSubject subject, AbstractAxis axis); @Override void dataPlotted(); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public long getCurrentMCTTime() { return plotUser.getCurrentMCTTime(); } private  PlotView(Builder builder); void setManifestation(PlotViewManifestation theManifestation); @Override JPanel getPlotPanel(); @Override void addDataSet(String dataSetName); @Override void addDataSet(String dataSetName, Color plottingColor); @Override void addDataSet(String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, AbstractLegendEntry legendEntry); void addPopupMenus(); List<Map<String, LineSettings>> getLineSettings(); void setLineSettings(
			List<Map<String, LineSettings>> lineSettings); @Override boolean isKnownDataSet(String setName); @Override void refreshDisplay(); void initialDataRequest(); @Override void updateLegend(String dataSetName, FeedProvider.RenderingInfo info); @Override LimitAlarmState getNonTimeMaxAlarmState(int subGroupIndex); @Override LimitAlarmState getNonTimeMinAlarmState(int subGroupIndex); @Override void showTimeSyncLine(GregorianCalendar time); @Override void removeTimeSyncLine(); @Override boolean isTimeSyncLineVisible(); @Override void initiateGlobalTimeSync(GregorianCalendar time); @Override void updateGlobalTimeSync(GregorianCalendar time); @Override void notifyGlobalTimeSyncFinished(); @Override boolean inTimeSyncMode(); @Override double getNonTimeMaxCurrentlyDisplayed(); @Override double getNonTimeMinCurrentlyDisplayed(); @Override String toString(); Pinnable getTimeAxisUserPin(); AbbreviatingPlotLabelingAlgorithm getPlotLabelingAlgorithm(); void setPlotLabelingAlgorithm(AbbreviatingPlotLabelingAlgorithm thePlotLabelingAlgorithm); @Override AbstractPlottingPackage returnPlottingPackage(); @Override void setCompressionEnabled(boolean compression); @Override boolean isCompressionEnabled(); @Override void requestPlotData(GregorianCalendar startTime, GregorianCalendar endTime); @Override void informUpdateDataEventStarted(); @Override void informUpdateFromFeedEventStarted(); @Override void informUpdateDataEventCompleted(); @Override void informUpdateFromFeedEventCompleted(); @Override long getCurrentMCTTime(); PlotViewManifestation getPlotUser(); @Override boolean plotMatchesSetting(PlotConfiguration settings); @Override void updateTimeAxis(PlotSubject subject, long startTime, long endTime); @Override void updateResetButtons(); @Override void clearAllDataFromPlot(); @Override Pinnable createPin(); @Override boolean isPinned(); @Override List<AbstractPlottingPackage> getSubPlots(); @Override Axis getTimeAxis(); void addData(Map<String, SortedMap<Long, Double>> dataForPlot); void addData(String feedID, long time, double value); void setPlotTimeAxis(AbstractAxis axis); AbstractAxis getPlotTimeAxis(); @Override void plotAxisChanged(PlotSubject subject, AbstractAxis axis); @Override void dataPlotted(); public List<AbstractPlottingPackage> subPlots; public Map<String, Set<AbstractPlottingPackage>> dataSetNameToSubGroupMap; public Map<String, String> dataSetNameToDisplayMap; }