FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.communication.sharedMemory.QueueIOPipeTest Class Reference

JUnit class to test QueueIOPipe. More...

Inheritance diagram for frodo2.communication.sharedMemory.QueueIOPipeTest:

Classes

class  Collector
 A listener that collects received messages. More...

Public Member Functions

 QueueIOPipeTest (String name, boolean measureTime)
 Constructor.
void setUp () throws Exception
void tearDown ()
void test2QueuesInSeries () throws InterruptedException
 This test connects two queues in series using a QueueIOPipe.
void test2QueuesInSeriesSerialized () throws InterruptedException
 This test connects two queues in series using a QueueIOPipe and sends a serialized message.
void test2QueuesInSeriesMultiple () throws InterruptedException
 This test connects two queues in series using a QueueIOPipe and sends multiple messages.

Static Public Member Functions

static TestSuite suite ()

Private Attributes

QueueIOPipe pipe
 The QueueIOPipe under test.
QueueInputPipeTrivial toQueue1
 Used to send a message to the first queue.
Queue queue1
 The first queue.
Queue queue2
 The second queue.
Collector collector
 Listener collecting messages received by queue2.
boolean measureTime
 Used as a switch between the normal and the simulated queue.
CentralMailer mailman
 The CentralMailer.

Detailed Description

JUnit class to test QueueIOPipe.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ QueueIOPipeTest()

frodo2.communication.sharedMemory.QueueIOPipeTest.QueueIOPipeTest ( String name,
boolean measureTime )

Constructor.

Parameters
namename of the test method
measureTimetrue when the queue measures time spent

References measureTime.

Referenced by suite().

Member Function Documentation

◆ setUp()

void frodo2.communication.sharedMemory.QueueIOPipeTest.setUp ( ) throws Exception
See also
junit.framework.TestCase#setUp()

References mailman, pipe, queue1, queue2, and toQueue1.

◆ suite()

TestSuite frodo2.communication.sharedMemory.QueueIOPipeTest.suite ( )
static
Returns
the test suite

References QueueIOPipeTest().

Referenced by frodo2.communication.AllTests.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.communication.sharedMemory.QueueIOPipeTest.tearDown ( )
See also
junit.framework.TestCase#tearDown()

References mailman, queue1, and queue2.

◆ test2QueuesInSeries()

void frodo2.communication.sharedMemory.QueueIOPipeTest.test2QueuesInSeries ( ) throws InterruptedException

This test connects two queues in series using a QueueIOPipe.

Exceptions
InterruptedExceptionif interrupted while sleeping

References frodo2.communication.sharedMemory.QueueIOPipeTest.Collector.getNextMsgTimed(), mailman, frodo2.communication.MessageWrapper.setDestination(), and toQueue1.

Here is the call graph for this function:

◆ test2QueuesInSeriesMultiple()

void frodo2.communication.sharedMemory.QueueIOPipeTest.test2QueuesInSeriesMultiple ( ) throws InterruptedException

This test connects two queues in series using a QueueIOPipe and sends multiple messages.

Exceptions
InterruptedExceptionif interrupted while sleeping

References frodo2.communication.sharedMemory.QueueIOPipeTest.Collector.getNextMsgTimed(), mailman, frodo2.communication.MessageWrapper.setDestination(), frodo2.communication.MessageWrapper.setTime(), and toQueue1.

Here is the call graph for this function:

◆ test2QueuesInSeriesSerialized()

void frodo2.communication.sharedMemory.QueueIOPipeTest.test2QueuesInSeriesSerialized ( ) throws InterruptedException

Member Data Documentation

◆ collector

Collector frodo2.communication.sharedMemory.QueueIOPipeTest.collector
private

Listener collecting messages received by queue2.

◆ mailman

CentralMailer frodo2.communication.sharedMemory.QueueIOPipeTest.mailman
private

◆ measureTime

boolean frodo2.communication.sharedMemory.QueueIOPipeTest.measureTime
private

Used as a switch between the normal and the simulated queue.

Referenced by QueueIOPipeTest().

◆ pipe

QueueIOPipe frodo2.communication.sharedMemory.QueueIOPipeTest.pipe
private

The QueueIOPipe under test.

Referenced by setUp().

◆ queue1

Queue frodo2.communication.sharedMemory.QueueIOPipeTest.queue1
private

The first queue.

Referenced by setUp(), and tearDown().

◆ queue2

Queue frodo2.communication.sharedMemory.QueueIOPipeTest.queue2
private

The second queue.

Referenced by setUp(), and tearDown().

◆ toQueue1

QueueInputPipeTrivial frodo2.communication.sharedMemory.QueueIOPipeTest.toQueue1
private

Used to send a message to the first queue.

Referenced by setUp(), test2QueuesInSeries(), test2QueuesInSeriesMultiple(), and test2QueuesInSeriesSerialized().


The documentation for this class was generated from the following file: