lowlevellibsandfws/pluginfw/Framework/RegistrarTest/RegistrarTransitionValidation.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 // The validation class definitions for the CRegistrar class.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __REGISTRARTRANSITIONVALIDATION_H__
       
    19 #define __REGISTRARTRANSITIONVALIDATION_H__
       
    20 
       
    21 // ______________________________________________________________________________
       
    22 //
       
    23 /**
       
    24 	@internalComponent
       
    25 	Comments : Provide all the CtorUnit Test's specific
       
    26 	validatation for the state of a transition before and after its execution.
       
    27 	on the CRegistrar test class for a transition.
       
    28  */
       
    29 class TRegistrar_Ctor_TransitionValidator : public TTransitionValidator
       
    30 	{
       
    31 public:
       
    32 	/**
       
    33 		@fn				TRegistrar_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
       
    34 		Intended Usage	:	
       
    35 		@leave  		KErrNoMemory
       
    36 		@since			7.0
       
    37 		@param			aUTContext The context within which this transition is executing
       
    38 	 */
       
    39 	inline TRegistrar_Ctor_TransitionValidator(CUnitTestContext& aUTContext);
       
    40 
       
    41 	/**
       
    42 		@fn				ValidatePreConditions()
       
    43 		Intended Usage	: Implemented by the developer to check the
       
    44 						end state of the transition behaviour.
       
    45 		Error Condition	: Invalid pre-conditions
       
    46 		@since			7.0
       
    47 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
    48 		@pre 			TRegistrar_Ctor_TransitionValidator is fully constructed.
       
    49 		@post			No change to the iUTContext class.
       
    50 	*/
       
    51 	virtual inline TBool ValidatePreConditions();
       
    52 
       
    53 	/**
       
    54 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
    55 		Intended Usage	:	Implemented by the developer to check the
       
    56 						end state of the transition behaviour.
       
    57 						When overriding, if the transition calls an asynchronous function
       
    58 						ValidatePostConditions will be called twice. Firstly, after the
       
    59 						asynchronous function has been called and, secondly, after the 
       
    60 						asynchronous request has completed. The parameter aAsyncState can
       
    61 						be used to distinguish between these two cases.
       
    62 		Error Condition	: Invalid post-conditions.
       
    63 		@since			7.0
       
    64 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
    65 						EAsyncCompleted if the function has completed.
       
    66 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
    67 		@pre 			TRegistrar_Ctor_TransitionValidator is fully constructed.
       
    68 		@post			No change to the iUTContext class.
       
    69 	*/
       
    70 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
    71 	};	// TRegistrar_Ctor_TransitionValidator
       
    72 
       
    73 // ______________________________________________________________________________
       
    74 //
       
    75 /**
       
    76 	@internalComponent
       
    77 	Comments : Provide all the DtorUnit Test's specific
       
    78 	validatation for the state of a transition before and after its execution.
       
    79 	on the CRegistrar test class for a transition.
       
    80  */
       
    81 class TRegistrar_Dtor_TransitionValidator : public TTransitionValidator
       
    82 	{
       
    83 public:
       
    84 	/**
       
    85 		@fn				TRegistrar_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
       
    86 		Intended Usage	:	
       
    87 		@leave  		KErrNoMemory
       
    88 		@since			7.0
       
    89 		@param			aUTContext The context within which this transition is executing
       
    90 	 */
       
    91 	inline TRegistrar_Dtor_TransitionValidator(CUnitTestContext& aUTContext);
       
    92 
       
    93 	/**
       
    94 		@fn				ValidatePreConditions()
       
    95 		Intended Usage	: Implemented by the developer to check the
       
    96 						end state of the transition behaviour.
       
    97 		Error Condition	: Invalid pre-conditions
       
    98 		@since			7.0
       
    99 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   100 		@pre 			TRegistrar_Dtor_TransitionValidator is fully constructed.
       
   101 		@post			No change to the iUTContext class.
       
   102 	*/
       
   103 	virtual inline TBool ValidatePreConditions();
       
   104 
       
   105 	/**
       
   106 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   107 		Intended Usage	:	Implemented by the developer to check the
       
   108 						end state of the transition behaviour.
       
   109 						When overriding, if the transition calls an asynchronous function
       
   110 						ValidatePostConditions will be called twice. Firstly, after the
       
   111 						asynchronous function has been called and, secondly, after the 
       
   112 						asynchronous request has completed. The parameter aAsyncState can
       
   113 						be used to distinguish between these two cases.
       
   114 		Error Condition	: Invalid post-conditions.
       
   115 		@since			7.0
       
   116 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   117 						EAsyncCompleted if the function has completed.
       
   118 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   119 		@pre 			TRegistrar_Dtor_TransitionValidator is fully constructed.
       
   120 		@post			No change to the iUTContext class.
       
   121 	*/
       
   122 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   123 	};	// TRegistrar_Dtor_TransitionValidator
       
   124 
       
   125 // ______________________________________________________________________________
       
   126 //
       
   127 /**
       
   128 	@internalComponent
       
   129 	Comments : Provide all the DefaultUnit Test's specific
       
   130 	validatation for the state of a transition before and after its execution.
       
   131 	on the CRegistrar test class for a transition.
       
   132  */
       
   133 class TRegistrar_Default_TransitionValidator : public TTransitionValidator
       
   134 	{
       
   135 public:
       
   136 	/**
       
   137 		@fn				TRegistrar_Default_TransitionValidator(CUnitTestContext& aUTContext)
       
   138 		Intended Usage	:	
       
   139 		@leave  		KErrNoMemory
       
   140 		@since			7.0
       
   141 		@param			aUTContext The context within which this transition is executing
       
   142 	 */
       
   143 	inline TRegistrar_Default_TransitionValidator(CUnitTestContext& aUTContext);
       
   144 
       
   145 	/**
       
   146 		@fn				ValidatePreConditions()
       
   147 		Intended Usage	: Implemented by the developer to check the
       
   148 						end state of the transition behaviour.
       
   149 		Error Condition	: Invalid pre-conditions
       
   150 		@since			7.0
       
   151 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   152 		@pre 			TRegistrar_Default_TransitionValidator is fully constructed.
       
   153 		@post			No change to the iUTContext class.
       
   154 	*/
       
   155 	virtual inline TBool ValidatePreConditions();
       
   156 
       
   157 	/**
       
   158 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   159 		Intended Usage	:	Implemented by the developer to check the
       
   160 						end state of the transition behaviour.
       
   161 						When overriding, if the transition calls an asynchronous function
       
   162 						ValidatePostConditions will be called twice. Firstly, after the
       
   163 						asynchronous function has been called and, secondly, after the 
       
   164 						asynchronous request has completed. The parameter aAsyncState can
       
   165 						be used to distinguish between these two cases.
       
   166 		Error Condition	: Invalid post-conditions.
       
   167 		@since			7.0
       
   168 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   169 						EAsyncCompleted if the function has completed.
       
   170 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   171 		@pre 			TRegistrar_Default_TransitionValidator is fully constructed.
       
   172 		@post			No change to the iUTContext class.
       
   173 	*/
       
   174 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   175 	};	// TRegistrar_Default_TransitionValidator
       
   176 
       
   177 // ______________________________________________________________________________
       
   178 //
       
   179 /**
       
   180 	@internalComponent
       
   181 	Comments : Provide all the RegisterDiscoveryLUnit Test's specific
       
   182 	validatation for the state of a transition before and after its execution.
       
   183 	on the CRegistrar test class for a transition.
       
   184  */
       
   185 class TRegistrar_RegisterDiscoveryL_TransitionValidator : public TTransitionValidator
       
   186 	{
       
   187 public:
       
   188 	/**
       
   189 		@fn				TRegistrar_RegisterDiscoveryL_TransitionValidator(CUnitTestContext& aUTContext)
       
   190 		Intended Usage	:	
       
   191 		@leave  		KErrNoMemory
       
   192 		@since			7.0
       
   193 		@param			aUTContext The context within which this transition is executing
       
   194 	 */
       
   195 	inline TRegistrar_RegisterDiscoveryL_TransitionValidator(CUnitTestContext& aUTContext);
       
   196 
       
   197 	/**
       
   198 		@fn				ValidatePreConditions()
       
   199 		Intended Usage	: Implemented by the developer to check the
       
   200 						end state of the transition behaviour.
       
   201 		Error Condition	: Invalid pre-conditions
       
   202 		@since			7.0
       
   203 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   204 		@pre 			TRegistrar_RegisterDiscoveryL_TransitionValidator is fully constructed.
       
   205 		@post			No change to the iUTContext class.
       
   206 	*/
       
   207 	virtual inline TBool ValidatePreConditions();
       
   208 
       
   209 	/**
       
   210 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   211 		Intended Usage	:	Implemented by the developer to check the
       
   212 						end state of the transition behaviour.
       
   213 						When overriding, if the transition calls an asynchronous function
       
   214 						ValidatePostConditions will be called twice. Firstly, after the
       
   215 						asynchronous function has been called and, secondly, after the 
       
   216 						asynchronous request has completed. The parameter aAsyncState can
       
   217 						be used to distinguish between these two cases.
       
   218 		Error Condition	: Invalid post-conditions.
       
   219 		@since			7.0
       
   220 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   221 						EAsyncCompleted if the function has completed.
       
   222 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   223 		@pre 			TRegistrar_RegisterDiscoveryL_TransitionValidator is fully constructed.
       
   224 		@post			No change to the iUTContext class.
       
   225 	*/
       
   226 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   227 	};	// TRegistrar_RegisterDiscoveryL_TransitionValidator
       
   228 
       
   229 // ______________________________________________________________________________
       
   230 //
       
   231 /**
       
   232 	@internalComponent
       
   233 	Comments : Provide all the DriveRemoved Transition's validatation.
       
   234  */
       
   235 class TRegistrar_DriveRemoved_TransitionValidator : public TTransitionValidator
       
   236 	{
       
   237 public:
       
   238 	/**
       
   239 		@fn				TRegistrar_DriveRemoved_TransitionValidator(CUnitTestContext& aUTContext)
       
   240 		Intended Usage	:	
       
   241 		@leave  		KErrNoMemory
       
   242 		@since			7.0
       
   243 		@param			aUTContext The context within which this transition is executing
       
   244 	 */
       
   245 	inline TRegistrar_DriveRemoved_TransitionValidator(CUnitTestContext& aUTContext);
       
   246 
       
   247 	/**
       
   248 		@fn				ValidatePreConditions()
       
   249 		Intended Usage	: Implemented by the developer to check the
       
   250 						end state of the transition behaviour.
       
   251 		Error Condition	: Invalid pre-conditions
       
   252 		@since			7.0
       
   253 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   254 		@pre 			TRegistrar_DriveRemoved_TransitionValidator is fully constructed.
       
   255 		@post			No change to the iUTContext class.
       
   256 	*/
       
   257 	virtual inline TBool ValidatePreConditions();
       
   258 
       
   259 	/**
       
   260 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   261 		Intended Usage	:	Implemented by the developer to check the
       
   262 						end state of the transition behaviour.
       
   263 						When overriding, if the transition calls an asynchronous function
       
   264 						ValidatePostConditions will be called twice. Firstly, after the
       
   265 						asynchronous function has been called and, secondly, after the 
       
   266 						asynchronous request has completed. The parameter aAsyncState can
       
   267 						be used to distinguish between these two cases.
       
   268 		Error Condition	: Invalid post-conditions.
       
   269 		@since			7.0
       
   270 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   271 						EAsyncCompleted if the function has completed.
       
   272 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   273 		@pre 			TRegistrar_DriveRemoved_TransitionValidator is fully constructed.
       
   274 		@post			No change to the iUTContext class.
       
   275 	*/
       
   276 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   277 	};	// TRegistrar_DriveRemoved_TransitionValidator
       
   278 
       
   279 // ______________________________________________________________________________
       
   280 //
       
   281 /**
       
   282 	@internalComponent 
       
   283 	Comments : Provide all the DriveRemoved Transition's validatation.
       
   284  */
       
   285 class TRegistrar_CheckRegWhileDiscovering_TransitionValidator : public TTransitionValidator
       
   286 	{
       
   287 public:
       
   288 	/**
       
   289 		@fn				TRegistrar_CheckRegWhileDiscovering_TransitionValidator(CUnitTestContext& aUTContext)
       
   290 		Intended Usage	:	
       
   291 		@leave  		KErrNoMemory
       
   292 		@since			7.0
       
   293 		@param			aUTContext The context within which this transition is executing
       
   294 	 */
       
   295 	inline TRegistrar_CheckRegWhileDiscovering_TransitionValidator(CUnitTestContext& aUTContext);
       
   296 
       
   297 	/**
       
   298 		@fn				ValidatePreConditions()
       
   299 		Intended Usage	: Implemented by the developer to check the
       
   300 						end state of the transition behaviour.
       
   301 		Error Condition	: Invalid pre-conditions
       
   302 		@since			7.0
       
   303 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   304 		@pre 			TRegistrar_CheckRegWhileDiscovering_TransitionValidator is fully constructed.
       
   305 		@post			No change to the iUTContext class.
       
   306 	*/
       
   307 	virtual inline TBool ValidatePreConditions();
       
   308 
       
   309 	/**
       
   310 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   311 		Intended Usage	:	Implemented by the developer to check the
       
   312 						end state of the transition behaviour.
       
   313 						When overriding, if the transition calls an asynchronous function
       
   314 						ValidatePostConditions will be called twice. Firstly, after the
       
   315 						asynchronous function has been called and, secondly, after the 
       
   316 						asynchronous request has completed. The parameter aAsyncState can
       
   317 						be used to distinguish between these two cases.
       
   318 		Error Condition	: Invalid post-conditions.
       
   319 		@since			7.0
       
   320 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   321 						EAsyncCompleted if the function has completed.
       
   322 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   323 		@pre 			TRegistrar_CheckRegWhileDiscovering_TransitionValidator is fully constructed.
       
   324 		@post			No change to the iUTContext class.
       
   325 	*/
       
   326 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   327 	};	// TRegistrar_CheckRegWhileDiscovering_TransitionValidator
       
   328 
       
   329 // ______________________________________________________________________________
       
   330 //
       
   331 /**
       
   332 	@internalComponent 
       
   333 	Comments : Provide all the DiscoveriesComplete Transition's validatation.
       
   334  */
       
   335 class TRegistrar_NewLHasContent_TransitionValidator : public TTransitionValidator
       
   336 	{
       
   337 public:
       
   338 	/**
       
   339 		@fn				TRegistrar_NewLHasContent_TransitionValidator(CUnitTestContext& aUTContext)
       
   340 		Intended Usage	:	
       
   341 		@leave  		KErrNoMemory
       
   342 		@since			7.0
       
   343 		@param			aUTContext The context within which this transition is executing
       
   344 	 */
       
   345 	inline TRegistrar_NewLHasContent_TransitionValidator(CUnitTestContext& aUTContext);
       
   346 
       
   347 	/**
       
   348 		@fn				ValidatePreConditions()
       
   349 		Intended Usage	: Implemented by the developer to check the
       
   350 						end state of the transition behaviour.
       
   351 		Error Condition	: Invalid pre-conditions
       
   352 		@since			7.0
       
   353 		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
       
   354 		@pre 			TRegistrar_NewLHasContent_TransitionValidator is fully constructed.
       
   355 		@post			No change to the iUTContext class.
       
   356 	*/
       
   357 	virtual inline TBool ValidatePreConditions();
       
   358 
       
   359 	/**
       
   360 		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
       
   361 		Intended Usage	:	Implemented by the developer to check the
       
   362 						end state of the transition behaviour.
       
   363 						When overriding, if the transition calls an asynchronous function
       
   364 						ValidatePostConditions will be called twice. Firstly, after the
       
   365 						asynchronous function has been called and, secondly, after the 
       
   366 						asynchronous request has completed. The parameter aAsyncState can
       
   367 						be used to distinguish between these two cases.
       
   368 		Error Condition	: Invalid post-conditions.
       
   369 		@since			7.0
       
   370 		@param			aAsyncState EAsyncCalled if the async function has been just been called,
       
   371 						EAsyncCompleted if the function has completed.
       
   372 		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
       
   373 		@pre 			TRegistrar_NewLHasContent_TransitionValidator is fully constructed.
       
   374 		@post			No change to the iUTContext class.
       
   375 	*/
       
   376 	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
       
   377 	};	// TRegistrar_NewLHasContent_TransitionValidator
       
   378 
       
   379 #include "RegistrarTransitionValidation.inl"
       
   380 
       
   381 #endif		// __REGISTRARTRANSITIONVALIDATION_H__