Search in sources :

Example 6 with AbstractTcpControlEvent

use of org.iobserve.utility.tcp.events.AbstractTcpControlEvent in project iobserve-analysis by research-iobserve.

the class ProbeMapperTest method receiveUninitializedDataTest.

// private final int port = 5791;
@Test
public void receiveUninitializedDataTest() {
    this.probeMapper = new ProbeMapper(Mockito.mock(Neo4JModelResource.class), Mockito.mock(Neo4JModelResource.class), Mockito.mock(Neo4JModelResource.class), Mockito.mock(Neo4JModelResource.class), Mockito.mock(Neo4JModelResource.class));
    final ProbeManagementData data = new ProbeManagementData(null, null);
    final List<ProbeManagementData> input = new LinkedList<>();
    input.add(data);
    final List<AbstractTcpControlEvent> output = new LinkedList<>();
    StageTester.test(this.probeMapper).and().send(input).to(this.probeMapper.getInputPort()).receive(output).from(this.probeMapper.getOutputPort()).start();
    Assert.assertTrue(output.isEmpty());
}
Also used : ProbeMapper(org.iobserve.service.privacy.violation.filter.ProbeMapper) AbstractTcpControlEvent(org.iobserve.utility.tcp.events.AbstractTcpControlEvent) ProbeManagementData(org.iobserve.service.privacy.violation.data.ProbeManagementData) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 7 with AbstractTcpControlEvent

use of org.iobserve.utility.tcp.events.AbstractTcpControlEvent in project iobserve-analysis by research-iobserve.

the class ProbeControlFilterTest method getValidControlEventTest.

/**
 * Check whether the control event is communicated properly.
 */
@Test
public void getValidControlEventTest() {
    // NOPMD localhost is required here
    final String ip = "127.0.0.1";
    final String hostname = "test.host";
    final AbstractTcpControlEvent controlEvent = new TcpActivationControlEvent(ip, ProbeControlFilterTest.port, hostname, ProbeControlFilterTest.PATTERN, ProbeControlFilterTest.TRIGGER_TIMESTAMP);
    final List<AbstractTcpControlEvent> input = new ArrayList<>();
    input.add(controlEvent);
    final List<IErrorMessages> output = new ArrayList<>();
    StageTester.test(this.probeControlFilter).and().send(input).to(this.probeControlFilter.getInputPort()).and().receive(output).from(this.probeControlFilter.getOutputPort()).start();
    Assert.assertTrue(output.isEmpty());
}
Also used : AbstractTcpControlEvent(org.iobserve.utility.tcp.events.AbstractTcpControlEvent) TcpActivationControlEvent(org.iobserve.utility.tcp.events.TcpActivationControlEvent) ArrayList(java.util.ArrayList) IErrorMessages(org.iobserve.stages.data.IErrorMessages) Test(org.junit.Test)

Aggregations

AbstractTcpControlEvent (org.iobserve.utility.tcp.events.AbstractTcpControlEvent)7 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)5 TcpActivationControlEvent (org.iobserve.utility.tcp.events.TcpActivationControlEvent)4 LinkedList (java.util.LinkedList)2 ProbeManagementData (org.iobserve.service.privacy.violation.data.ProbeManagementData)2 ProbeMapper (org.iobserve.service.privacy.violation.filter.ProbeMapper)2 IErrorMessages (org.iobserve.stages.data.IErrorMessages)2 HashMap (java.util.HashMap)1 List (java.util.List)1 Set (java.util.Set)1 TcpActivationParameterControlEvent (org.iobserve.utility.tcp.events.TcpActivationParameterControlEvent)1 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)1