Search in sources :

Example 1 with SingleSocketRecordReader

use of kieker.monitoring.core.controller.tcp.SingleSocketRecordReader in project iobserve-analysis by research-iobserve.

the class TcpProbeControllerTest method init.

/**
 * Initiates all necessary things like the ProbeController and the TestListener for Receiving
 * other things.
 */
@BeforeClass
public static void init() {
    TcpProbeControllerTest.tcpProbeController = new TcpProbeController();
    TcpProbeControllerTest.listener = new TestListener();
    TcpProbeControllerTest.tcpReader = new SingleSocketRecordReader(TcpProbeControllerTest.PORT, TcpProbeControllerTest.BUFFER_SIZE, TcpProbeControllerTest.LOGGER, TcpProbeControllerTest.listener);
    new Thread(TcpProbeControllerTest.tcpReader).start();
    try {
        // TODO we must wait until the reader is up. This is not a unit test. Either rewriter
        // as unit test using powermock or transform into integration test
        Thread.sleep(10000);
    } catch (final InterruptedException e) {
        TcpProbeControllerTest.LOGGER.error("Test init failed", e);
    }
}
Also used : SingleSocketRecordReader(kieker.monitoring.core.controller.tcp.SingleSocketRecordReader) TcpProbeController(org.iobserve.utility.tcp.TcpProbeController) BeforeClass(org.junit.BeforeClass)

Example 2 with SingleSocketRecordReader

use of kieker.monitoring.core.controller.tcp.SingleSocketRecordReader in project iobserve-analysis by research-iobserve.

the class ProbeControlFilterTest method setUp.

/**
 * Setup the test.
 */
@Before
public void setUp() {
    synchronized (this) {
        final IRecordReceivedListener listener = new IRecordReceivedListener() {

            @Override
            public void onRecordReceived(final IMonitoringRecord record) {
            // do nothing.. the TCP sender is tested elsewhere
            }
        };
        ProbeControlFilterTest.port++;
        this.tcpReader = new SingleSocketRecordReader(ProbeControlFilterTest.port, ProbeControlFilterTest.BUFFER_SIZE, ProbeControlFilterTest.LOGGER, listener);
        new Thread(this.tcpReader).start();
        this.probeControlFilter = new ProbeControlFilter(new TcpProbeController());
    }
}
Also used : IRecordReceivedListener(kieker.common.record.IRecordReceivedListener) SingleSocketRecordReader(kieker.monitoring.core.controller.tcp.SingleSocketRecordReader) ProbeControlFilter(org.iobserve.stages.tcp.ProbeControlFilter) IMonitoringRecord(kieker.common.record.IMonitoringRecord) TcpProbeController(org.iobserve.utility.tcp.TcpProbeController) Before(org.junit.Before)

Aggregations

SingleSocketRecordReader (kieker.monitoring.core.controller.tcp.SingleSocketRecordReader)2 TcpProbeController (org.iobserve.utility.tcp.TcpProbeController)2 IMonitoringRecord (kieker.common.record.IMonitoringRecord)1 IRecordReceivedListener (kieker.common.record.IRecordReceivedListener)1 ProbeControlFilter (org.iobserve.stages.tcp.ProbeControlFilter)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1