mockpp::VisitableMockObjectBase::Controller Class Reference
[Controlling behaviour of a Visitable Mock Object]

Virtual base class for helper objects to easily set up the expectations. More...

List of all members.

Public Member Functions

virtual ~Controller ()=0
 Destructs a controller for the according method.
virtual void reset ()=0
 Clears all expectations and puts the object in record mode again.
virtual void unsetThrowablesInline ()=0
 Switches exception handling back to pre-1.2 behaviour.
virtual void verify ()=0
 Verify the conditions which are not in the verify() chain of the visitable mock object.
 Controller (Your_VisitableMockObject *cls)
 Constructs a controller for the according method.
void addThrowable (Throwable *t)
 Adds another throwable to the method.
void setDefaultThrowable (Throwable *t)
 Sets the default throwable.
void addReturnValue (const your_type &rv, unsigned count=1)
 Adds another return value.
void setDefaultReturnValue (const your_type &rv)
 Sets the default return value.
void setDefaultReturnValue (const your_type &rv)
 Sets the default return value.
void addResponseValue (const your_type &rv, const your_type1 &p1, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (Throwable *t, const your_type1 &p1, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const ret_type &rv, const mockpp::ConstraintHolder< type1 > &p1, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (mockpp::Throwable *t, const mockpp::ConstraintHolder< type1 > &p1, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const your_type &rv, const your_type1 &p1, const your_type2 &p2, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (Throwable *t, const your_type1 &p1, const your_type2 &p2, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const ret_type &rv, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (mockpp::Throwable *t, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const your_type &rv, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (Throwable *t, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const ret_type &rv, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (mockpp::Throwable *t, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const your_type &rv, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, const your_type4 &p4, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (Throwable *t, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, const your_type4 &p4, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const ret_type &rv, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, const mockpp::ConstraintHolder< type4 > &p4, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (mockpp::Throwable *t, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, const mockpp::ConstraintHolder< type4 > &p4, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const your_type &rv, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, const your_type4 &p4, const your_type5 &p5, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (Throwable *t, const your_type1 &p1, const your_type2 &p2, const your_type3 &p3, const your_type4 &p4, const your_type5 &p5, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.
void addResponseValue (const ret_type &rv, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, const mockpp::ConstraintHolder< type4 > &p4, const mockpp::ConstraintHolder< type5 > &p5, unsigned count=MOCKPP_UNLIMITED)
 Adds another response value.
void addResponseThrowable (mockpp::Throwable *t, const mockpp::ConstraintHolder< type1 > &p1, const mockpp::ConstraintHolder< type2 > &p2, const mockpp::ConstraintHolder< type3 > &p3, const mockpp::ConstraintHolder< type4 > &p4, const mockpp::ConstraintHolder< type5 > &p5, unsigned count=MOCKPP_UNLIMITED)
 Adds another response throwable.

Detailed Description

Virtual base class for helper objects to easily set up the expectations.

Due to the virtual nature of adding functionality with macros you will find here the documentation of the api generated by the macros.

Definition at line 180 of file VisitableMockObject.h.


Constructor & Destructor Documentation

mockpp::VisitableMockObjectBase::Controller::~Controller (  )  [pure virtual]

Destructs a controller for the according method.

Basically unregisters the controller with it's mock object.

Definition at line 154 of file VisitableMockObject.cpp.

mockpp::VisitableMockObjectBase::Controller::Controller ( Your_VisitableMockObject *  cls  ) 

Constructs a controller for the according method.

Basically registers the ccontroller with it's mock object.

Parameters:
cls the pointer to the parent mock object.

Member Function Documentation

void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( mockpp::Throwable t,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
const mockpp::ConstraintHolder< type4 > &  p4,
const mockpp::ConstraintHolder< type5 > &  p5,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameter constraints you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
p5 the 5. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( Throwable t,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
const your_type4 &  p4,
const your_type5 &  p5,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameters you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
p5 the 5. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( mockpp::Throwable t,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
const mockpp::ConstraintHolder< type4 > &  p4,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameter constraints you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( Throwable t,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
const your_type4 &  p4,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameters you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( mockpp::Throwable t,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameter constraints you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( Throwable t,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameters you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( mockpp::Throwable t,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameter constraints you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( Throwable t,
const your_type1 &  p1,
const your_type2 &  p2,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameters you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
p2 the 2. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( mockpp::Throwable t,
const mockpp::ConstraintHolder< type1 > &  p1,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameter constraints you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseThrowable ( Throwable t,
const your_type1 &  p1,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response throwable.

Response throwables are determined on the parameters you pass. This way the object throws an object that is totally based on the input.

Parameters:
t the throwable
p1 the 1. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const ret_type &  rv,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
const mockpp::ConstraintHolder< type4 > &  p4,
const mockpp::ConstraintHolder< type5 > &  p5,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameter constraints you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
p5 the 5. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const your_type &  rv,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
const your_type4 &  p4,
const your_type5 &  p5,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameters you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
p5 the 5. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const ret_type &  rv,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
const mockpp::ConstraintHolder< type4 > &  p4,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameter constraints you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const your_type &  rv,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
const your_type4 &  p4,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameters you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
p4 the 4. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const ret_type &  rv,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
const mockpp::ConstraintHolder< type3 > &  p3,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameter constraints you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const your_type &  rv,
const your_type1 &  p1,
const your_type2 &  p2,
const your_type3 &  p3,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameters you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
p3 the 3. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const ret_type &  rv,
const mockpp::ConstraintHolder< type1 > &  p1,
const mockpp::ConstraintHolder< type2 > &  p2,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameter constraints you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const your_type &  rv,
const your_type1 &  p1,
const your_type2 &  p2,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameters you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
p2 the 2. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const ret_type &  rv,
const mockpp::ConstraintHolder< type1 > &  p1,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameter constraints you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addResponseValue ( const your_type &  rv,
const your_type1 &  p1,
unsigned  count = MOCKPP_UNLIMITED 
)

Adds another response value.

Response values are determined on the parameters you pass. This way the object returns a value that is totally based on the input.

Parameters:
rv the return value
p1 the 1. parameter of the method
count the number of times this value shall be returned. Default is unlimited.
void mockpp::VisitableMockObjectBase::Controller::addReturnValue ( const your_type &  rv,
unsigned  count = 1 
)

Adds another return value.

The values from this list are return one after the other unless there are no other throwables or response values available.

Parameters:
rv the next return value
count the number of times this value shall be returned
void mockpp::VisitableMockObjectBase::Controller::addThrowable ( Throwable t  ) 

Adds another throwable to the method.

The throwables are thrown one after the other when the method is called after activating until all of them are used.

Parameters:
t a pointer to the throwable
void mockpp::VisitableMockObjectBase::Controller::setDefaultReturnValue ( const your_type &  rv  ) 

Sets the default return value.

This value is returned if there are no throwables available and if there are no other possible return values in a list.

Parameters:
rv the default return value
void mockpp::VisitableMockObjectBase::Controller::setDefaultReturnValue ( const your_type &  rv  ) 

Sets the default return value.

This value is returned if there are no throwables available and if there are no other possible return values in a list.

Parameters:
rv the default return value
void mockpp::VisitableMockObjectBase::Controller::setDefaultThrowable ( Throwable t  ) 

Sets the default throwable.

Once the list of throwables is empty this one is thrown. This also means that your method never processes the parameters passed to it.

Parameters:
t a pointer to the throwable
virtual void mockpp::VisitableMockObjectBase::Controller::unsetThrowablesInline (  )  [pure virtual]

Switches exception handling back to pre-1.2 behaviour.

This affects behaviour created with calls to addThrowable() and addReturnValue(). Starting with version 1.2 return values and exceptions have equal priority and are processed in the order they are listed in the sources. Older versions threw exceptions if available before handling potential return values.

virtual void mockpp::VisitableMockObjectBase::Controller::verify (  )  [pure virtual]

Verify the conditions which are not in the verify() chain of the visitable mock object.

Located here instead of the object for traditional reasons. If it fails, an AssertionFailedError is thrown


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated on Tue Jan 5 09:49:18 2010 for mockpp by  doxygen 1.6.1