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

A JUnit class to test Queue. More...

Inheritance diagram for frodo2.communication.QueueTest:

Classes

class  QueueInputPipeTrivial
 This pipe has a list of messages ready to be pulled using pullMessage(). More...
class  QueueOutputPipeTrivial
 This pipe stores the messages passed to it using pushObject(). More...
class  ConstantMsgPolicy
 A message policy that always returns the same decision. More...

Public Member Functions

 QueueTest (String method)
 Generates a test using only the input test method.
void setUp ()
void tearDown ()
void testForward ()
 Tests the forwarding of a message.
void testDiscard () throws InterruptedException
 Tests the discarding of a message.
void testForwardByType () throws InterruptedException
 Tests the forwarding of a message of a specific type.
void testForwardSerialized ()
 Tests the forwarding of a serialized message.
void testMultipleForward ()
 Tests the forwarding of multiple messages.
void testMultipleInputPipes ()
 Tests a queue with two input pipes.
void testSendToSelf ()
 Tests the sending of a message to itself.
void testSendToMultiple ()
 Tests the sending of a message to all known recipients (except the queue itself).
void testSendMessageOrder ()
 Tests that sequential calls to sendMessage() result in the message being sent in the correct order.
void testSendMessageMultiple ()
 Tests that sequential calls to sendMessage() on the same Message object actually send the message multiple times, not just once.
void testOutgoingListener () throws InterruptedException
 Tests that outgoing message listeners get notified.

Static Public Member Functions

static TestSuite suite ()

Protected Attributes

QueueOutputPipeTrivial output
 The output pipe used for the tests.
QueueInputPipeTrivial input
 The input pipe used for the tests.
Queue queue
 The queue under test.
ConstantMsgPolicy decider
 The incoming object policy used for the tests.

Detailed Description

A JUnit class to test Queue.

Author
Thomas Leaute
Todo
Test the counting of messages.

Constructor & Destructor Documentation

◆ QueueTest()

frodo2.communication.QueueTest.QueueTest ( String method)

Generates a test using only the input test method.

Parameters
methodthe test method

Referenced by suite().

Member Function Documentation

◆ setUp()

void frodo2.communication.QueueTest.setUp ( )
See also
junit.framework.TestCase#setUp()

References decider, input, output, and queue.

◆ suite()

TestSuite frodo2.communication.QueueTest.suite ( )
static
Returns
the test suite

References QueueTest().

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

Here is the call graph for this function:

◆ tearDown()

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

References decider, input, output, and queue.

◆ testDiscard()

void frodo2.communication.QueueTest.testDiscard ( ) throws InterruptedException

Tests the discarding of a message.

Exceptions
InterruptedExceptionNecessary because it uses Thread.sleep()

References input, output, and frodo2.communication.QueueTest.ConstantMsgPolicy.setForward().

Here is the call graph for this function:

◆ testForward()

void frodo2.communication.QueueTest.testForward ( )

Tests the forwarding of a message.

References input, and output.

◆ testForwardByType()

void frodo2.communication.QueueTest.testForwardByType ( ) throws InterruptedException

Tests the forwarding of a message of a specific type.

Exceptions
InterruptedExceptionNecessary because it uses Thread.sleep()

References frodo2.communication.Message.getType(), input, output, queue, and frodo2.communication.QueueTest.ConstantMsgPolicy.setForward().

Here is the call graph for this function:

◆ testForwardSerialized()

void frodo2.communication.QueueTest.testForwardSerialized ( )

Tests the forwarding of a serialized message.

References decider, input, and output.

◆ testMultipleForward()

void frodo2.communication.QueueTest.testMultipleForward ( )

Tests the forwarding of multiple messages.

References input, and output.

◆ testMultipleInputPipes()

void frodo2.communication.QueueTest.testMultipleInputPipes ( )

Tests a queue with two input pipes.

References frodo2.communication.QueueTest.QueueInputPipeTrivial.addMessage(), decider, input, output, and queue.

Here is the call graph for this function:

◆ testOutgoingListener()

void frodo2.communication.QueueTest.testOutgoingListener ( ) throws InterruptedException

Tests that outgoing message listeners get notified.

Exceptions
InterruptedExceptionNecessary because it uses Thread.sleep()

References decider, frodo2.communication.OutgoingMsgPolicyInterface< T >.Decision.DISCARD, input, and output.

◆ testSendMessageMultiple()

void frodo2.communication.QueueTest.testSendMessageMultiple ( )

Tests that sequential calls to sendMessage() on the same Message object actually send the message multiple times, not just once.

References output, and queue.

◆ testSendMessageOrder()

void frodo2.communication.QueueTest.testSendMessageOrder ( )

Tests that sequential calls to sendMessage() result in the message being sent in the correct order.

References output, and queue.

◆ testSendToMultiple()

void frodo2.communication.QueueTest.testSendToMultiple ( )

Tests the sending of a message to all known recipients (except the queue itself).

References frodo2.communication.MessageWrapper.getMessage(), frodo2.communication.QueueTest.QueueOutputPipeTrivial.getNextMsgTimed(), output, and queue.

Here is the call graph for this function:

◆ testSendToSelf()

void frodo2.communication.QueueTest.testSendToSelf ( )

Tests the sending of a message to itself.

References decider, input, and output.

Member Data Documentation

◆ decider

ConstantMsgPolicy frodo2.communication.QueueTest.decider
protected

The incoming object policy used for the tests.

Referenced by setUp(), tearDown(), testForwardSerialized(), testMultipleInputPipes(), testOutgoingListener(), and testSendToSelf().

◆ input

◆ output

◆ queue

Queue frodo2.communication.QueueTest.queue
protected

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