InfoViewManifestation extends FeedView { @Override public void updateFromFeed(Map<String, List<Map<String, String>>> data) { if (!data.isEmpty()) { tableModel.updateFromFeed(data); } List<Map<String,String>> feedDataForThisComponentCastAsMap = data.get(f); if (feedDataForThisComponentCastAsMap == null || feedDataForThisComponentCastAsMap.isEmpty()) { return; } Map<String, String> entry = feedDataForThisComponentCastAsMap.get( feedDataForThisComponentCastAsMap.size() -1 ); RenderingInfo ri = feed.getRenderingInfo(entry); valueLabel.setText(ri.getValueText()); valueLabel.setForeground(ri.getValueColor()); if (!valueLabel.isVisible()) valueLabel.setVisible(true); } InfoViewManifestation(AbstractComponent component, ViewInfo info); @Override List<FeedProvider> getVisibleFeedProviders(); @Override void synchronizeTime(Map<String, List<Map<String, String>>> data,
			long syncTime); @Override void updateFromFeed(Map<String, List<Map<String, String>>> data); @Override void updateMonitoredGUI(); static final String VIEW_NAME; public ValueModel tableModel; }
@SuppressWarnings("unchecked") @Test public void testInfoView() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { InfoViewManifestation manifestation = new InfoViewManifestation(parentComponent, new ViewInfo(InfoViewManifestation.class,"info", ViewType.OBJECT)); for (AncestorListener listener : manifestation.getAncestorListeners()) { listener.ancestorRemoved(null); manifestation.removeAncestorListener(listener); } FrameFixture fixture = showInFrame(manifestation, "test"); JTableFixture tableFixture = fixture.table(); FeedProvider.RenderingInfo ri = new FeedProvider.RenderingInfo( "1", Color.gray, "a", Color.gray, true ); Mockito.when(provider.getRenderingInfo(Mockito.anyMap())).thenReturn(ri); Map<String, String> dataInfo = new HashMap<String,String>(); dataInfo.put(FeedProvider.NORMALIZED_VALUE_KEY, "1"); dataInfo.put(FeedProvider.NORMALIZED_RENDERING_INFO, ri.toString()); Map<String, List<Map<String, String>>> data = Collections.singletonMap(provider.getSubscriptionId(), Collections.singletonList(dataInfo)); Field f1 = InfoViewManifestation.class.getField("tableModel"); f1.setAccessible(true); Object view = f1.get(manifestation); Field f2 = ValueModel.class.getField("eList"); f2.setAccessible(true); f2.set(view, eList); ((ValueModel)view).clearModel(); manifestation.updateFromFeed(data); JLabelFixture labelFixture = new Query().labelIn(fixture); labelFixture.requireText("1"); JRadioButtonFixture buttonA = new Query().accessibleNameMatches("Alpha Value: ").radioButtonIn(fixture); buttonA.check(); manifestation.updateFromFeed(data); JTableCellFixture cell = tableFixture.cell(row(0).column(2)); JTableCellFixture cell2 = tableFixture.cell(row(1).column(2)); cell.requireValue("1"); cell2.requireValue("1"); buttonA.uncheck(); JRadioButtonFixture buttonI = new Query().accessibleNameMatches("Test Value: ").radioButtonIn(fixture); buttonI.check(); JTextComponentFixture textFixture = new Query().textBoxIn(fixture); textFixture.enterText("2"); manifestation.updateFromFeed(data); cell.requireValue("2"); cell2.requireValue("2"); }