lowlevellibsandfws/pluginfw/Framework/FrameTests/MagicTransitionValidation.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 // Definitions for the transition validation classes for ECom
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __EXAMPLEINTERFACETRANSITIONVALIDATION_H__
       
    19 #define __EXAMPLEINTERFACETRANSITIONVALIDATION_H__
       
    20 
       
    21 #include "MagicTransitions.h"
       
    22 
       
    23 
       
    24 // ______________________________________________________________________________
       
    25 //
       
    26 /**
       
    27 	@internalComponent
       
    28 	Comments : Provide all the CtorUnit Test's specific
       
    29 	validatation for the state of a transition before and after its execution.
       
    30 	on the CExampleInterface test class for a transition.
       
    31  */
       
    32 class TExampleInterface_Ctor_TransitionValidator : public TTransitionValidator
       
    33 	{
       
    34 public:
       
    35 	/**
       
    36 		@fn				TExampleInterface_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
       
    37 		Intended Usage	: Default constructor
       
    38 		@leave			KErrNoMemory
       
    39 		@since			7.0
       
    40 		@param			aUTContext The context within which this transition is executing
       
    41 	 */
       
    42 	inline TExampleInterface_Ctor_TransitionValidator(CUnitTestContext& aUTContext);
       
    43 
       
    44 	/**
       
    45 		@fn				ValidatePreConditions()
       
    46 		Intended Usage	: Implemented by the developer to check the
       
    47 						end state of the transition behaviour.
       
    48 		Error Condition	: Invalid pre-conditions
       
    49 		@since			7.0
       
    50 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
    51 		@pre 			TExampleInterface_Ctor_TransitionValidator is fully constructed.
       
    52 		@post			No change to the iUTContext class.
       
    53 	*/
       
    54 	virtual inline TBool ValidatePreConditions();
       
    55 
       
    56 	/**
       
    57 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
    58 		Intended Usage	:	Implemented by the developer to check the
       
    59 						end state of the transition behaviour.
       
    60 						When overriding, if the transition calls an asynchronous function
       
    61 						ValidatePostConditions will be called twice. Firstly, after the
       
    62 						asynchronous function has been called and, secondly, after the 
       
    63 						asynchronous request has completed. The parameter aAsyncState can
       
    64 						be used to distinguish between these two cases.
       
    65 		Error Condition	: Invalid post-conditions.
       
    66 		@since			7.0
       
    67 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
    68 						EAsyncCompleted if the function has completed.
       
    69 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
    70 		@pre 			TExampleInterface_Ctor_TransitionValidator is fully constructed.
       
    71 		@post			No change to the iUTContext class.
       
    72 	*/
       
    73 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
    74 	};	// TExampleInterface_Ctor_TransitionValidator
       
    75 
       
    76 // ______________________________________________________________________________
       
    77 //
       
    78 /**
       
    79 	@internalComponent
       
    80 	Comments : Provide all the DtorUnit Test's specific
       
    81 	validatation for the state of a transition before and after its execution.
       
    82 	on the CExampleInterface test class for a transition.
       
    83  */
       
    84 class TExampleInterface_Dtor_TransitionValidator : public TTransitionValidator
       
    85 	{
       
    86 public:
       
    87 	/**
       
    88 		@fn				TExampleInterface_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
       
    89 		Intended Usage	: Default constructor
       
    90 		@leave			KErrNoMemory
       
    91 		@since			7.0
       
    92 		@param			aUTContext The context within which this transition is executing
       
    93 	 */
       
    94 	inline TExampleInterface_Dtor_TransitionValidator(CUnitTestContext& aUTContext);
       
    95 
       
    96 	/**
       
    97 		@fn				ValidatePreConditions()
       
    98 		Intended Usage	: Implemented by the developer to check the
       
    99 						end state of the transition behaviour.
       
   100 		Error Condition	: Invalid pre-conditions
       
   101 		@since			7.0
       
   102 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   103 		@pre 			TExampleInterface_Dtor_TransitionValidator is fully constructed.
       
   104 		@post			No change to the iUTContext class.
       
   105 	*/
       
   106 	virtual inline TBool ValidatePreConditions();
       
   107 
       
   108 	/**
       
   109 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   110 		Intended Usage	:	Implemented by the developer to check the
       
   111 						end state of the transition behaviour.
       
   112 						When overriding, if the transition calls an asynchronous function
       
   113 						ValidatePostConditions will be called twice. Firstly, after the
       
   114 						asynchronous function has been called and, secondly, after the 
       
   115 						asynchronous request has completed. The parameter aAsyncState can
       
   116 						be used to distinguish between these two cases.
       
   117 		Error Condition	: Invalid post-conditions.
       
   118 		@since			7.0
       
   119 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   120 						EAsyncCompleted if the function has completed.
       
   121 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   122 		@pre 			TExampleInterface_Dtor_TransitionValidator is fully constructed.
       
   123 		@post			No change to the iUTContext class.
       
   124 	*/
       
   125 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   126 	};	// TExampleInterface_Dtor_TransitionValidator
       
   127 
       
   128 // ______________________________________________________________________________
       
   129 //
       
   130 /**
       
   131 	@internalComponent
       
   132 	Comments : Provide all the ListImplementationsUnit Test's specific
       
   133 	validatation for the state of a transition before and after its execution.
       
   134 	on the CExampleInterface test class for a transition.
       
   135  */
       
   136 class TExampleInterface_ListImplementations_TransitionValidator : public TTransitionValidator
       
   137 	{
       
   138 public:
       
   139 	/**
       
   140 		@fn				TExampleInterface_ListImplementations_TransitionValidator(CUnitTestContext& aUTContext)
       
   141 		Intended Usage	:	
       
   142 		@leave  		KErrNoMemory
       
   143 		@since			7.0
       
   144 		@param			aUTContext The context within which this transition is executing
       
   145 	 */
       
   146 	inline TExampleInterface_ListImplementations_TransitionValidator(CUnitTestContext& aUTContext);
       
   147 
       
   148 	/**
       
   149 		@fn				ValidatePreConditions()
       
   150 		Intended Usage	: Implemented by the developer to check the
       
   151 						end state of the transition behaviour.
       
   152 		Error Condition	: Invalid pre-conditions
       
   153 		@since			7.0
       
   154 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   155 		@pre 			TExampleInterface_ListImplementations_TransitionValidator is fully constructed.
       
   156 		@post			No change to the iUTContext class.
       
   157 	*/
       
   158 	virtual inline TBool ValidatePreConditions();
       
   159 
       
   160 	/**
       
   161 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   162 		Intended Usage	:	Implemented by the developer to check the
       
   163 						end state of the transition behaviour.
       
   164 						When overriding, if the transition calls an asynchronous function
       
   165 						ValidatePostConditions will be called twice. Firstly, after the
       
   166 						asynchronous function has been called and, secondly, after the 
       
   167 						asynchronous request has completed. The parameter aAsyncState can
       
   168 						be used to distinguish between these two cases.
       
   169 		Error Condition	: Invalid post-conditions.
       
   170 		@since			7.0
       
   171 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   172 						EAsyncCompleted if the function has completed.
       
   173 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   174 		@pre 			TExampleInterface_ListImplementations_TransitionValidator is fully constructed.
       
   175 		@post			No change to the iUTContext class.
       
   176 	*/
       
   177 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   178 	};	// TExampleInterface_ListImplementations_TransitionValidator
       
   179 
       
   180 // ______________________________________________________________________________
       
   181 //
       
   182 /**
       
   183 	@internalComponent
       
   184 	Comments : Provide all the ListImplementationsUnit Test's specific
       
   185 	validatation for the state of a transition before and after its execution.
       
   186 	on the CExampleInterface test class for a transition.
       
   187 
       
   188  */
       
   189 class TExampleInterface_Default_TransitionValidator : public TTransitionValidator
       
   190 	{
       
   191 public:
       
   192 	/**
       
   193 		@fn				TExampleInterface_Default_TransitionValidator(CUnitTestContext& aUTContext)
       
   194 		Intended Usage	:	
       
   195 		@leave  		KErrNoMemory
       
   196 		@since			7.0
       
   197 		@param			aUTContext The context within which this transition is executing
       
   198 	 */
       
   199 	inline TExampleInterface_Default_TransitionValidator(CUnitTestContext& aUTContext);
       
   200 
       
   201 	/**
       
   202 		@fn				ValidatePreConditions()
       
   203 		Intended Usage	: Implemented by the developer to check the
       
   204 						end state of the transition behaviour.
       
   205 		Error Condition	: Invalid pre-conditions
       
   206 		@since			7.0
       
   207 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   208 		@pre 			TExampleInterface_Default_TransitionValidator is fully constructed.
       
   209 		@post			No change to the iUTContext class.
       
   210 	*/
       
   211 	virtual inline TBool ValidatePreConditions();
       
   212 
       
   213 	/**
       
   214 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   215 		Intended Usage	:	Implemented by the developer to check the
       
   216 						end state of the transition behaviour.
       
   217 						When overriding, if the transition calls an asynchronous function
       
   218 						ValidatePostConditions will be called twice. Firstly, after the
       
   219 						asynchronous function has been called and, secondly, after the 
       
   220 						asynchronous request has completed. The parameter aAsyncState can
       
   221 						be used to distinguish between these two cases.
       
   222 		Error Condition	: Invalid post-conditions.
       
   223 		@since			7.0
       
   224 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   225 						EAsyncCompleted if the function has completed.
       
   226 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   227 		@pre 			TExampleInterface_Default_TransitionValidator is fully constructed.
       
   228 		@post			No change to the iUTContext class.
       
   229 	*/
       
   230 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   231 	};	// TExampleInterface_Default_TransitionValidator
       
   232 
       
   233 
       
   234 #include "MagicTransitionValidation.inl"
       
   235 
       
   236 #endif // __EXAMPLEINTERFACETRANSITIONVALIDATION_H__