org.apache.qpid.test.framework
Class AssertionBase

java.lang.Object
  extended by org.apache.qpid.test.framework.AssertionBase
All Implemented Interfaces:
Assertion

public abstract class AssertionBase
extends Object
implements Assertion

AssertionBase is a base class for implenmenting assertions. It provides a mechanism to store error messages, and report all error messages when its toString() method is called.

CRC Card
Responsibilities Collaborations
Collect error messages.


Field Summary
(package private)  List<String> errors
          Holds the error messages.
 
Constructor Summary
AssertionBase()
           
 
Method Summary
 void addError(String error)
          Adds an error message to the assertion.
 String toString()
          Prints all of the error messages in the assertion into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.test.framework.Assertion
apply
 

Field Detail

errors

List<String> errors
Holds the error messages.

Constructor Detail

AssertionBase

public AssertionBase()
Method Detail

addError

public void addError(String error)
Adds an error message to the assertion.

Parameters:
error - An error message to add to the assertion.

toString

public String toString()
Prints all of the error messages in the assertion into a string.

Overrides:
toString in class Object
Returns:
All of the error messages in the assertion as a string.


Licensed to the Apache Software Foundation