sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // The definitions of the transition classes upon the CComponentTester class methods.
sl@0: // 
sl@0: //
sl@0: 
sl@0: #ifndef __COMPONENTTESTERTRANSITIONS_H__
sl@0: #define __COMPONENTTESTERTRANSITIONS_H__
sl@0: 
sl@0: #include "TestUtilities.h"
sl@0: #include "StateAccessor.h"
sl@0: #include "LeakTestTransition.h"
sl@0: #include <ecom/test_bed/datalogger.h>
sl@0: #include "ComponentTester.h"
sl@0: #include "ComponentTesterStateAccessor.h"
sl@0: #include <ecom/test_bed/unittest.h>
sl@0: 
sl@0: #define CTransitionType CLeakTestTransition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Provide all the CComponentTester specific
sl@0: 	parameters and behaviour on the CComponentTester
sl@0: 	test class for a transition.
sl@0:  */
sl@0: class CComponentTester_UnitTestContext : public CUnitTestContext
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_UnitTestContext(CDataLogger& aDataLogger,
sl@0: 														MStateAccessor& aStateAccessor,
sl@0: 														MTransitionObserver& aObserver)
sl@0: 		Intended Usage	: Default constructor.
sl@0: 		Error Condition	: None. 
sl@0: 		@since			7.0
sl@0: 		@param			aDataLogger The output logging object.
sl@0: 		@param			aObserver The observer of this UnitTest's Transitions.
sl@0: 		@param			aStateAccessor WhiteBox state access to the CComponentTester class under test.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_UnitTestContext is fully constructed, and initialised.
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext(CDataLogger& aDataLogger,
sl@0: 										MStateAccessor& aStateAccessor,
sl@0: 										MTransitionObserver& aObserver);
sl@0: 
sl@0: 	/**
sl@0: 		@fn				~CComponentTester_UnitTestContext()
sl@0: 		Intended Usage	: Default Destructor
sl@0: 		@since			7.0
sl@0: 		@pre 			CComponentTester_UnitTestContext is fully constructed.
sl@0: 		@post			CComponentTester_UnitTestContext is fully destroyed
sl@0: 		*/
sl@0: 		virtual inline ~CComponentTester_UnitTestContext();
sl@0: 
sl@0: 	/** The instance of the class under test */
sl@0: 	CComponentTester* iComponentTester;
sl@0: 	/** The data logger for the ComponentTester to use */
sl@0: 	CDataLogger* iDataLogger;
sl@0: 	/** An observer to inform when the test has been completed */
sl@0: 	MComponentTestObserver* iObserver;
sl@0: 	/** The unit test for the ComponentTester to use */
sl@0: 	CUnitTest* iUnitTest;
sl@0: 	/** An array of the tests to be run by ComponentTester */
sl@0: 	RPointerArray<TTestInfo> iTests;
sl@0: 	/** A class derived from the class under test */
sl@0: 	CComponentTesterTestDerivation* iComponentUnderTest;
sl@0: 	}; // CComponentTester_UnitTestContext
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::NewL method.
sl@0:  */
sl@0: class CComponentTester_NewL_Transition : public CTransitionType
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_NewL_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_NewL_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_NewL_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::NewL method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::NewL)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_NewL_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_NewL_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::NewL post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_NewL_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_NewL_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::Dtor method.
sl@0:  */
sl@0: class CComponentTester_Dtor_Transition : public CTransition
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_Dtor_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_Dtor_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_Dtor_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::Dtor method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::Dtor)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_Dtor_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_Dtor_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::Dtor post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_Dtor_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_Dtor_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::TransitionSetsL method.
sl@0:  */
sl@0: class CComponentTester_TransitionSetsL_Transition : public CTransitionType
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_TransitionSetsL_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_TransitionSetsL_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_TransitionSetsL_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::TransitionSetsL method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::TransitionSetsL)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_TransitionSetsL_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_TransitionSetsL_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::TransitionSetsL post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_TransitionSetsL_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_TransitionSetsL_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::AddUnitTestL method.
sl@0:  */
sl@0: class CComponentTester_AddUnitTestL_Transition : public CTransitionType
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_AddUnitTestL_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_AddUnitTestL_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_AddUnitTestL_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::AddUnitTestL method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::AddUnitTestL)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_AddUnitTestL_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_AddUnitTestL_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::AddUnitTestL post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_AddUnitTestL_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_AddUnitTestL_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::AddParamUnitTestL method.
sl@0:  */
sl@0: class CComponentTester_AddParamUnitTestL_Transition : public CTransitionType
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_AddParamUnitTestL_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_AddParamUnitTestL_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_AddParamUnitTestL_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::AddParamUnitTestL method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::AddParamUnitTestL)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_AddParamUnitTestL_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_AddParamUnitTestL_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::AddParamUnitTestL post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_AddParamUnitTestL_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_AddParamUnitTestL_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 	
sl@0: 	Comments : Transition test of the CComponentTester::TestComponent method.
sl@0:  */
sl@0: class CComponentTester_TestComponent_Transition : public CTransition
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_TestComponent_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_TestComponent_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_TestComponent_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::TestComponent method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::TestComponent)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_TestComponent_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_TestComponent_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::TestComponent post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_TestComponent_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_TestComponent_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::RunL method.
sl@0:  */
sl@0: class CComponentTester_RunL_Transition : public CTransitionType
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_RunL_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_RunL_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_RunL_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::RunL method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::RunL)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_RunL_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_RunL_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::RunL post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_RunL_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_RunL_Transition
sl@0: 
sl@0: // ______________________________________________________________________________
sl@0: //
sl@0: /**
sl@0: 	@internalComponent
sl@0: 
sl@0: 	Comments : Transition test of the CComponentTester::Complete method.
sl@0:  */
sl@0: class CComponentTester_Complete_Transition : public CTransition
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 		@fn				CComponentTester_Complete_Transition(CUnitTestContext& aUTContext,
sl@0: 																	TTransitionValidator& aValidator)
sl@0: 		Intended Usage	: Standard c'tor method.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@param			aUTContext The context this transition is operating in.
sl@0: 		@param			aValidator Used for checking the pre & post conditions of the test object.
sl@0: 		@pre 			None.
sl@0: 		@post			CComponentTester_Complete_Transition is fully constructed.
sl@0: 	*/
sl@0: 	CComponentTester_Complete_Transition(CUnitTestContext& aUTContext,
sl@0: 													TTransitionValidator& aValidator);
sl@0: 	/**
sl@0: 		@fn				TransitMethodL()
sl@0: 		Intended Usage	: To execute the CComponentTester::Complete method for the test harness.
sl@0: 		Error Condition	: Leaves with an error code.
sl@0: 		@leave  		KErrNoMemory, (@see CComponentTester::Complete)
sl@0: 		@since			7.0
sl@0: 		@return			None
sl@0: 		@pre 			CComponentTester_Complete_Transition is fully constructed.
sl@0: 		@post			No change in the CComponentTester_Complete_Transition apart
sl@0: 						from iComponentTester, which may have changed state.
sl@0: 						(@see CComponentTester::Complete post-condition) for iComponentTester's new state.
sl@0: 	*/
sl@0: 	inline void TransitMethodL();
sl@0: 
sl@0: 	/**
sl@0: 		@fn				Context() const
sl@0: 		Intended Usage	: To provide access to the unit test context cast to the correct type.
sl@0: 		Error Condition	: None.
sl@0: 		@since			7.0
sl@0: 		@return			The unit test context cast to a CComponentTester_UnitTestContext
sl@0: 		@pre 			iUTContext is a valid CComponentTester_UnitTestContext.
sl@0: 		@post			No change in the CComponentTester_Complete_Transition
sl@0: 	*/
sl@0: 	inline CComponentTester_UnitTestContext& Context() const;
sl@0: 	};	// CComponentTester_Complete_Transition
sl@0: 
sl@0: 
sl@0: // Add additional Transition class definitions here...
sl@0: 
sl@0: #include "ComponentTesterTransitions.inl"
sl@0: 
sl@0: #include "ComponentTesterUnitTestContext.inl"
sl@0: 
sl@0: #endif // __COMPONENTTESTERTRANSITIONS_H__
sl@0: