org.apache.qpid.test.framework
Interface Publisher

All Known Subinterfaces:
AMQPPublisher
All Known Implementing Classes:
DistributedPublisherImpl, LocalAMQPPublisherImpl, LocalPublisherImpl

public interface Publisher

A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions that can be applied to test the behaviour of the publishers.

CRC Card
Responsibilities
Provide assertion that the publishers received no exceptions.

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, that would imply that it makes sense to pull the assertions back from AMQPPublisher to here.

Method Summary
 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 publisher got a given exception during the test.
 Assertion noExceptionsAssertion(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
          Provides an assertion that the publisher encountered no exceptions.
 

Method Detail

noExceptionsAssertion

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

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

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 publisher 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 publisher got a given exception during the test.


Licensed to the Apache Software Foundation