Search in sources :

Example 6 with DynamicEventDispatcher

use of org.iobserve.stages.general.DynamicEventDispatcher in project iobserve-analysis by research-iobserve.

the class DynamicEventDispatcherTest method checkDeallocationDetection.

/**
 * Check whether all deallocation events are found.
 */
@Test
public void checkDeallocationDetection() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    final List<IDeallocationEvent> localDeallocationRecords = new ArrayList<>();
    StageTester.test(eventDispatcher).and().send(this.inputRecords).to(eventDispatcher.getInputPort()).and().receive(localDeallocationRecords).from(this.deallocationEventMatcher.getOutputPort()).start();
    Assert.assertThat("Did not collect all allocation events.", (int) eventDispatcher.getEventCount(), Is.is(this.inputRecords.size()));
    Assert.assertEquals("Wrong number of deallocations", this.deallocationRecords.size(), localDeallocationRecords.size());
}
Also used : IDeallocationEvent(org.iobserve.common.record.IDeallocationEvent) ArrayList(java.util.ArrayList) DynamicEventDispatcher(org.iobserve.stages.general.DynamicEventDispatcher) Test(org.junit.Test)

Example 7 with DynamicEventDispatcher

use of org.iobserve.stages.general.DynamicEventDispatcher in project iobserve-analysis by research-iobserve.

the class DynamicEventDispatcherTest method checkRecordCount.

/**
 * Check if all records are counted correctly.
 */
@Test
public void checkRecordCount() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    StageTester.test(eventDispatcher).and().send(this.inputRecords).to(eventDispatcher.getInputPort()).start();
    Assert.assertThat("Did not collect all events.", (int) eventDispatcher.getEventCount(), Is.is(this.inputRecords.size()));
}
Also used : DynamicEventDispatcher(org.iobserve.stages.general.DynamicEventDispatcher) Test(org.junit.Test)

Aggregations

DynamicEventDispatcher (org.iobserve.stages.general.DynamicEventDispatcher)7 Test (org.junit.Test)7 ArrayList (java.util.ArrayList)6 IMonitoringRecord (kieker.common.record.IMonitoringRecord)1 TraceMetadata (kieker.common.record.flow.trace.TraceMetadata)1 IAllocationEvent (org.iobserve.common.record.IAllocationEvent)1 IDeallocationEvent (org.iobserve.common.record.IDeallocationEvent)1 IDeployedEvent (org.iobserve.common.record.IDeployedEvent)1 IUndeployedEvent (org.iobserve.common.record.IUndeployedEvent)1