@Test public void setUpWorksOnlyOnce() throws Exception { events.setup(); verify( eventBus ).addHandler( ValidateEvent.TYPE, analyzerController ); reset( eventBus ); events.setup(); verify( eventBus, never() ).addHandler( ValidateEvent.TYPE, analyzerController ); }
public void setup() { if (eventBusHandlerRegistrations.isEmpty()) { eventBusHandlerRegistrations.add(eventBus.addHandler(ValidateEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(DeleteRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnDeleted.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(UpdateColumnDataEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AppendRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(InsertRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnInserted.TYPE, analyzerController)); } }
Events { public void setup() { if (eventBusHandlerRegistrations.isEmpty()) { eventBusHandlerRegistrations.add(eventBus.addHandler(ValidateEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(DeleteRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnDeleted.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(UpdateColumnDataEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AppendRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(InsertRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnInserted.TYPE, analyzerController)); } } }
Events { public void setup() { if (eventBusHandlerRegistrations.isEmpty()) { eventBusHandlerRegistrations.add(eventBus.addHandler(ValidateEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(DeleteRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnDeleted.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(UpdateColumnDataEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AppendRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(InsertRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnInserted.TYPE, analyzerController)); } } Events(final EventBus eventBus,
                  final AnalyzerControllerImpl analyzerController); }
Events { public void setup() { if (eventBusHandlerRegistrations.isEmpty()) { eventBusHandlerRegistrations.add(eventBus.addHandler(ValidateEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(DeleteRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnDeleted.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(UpdateColumnDataEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AppendRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(InsertRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnInserted.TYPE, analyzerController)); } } Events(final EventBus eventBus,
                  final AnalyzerControllerImpl analyzerController); void setup(); void teardown(); }
Events { public void setup() { if (eventBusHandlerRegistrations.isEmpty()) { eventBusHandlerRegistrations.add(eventBus.addHandler(ValidateEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(DeleteRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnDeleted.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(UpdateColumnDataEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AppendRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(InsertRowEvent.TYPE, analyzerController)); eventBusHandlerRegistrations.add(eventBus.addHandler(AfterColumnInserted.TYPE, analyzerController)); } } Events(final EventBus eventBus,
                  final AnalyzerControllerImpl analyzerController); void setup(); void teardown();  }