KeepAllWindow extends ViewImpl implements IWindow, IRenew { @Override public void update(IEvent[] newData, IEvent[] oldData) { if (newData == null && oldData == null) { return; } if (newData != null) { for (IEvent theEvent : newData) { events.add(theEvent); } } if (oldData != null) { for (IEvent theEvent : oldData) { events.remove(theEvent); } } if (dataCollection != null) { dataCollection.update(newData, oldData); } updateChild(newData, oldData); } KeepAllWindow(); @Override void update(IEvent[] newData, IEvent[] oldData); @Override IView renewView(); void setDataCollection(IDataCollection dataCollection); IDataCollection getDataCollection();  }
@Test public void testUpdate() { Map<String, Object> values = new HashMap<String, Object>(); values.put("a", 1); values.put("b", 1); values.put("c", "c1"); IEvent event1 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_TWO); values.put("b", SupportConst.I_TWO); values.put("c", "c2"); IEvent event2 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_THREE); values.put("b", SupportConst.I_THREE); values.put("c", "c3"); IEvent event3 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_FOUR); values.put("b", SupportConst.I_FOUR); values.put("c", "c4"); IEvent event4 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_FIVE); values.put("b", SupportConst.I_FIVE); values.put("c", "c5"); IEvent event5 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_SIX); values.put("b", SupportConst.I_SIX); values.put("c", "c6"); IEvent event6 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_SEVEN); values.put("b", SupportConst.I_SEVEN); values.put("c", "c7"); IEvent event7 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_EIGHT); values.put("b", SupportConst.I_EIGHT); values.put("c", "c8"); IEvent event8 = new TupleEvent("stream", eventType, values); values.put("a", SupportConst.I_NINE); values.put("b", SupportConst.I_NINE); values.put("c", "c9"); IEvent event9 = new TupleEvent("stream", eventType, values); myView.update(new IEvent[] {event1, event2, event3, event4, event5}, null); SupportViewDataCheck.checkOldData(childView, null); SupportViewDataCheck.checkNewData(childView, new IEvent[] {event1, event2, event3, event4, event5}); myView.update(new IEvent[] {event6, event7, event8}, new IEvent[] {event9}); SupportViewDataCheck.checkOldData(childView, new IEvent[] {event9}); SupportViewDataCheck.checkNewData(childView, new IEvent[] {event6, event7, event8}); }