os/ossrv/lowlevellibsandfws/pluginfw/Framework/FrameTests/MagicTransitions.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This file contains the definitions for
    15 // the transition classes for testing the
    16 // CExampleInterface class.
    17 // 
    18 //
    19 
    20 #ifndef __MAGICTRANSITION_H__
    21 #define __MAGICTRANSITION_H__
    22 
    23 #include <ecom/test_bed/transition.h>
    24 #include "LeakTestTransition.h"
    25 #include "Interface.h"
    26 
    27 class CExampleInterface;
    28 
    29 #define CTransitionType CLeakTestTransition
    30 
    31 // ______________________________________________________________________________
    32 //
    33 /**
    34 	Comments : The context in which the transitions will run
    35 				That is to say the container in which the transition 
    36 				parameters are passed around
    37  */
    38 class CExampleInterface_UnitTestContext : public CUnitTestContext
    39 	{
    40 public:
    41 	inline CExampleInterface_UnitTestContext(CDataLogger& aDataLogger, 
    42 							  MStateAccessor& aAccessor,
    43 							  MTransitionObserver& aObserver);
    44 	inline ~CExampleInterface_UnitTestContext();
    45 
    46 	CExampleInterface* iExampleInterface;
    47 	CExampleInterface* iSecondExampleInterface;
    48 	RImplInfoPtrArray iImplementations;
    49 	/** An extra thread so that we can use ECom multi-threaded */
    50 	RThread iListImplThread;
    51 	};
    52 
    53 /**
    54 	Comments : Transition of the NewL method
    55  */
    56 class CExampleInterfaceNewLTransition : public CTransitionType
    57 	{
    58 public:
    59 	inline CExampleInterfaceNewLTransition( CUnitTestContext& aUTContext,
    60 											TTransitionValidator& aValidator);
    61 	inline void TransitMethodL();
    62 	inline CExampleInterface_UnitTestContext& Context();
    63 	};
    64 
    65 /**
    66 	Comments : Transition of the NewL method with parameters.
    67  */
    68 class CExampleInterfaceNewWPLTransition : public CTransitionType
    69 	{
    70 public:
    71 	inline CExampleInterfaceNewWPLTransition( CUnitTestContext& aUTContext,
    72 											TTransitionValidator& aValidator);
    73 	inline void TransitMethodL();
    74 	inline CExampleInterface_UnitTestContext& Context();
    75 	};
    76 
    77 /**
    78 	Comments : Transition of the NewL method with a match descriptor for resolving.
    79  */
    80 class CExampleInterfaceNewResolveLTransition : public CTransitionType
    81 	{
    82 public:
    83 	inline CExampleInterfaceNewResolveLTransition( CUnitTestContext& aUTContext,
    84 											TTransitionValidator& aValidator);
    85 	inline void TransitMethodL();
    86 	inline CExampleInterface_UnitTestContext& Context();
    87 	};
    88 
    89 /**
    90 	Comments : Special transition which creates two objects
    91  */
    92 class CExampleInterfaceDoubleNewLTransition : public CTransitionType
    93 	{
    94 public:
    95 	inline CExampleInterfaceDoubleNewLTransition( CUnitTestContext& aUTContext,
    96 											TTransitionValidator& aValidator);
    97 	inline void TransitMethodL();
    98 	inline CExampleInterface_UnitTestContext& Context();
    99 	};
   100 
   101 /**
   102 	Comments : Transition of the destructor method
   103  */
   104 class CExampleInterfaceDtorTransition : public CTransitionType
   105 	{
   106 public:
   107 	inline CExampleInterfaceDtorTransition( CUnitTestContext& aUTContext,
   108 											TTransitionValidator& aValidator);
   109 	inline void TransitMethodL();
   110 	inline CExampleInterface_UnitTestContext& Context();
   111 	};
   112 
   113 /**
   114 	Comments : Special destructor transition which destroys two implementations
   115  */
   116 class CExampleInterfaceDoubleDtorTransition : public CTransitionType
   117 	{
   118 public:
   119 	inline CExampleInterfaceDoubleDtorTransition( CUnitTestContext& aUTContext,
   120 											TTransitionValidator& aValidator);
   121 	inline void TransitMethodL();
   122 	inline CExampleInterface_UnitTestContext& Context();
   123 	};
   124 
   125 /**
   126 	Comments : Transition of the DoMethodL method
   127  */
   128 class CExampleInterfaceDoMethodLTransition : public CTransitionType
   129 	{
   130 public:
   131 	inline CExampleInterfaceDoMethodLTransition( CUnitTestContext& aUTContext,
   132 											TTransitionValidator& aValidator);
   133 	inline void TransitMethodL();
   134 	inline CExampleInterface_UnitTestContext& Context();
   135 	};
   136 
   137 /**
   138 	Comments : Transition of the ListImplementationsL method
   139  */
   140 class CExampleInterfaceListImplementationsLTransition : public CTransitionType
   141 	{
   142 public:
   143 	inline CExampleInterfaceListImplementationsLTransition( CUnitTestContext& aUTContext,
   144 											TTransitionValidator& aValidator);
   145 	inline void TransitMethodL();
   146 	inline CExampleInterface_UnitTestContext& Context();
   147 	};
   148 
   149 /**
   150 	Comments : Transition of the ListAllImplementationsL method
   151  */
   152 class CExampleInterfaceListAllImplementationsLTransition : public CTransitionType
   153 	{
   154 public:
   155 	inline CExampleInterfaceListAllImplementationsLTransition( CUnitTestContext& aUTContext,
   156 											TTransitionValidator& aValidator);
   157 	inline void TransitMethodL();
   158 	inline CExampleInterface_UnitTestContext& Context();
   159 	};
   160 
   161 /**
   162 	Comments : Transition of the ListAllImplementationsL method which occurs in a separate thread
   163  */
   164 class CExampleInterfaceListImplementationsLNewThreadTransition : public CTransitionType
   165 	{
   166 public:
   167 	inline CExampleInterfaceListImplementationsLNewThreadTransition( CUnitTestContext& aUTContext,
   168 											TTransitionValidator& aValidator);
   169 	inline void TransitMethodL();
   170 	inline CExampleInterface_UnitTestContext& Context();
   171 	};
   172 
   173 #include "MagicTransitions.inl"
   174 
   175 #endif	// __MAGICLeakTestTransition_H__