Search in sources :

Example 1 with TrackingEventManager

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);
}
Also used : TrackingEventManager(nl.tudelft.watchdog.core.logic.event.TrackingEventManager) PersisterBase(nl.tudelft.watchdog.core.logic.storage.PersisterBase) Before(org.junit.Before)

Example 2 with TrackingEventManager

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();
}
Also used : TransferManager(nl.tudelft.watchdog.eclipse.logic.network.TransferManager) WorkbenchListener(nl.tudelft.watchdog.eclipse.logic.ui.listeners.WorkbenchListener) TrackingEventManager(nl.tudelft.watchdog.core.logic.event.TrackingEventManager) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StaticAnalysisWarningEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.staticanalysis.StaticAnalysisWarningEvent) ByteArrayInputStream(java.io.ByteArrayInputStream) Stream(java.util.stream.Stream) InputStream(java.io.InputStream) IntervalManager(nl.tudelft.watchdog.eclipse.logic.interval.IntervalManager) WatchDogEventEditorSpecificImplementation(nl.tudelft.watchdog.core.logic.ui.events.WatchDogEventType.WatchDogEventEditorSpecificImplementation) Before(org.junit.Before)

Aggregations

TrackingEventManager (nl.tudelft.watchdog.core.logic.event.TrackingEventManager)2 Before (org.junit.Before)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Stream (java.util.stream.Stream)1 StaticAnalysisWarningEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.staticanalysis.StaticAnalysisWarningEvent)1 PersisterBase (nl.tudelft.watchdog.core.logic.storage.PersisterBase)1 WatchDogEventEditorSpecificImplementation (nl.tudelft.watchdog.core.logic.ui.events.WatchDogEventType.WatchDogEventEditorSpecificImplementation)1 IntervalManager (nl.tudelft.watchdog.eclipse.logic.interval.IntervalManager)1 TransferManager (nl.tudelft.watchdog.eclipse.logic.network.TransferManager)1 WorkbenchListener (nl.tudelft.watchdog.eclipse.logic.ui.listeners.WorkbenchListener)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1