use of nl.tudelft.watchdog.core.logic.event.TrackingEventManager in project watchdog by TestRoots.
the class TrackingEventManagerTest method setup.
@Before
public void setup() {
eventsToTransferPersister = Mockito.mock(PersisterBase.class);
eventsStatisticsPersister = Mockito.mock(PersisterBase.class);
trackingEventManager = new TrackingEventManager(eventsToTransferPersister, eventsStatisticsPersister);
sessionSeed = "sessionSeed";
trackingEventManager.setSessionSeed(sessionSeed);
}
use of nl.tudelft.watchdog.core.logic.event.TrackingEventManager in project watchdog by TestRoots.
the class MarkupModelListenerTest method setup.
@Before
public void setup() throws Exception {
WatchDogEventType.intervalManager = Mockito.mock(IntervalManager.class);
WatchDogEventType.editorSpecificImplementation = Mockito.mock(WatchDogEventEditorSpecificImplementation.class);
this.transferManager = Mockito.mock(TransferManager.class);
this.trackingEventManager = Mockito.mock(TrackingEventManager.class);
this.generatedEvents = new ArrayList<>();
Mockito.doAnswer(new Answer<Object>() {
@SuppressWarnings("unchecked")
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Stream<StaticAnalysisWarningEvent> stream = (Stream<StaticAnalysisWarningEvent>) invocation.getArguments()[0];
stream.map(StaticAnalysisWarningEvent::getType).forEach(generatedEvents::add);
return null;
}
}).when(this.trackingEventManager).addEvents(Mockito.any());
this.setUpTestingProject();
this.workbenchListener = new WorkbenchListener(trackingEventManager, transferManager);
this.workbenchListener.attachListeners();
}
Aggregations