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());
}
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()));
}
Aggregations