org.apache.qpid.test.framework
Interface Receiver

All Known Implementing Classes:
DistributedReceiverImpl, LocalReceiverImpl

public interface Receiver

A Receiver is a CircuitEnd that represents the status of the receiving side of a test circuit. Its main purpose is to provide assertions that can be applied to check the behaviour of the receivers.

CRC Card
Responsibilities
Provide assertion that the receivers received no exceptions.
Provide assertion that the receivers received all test messages sent to it.

Todo:
There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes. I am tempted to go with the dropping/warning/error approach.

Method Summary
 Assertion allMessagesReceivedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
          Provides an assertion that the receivers got all messages that were sent to it.
 Assertion channelClosedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
          Provides an assertion that the AMQP channel was forcibly closed by an error condition.
 Assertion exceptionAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps, Class<? extends Exception> exceptionClass)
          Provides an assertion that the receiver got a given exception during the test.
 Assertion noExceptionsAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
          Provides an assertion that the receivers encountered no exceptions.
 Assertion noMessagesReceivedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
          Provides an assertion that the receivers got none of the messages that were sent to it.
 

Method Detail

noExceptionsAssertion

Assertion noExceptionsAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
Provides an assertion that the receivers encountered no exceptions.

Parameters:
testProps - The test configuration properties.
Returns:
An assertion that the receivers encountered no exceptions.

allMessagesReceivedAssertion

Assertion allMessagesReceivedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
Provides an assertion that the receivers got all messages that were sent to it.

Parameters:
testProps - The test configuration properties.
Returns:
An assertion that the receivers got all messages that were sent to it.

noMessagesReceivedAssertion

Assertion noMessagesReceivedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
Provides an assertion that the receivers got none of the messages that were sent to it.

Parameters:
testProps - The test configuration properties.
Returns:
An assertion that the receivers got none of the messages that were sent to it.

channelClosedAssertion

Assertion channelClosedAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
Provides an assertion that the AMQP channel was forcibly closed by an error condition.

Parameters:
testProps - The test configuration properties.
Returns:
An assertion that the AMQP channel was forcibly closed by an error condition.

exceptionAssertion

Assertion exceptionAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps,
                             Class<? extends Exception> exceptionClass)
Provides an assertion that the receiver got a given exception during the test.

Parameters:
testProps - The test configuration properties.
exceptionClass - The exception class to check for.
Returns:
An assertion that the receiver got a given exception during the test.


Licensed to the Apache Software Foundation