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: // This file contains the definitions for sl@0: // the transition classes for testing the sl@0: // CExampleInterface class. sl@0: // sl@0: // sl@0: sl@0: #ifndef __MAGICTRANSITION_H__ sl@0: #define __MAGICTRANSITION_H__ sl@0: sl@0: #include sl@0: #include "LeakTestTransition.h" sl@0: #include "Interface.h" sl@0: sl@0: class CExampleInterface; sl@0: sl@0: #define CTransitionType CLeakTestTransition sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: /** sl@0: Comments : The context in which the transitions will run sl@0: That is to say the container in which the transition sl@0: parameters are passed around sl@0: */ sl@0: class CExampleInterface_UnitTestContext : public CUnitTestContext sl@0: { sl@0: public: sl@0: inline CExampleInterface_UnitTestContext(CDataLogger& aDataLogger, sl@0: MStateAccessor& aAccessor, sl@0: MTransitionObserver& aObserver); sl@0: inline ~CExampleInterface_UnitTestContext(); sl@0: sl@0: CExampleInterface* iExampleInterface; sl@0: CExampleInterface* iSecondExampleInterface; sl@0: RImplInfoPtrArray iImplementations; sl@0: /** An extra thread so that we can use ECom multi-threaded */ sl@0: RThread iListImplThread; sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the NewL method sl@0: */ sl@0: class CExampleInterfaceNewLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceNewLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the NewL method with parameters. sl@0: */ sl@0: class CExampleInterfaceNewWPLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceNewWPLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the NewL method with a match descriptor for resolving. sl@0: */ sl@0: class CExampleInterfaceNewResolveLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceNewResolveLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Special transition which creates two objects sl@0: */ sl@0: class CExampleInterfaceDoubleNewLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceDoubleNewLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the destructor method sl@0: */ sl@0: class CExampleInterfaceDtorTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceDtorTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Special destructor transition which destroys two implementations sl@0: */ sl@0: class CExampleInterfaceDoubleDtorTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceDoubleDtorTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the DoMethodL method sl@0: */ sl@0: class CExampleInterfaceDoMethodLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceDoMethodLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the ListImplementationsL method sl@0: */ sl@0: class CExampleInterfaceListImplementationsLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceListImplementationsLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the ListAllImplementationsL method sl@0: */ sl@0: class CExampleInterfaceListAllImplementationsLTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceListAllImplementationsLTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: /** sl@0: Comments : Transition of the ListAllImplementationsL method which occurs in a separate thread sl@0: */ sl@0: class CExampleInterfaceListImplementationsLNewThreadTransition : public CTransitionType sl@0: { sl@0: public: sl@0: inline CExampleInterfaceListImplementationsLNewThreadTransition( CUnitTestContext& aUTContext, sl@0: TTransitionValidator& aValidator); sl@0: inline void TransitMethodL(); sl@0: inline CExampleInterface_UnitTestContext& Context(); sl@0: }; sl@0: sl@0: #include "MagicTransitions.inl" sl@0: sl@0: #endif // __MAGICLeakTestTransition_H__