Search in sources :

Example 1 with DynamicEventDispatcher

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

the class DynamicEventDispatcherTest method checkDeploymentDetection.

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

Example 2 with DynamicEventDispatcher

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

the class DynamicEventDispatcherTest method checkTraceMetadataDetection.

/**
 * Check whether all trace metadata records are found.
 */
@Test
public void checkTraceMetadataDetection() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    final List<TraceMetadata> localTraceMetadataRecords = new ArrayList<>();
    StageTester.test(eventDispatcher).and().send(this.inputRecords).to(eventDispatcher.getInputPort()).and().receive(localTraceMetadataRecords).from(this.traceMetadataMatcher.getOutputPort()).start();
    Assert.assertThat("Did not collect all trace metadata events.", (int) eventDispatcher.getEventCount(), Is.is(this.inputRecords.size()));
    Assert.assertEquals("Wrong number of trace metadata", this.traceMetadataRecords.size(), localTraceMetadataRecords.size());
}
Also used : ArrayList(java.util.ArrayList) TraceMetadata(kieker.common.record.flow.trace.TraceMetadata) DynamicEventDispatcher(org.iobserve.stages.general.DynamicEventDispatcher) Test(org.junit.Test)

Example 3 with DynamicEventDispatcher

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

the class DynamicEventDispatcherTest method checkLogCounting.

/**
 * Test reporting elements of the record switch.
 */
@Test
public void checkLogCounting() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    final List<IMonitoringRecord> thousandRecords = new ArrayList<>();
    for (int i = 0; i < 2000; i++) {
        thousandRecords.addAll(this.otherRecords);
    }
    StageTester.test(eventDispatcher).and().send(thousandRecords).to(eventDispatcher.getInputPort()).start();
    Assert.assertThat((int) eventDispatcher.getEventCount(), Is.is(thousandRecords.size()));
}
Also used : IMonitoringRecord(kieker.common.record.IMonitoringRecord) ArrayList(java.util.ArrayList) DynamicEventDispatcher(org.iobserve.stages.general.DynamicEventDispatcher) Test(org.junit.Test)

Example 4 with DynamicEventDispatcher

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

the class DynamicEventDispatcherTest method checkUndeploymentDetection.

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

Example 5 with DynamicEventDispatcher

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

the class DynamicEventDispatcherTest method checkAllocationDetection.

/**
 * Check whether all allocation events are found.
 */
@Test
public void checkAllocationDetection() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    final List<IAllocationEvent> localAllocationRecords = new ArrayList<>();
    StageTester.test(eventDispatcher).and().send(this.inputRecords).to(eventDispatcher.getInputPort()).and().receive(localAllocationRecords).from(this.allocationEventMatcher.getOutputPort()).start();
    Assert.assertThat("Did not collect all allocation events.", (int) eventDispatcher.getEventCount(), Is.is(this.inputRecords.size()));
// Assert.assertEquals("Wrong number of allocations", this.allocationRecords.size(),
// localAllocationRecords.size());
}
Also used : ArrayList(java.util.ArrayList) IAllocationEvent(org.iobserve.common.record.IAllocationEvent) 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