@Test public void testBadInput() { View switcherView = SwitcherView.VIEW_INFO.createView(mockComponent); switcherView.addMonitoredGUI(null); switcherView.addMonitoredGUI("hello"); Mockito.when(mockViewProvider.getHousedViewManifestation()) .thenReturn(null); switcherView.addMonitoredGUI(mockViewProvider); }
@Override public <T> void addMonitoredGUI(T gui) { if (gui instanceof ViewProvider) { managedView = (ViewProvider) gui; } if (managedView != null) { resetSelection(); if (comboBox != null) { comboBox.setVisible(true); comboBox.setEnabled(true); } } super.addMonitoredGUI(gui); }
SwitcherView extends View { @Override public <T> void addMonitoredGUI(T gui) { if (gui instanceof ViewProvider) { managedView = (ViewProvider) gui; } if (managedView != null) { resetSelection(); if (comboBox != null) { comboBox.setVisible(true); comboBox.setEnabled(true); } } super.addMonitoredGUI(gui); } }
SwitcherView extends View { @Override public <T> void addMonitoredGUI(T gui) { if (gui instanceof ViewProvider) { managedView = (ViewProvider) gui; } if (managedView != null) { resetSelection(); if (comboBox != null) { comboBox.setVisible(true); comboBox.setEnabled(true); } } super.addMonitoredGUI(gui); } @SuppressWarnings({ "rawtypes", "unchecked" })  SwitcherView(AbstractComponent ac, ViewInfo vi); }
SwitcherView extends View { @Override public <T> void addMonitoredGUI(T gui) { if (gui instanceof ViewProvider) { managedView = (ViewProvider) gui; } if (managedView != null) { resetSelection(); if (comboBox != null) { comboBox.setVisible(true); comboBox.setEnabled(true); } } super.addMonitoredGUI(gui); } @SuppressWarnings({ "rawtypes", "unchecked" })  SwitcherView(AbstractComponent ac, ViewInfo vi); @Override void addMonitoredGUI(T gui); @Override void setForeground(Color fg); }
SwitcherView extends View { @Override public <T> void addMonitoredGUI(T gui) { if (gui instanceof ViewProvider) { managedView = (ViewProvider) gui; } if (managedView != null) { resetSelection(); if (comboBox != null) { comboBox.setVisible(true); comboBox.setEnabled(true); } } super.addMonitoredGUI(gui); } @SuppressWarnings({ "rawtypes", "unchecked" })  SwitcherView(AbstractComponent ac, ViewInfo vi); @Override void addMonitoredGUI(T gui); @Override void setForeground(Color fg); static final ViewInfo VIEW_INFO; }