os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistrarTest/RegistrarTransitionValidation.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistrarTest/RegistrarTransitionValidation.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,381 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// The validation class definitions for the CRegistrar class.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __REGISTRARTRANSITIONVALIDATION_H__
    1.22 +#define __REGISTRARTRANSITIONVALIDATION_H__
    1.23 +
    1.24 +// ______________________________________________________________________________
    1.25 +//
    1.26 +/**
    1.27 +	@internalComponent
    1.28 +	Comments : Provide all the CtorUnit Test's specific
    1.29 +	validatation for the state of a transition before and after its execution.
    1.30 +	on the CRegistrar test class for a transition.
    1.31 + */
    1.32 +class TRegistrar_Ctor_TransitionValidator : public TTransitionValidator
    1.33 +	{
    1.34 +public:
    1.35 +	/**
    1.36 +		@fn				TRegistrar_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
    1.37 +		Intended Usage	:	
    1.38 +		@leave  		KErrNoMemory
    1.39 +		@since			7.0
    1.40 +		@param			aUTContext The context within which this transition is executing
    1.41 +	 */
    1.42 +	inline TRegistrar_Ctor_TransitionValidator(CUnitTestContext& aUTContext);
    1.43 +
    1.44 +	/**
    1.45 +		@fn				ValidatePreConditions()
    1.46 +		Intended Usage	: Implemented by the developer to check the
    1.47 +						end state of the transition behaviour.
    1.48 +		Error Condition	: Invalid pre-conditions
    1.49 +		@since			7.0
    1.50 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
    1.51 +		@pre 			TRegistrar_Ctor_TransitionValidator is fully constructed.
    1.52 +		@post			No change to the iUTContext class.
    1.53 +	*/
    1.54 +	virtual inline TBool ValidatePreConditions();
    1.55 +
    1.56 +	/**
    1.57 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
    1.58 +		Intended Usage	:	Implemented by the developer to check the
    1.59 +						end state of the transition behaviour.
    1.60 +						When overriding, if the transition calls an asynchronous function
    1.61 +						ValidatePostConditions will be called twice. Firstly, after the
    1.62 +						asynchronous function has been called and, secondly, after the 
    1.63 +						asynchronous request has completed. The parameter aAsyncState can
    1.64 +						be used to distinguish between these two cases.
    1.65 +		Error Condition	: Invalid post-conditions.
    1.66 +		@since			7.0
    1.67 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
    1.68 +						EAsyncCompleted if the function has completed.
    1.69 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
    1.70 +		@pre 			TRegistrar_Ctor_TransitionValidator is fully constructed.
    1.71 +		@post			No change to the iUTContext class.
    1.72 +	*/
    1.73 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
    1.74 +	};	// TRegistrar_Ctor_TransitionValidator
    1.75 +
    1.76 +// ______________________________________________________________________________
    1.77 +//
    1.78 +/**
    1.79 +	@internalComponent
    1.80 +	Comments : Provide all the DtorUnit Test's specific
    1.81 +	validatation for the state of a transition before and after its execution.
    1.82 +	on the CRegistrar test class for a transition.
    1.83 + */
    1.84 +class TRegistrar_Dtor_TransitionValidator : public TTransitionValidator
    1.85 +	{
    1.86 +public:
    1.87 +	/**
    1.88 +		@fn				TRegistrar_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
    1.89 +		Intended Usage	:	
    1.90 +		@leave  		KErrNoMemory
    1.91 +		@since			7.0
    1.92 +		@param			aUTContext The context within which this transition is executing
    1.93 +	 */
    1.94 +	inline TRegistrar_Dtor_TransitionValidator(CUnitTestContext& aUTContext);
    1.95 +
    1.96 +	/**
    1.97 +		@fn				ValidatePreConditions()
    1.98 +		Intended Usage	: Implemented by the developer to check the
    1.99 +						end state of the transition behaviour.
   1.100 +		Error Condition	: Invalid pre-conditions
   1.101 +		@since			7.0
   1.102 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.103 +		@pre 			TRegistrar_Dtor_TransitionValidator is fully constructed.
   1.104 +		@post			No change to the iUTContext class.
   1.105 +	*/
   1.106 +	virtual inline TBool ValidatePreConditions();
   1.107 +
   1.108 +	/**
   1.109 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.110 +		Intended Usage	:	Implemented by the developer to check the
   1.111 +						end state of the transition behaviour.
   1.112 +						When overriding, if the transition calls an asynchronous function
   1.113 +						ValidatePostConditions will be called twice. Firstly, after the
   1.114 +						asynchronous function has been called and, secondly, after the 
   1.115 +						asynchronous request has completed. The parameter aAsyncState can
   1.116 +						be used to distinguish between these two cases.
   1.117 +		Error Condition	: Invalid post-conditions.
   1.118 +		@since			7.0
   1.119 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.120 +						EAsyncCompleted if the function has completed.
   1.121 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.122 +		@pre 			TRegistrar_Dtor_TransitionValidator is fully constructed.
   1.123 +		@post			No change to the iUTContext class.
   1.124 +	*/
   1.125 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.126 +	};	// TRegistrar_Dtor_TransitionValidator
   1.127 +
   1.128 +// ______________________________________________________________________________
   1.129 +//
   1.130 +/**
   1.131 +	@internalComponent
   1.132 +	Comments : Provide all the DefaultUnit Test's specific
   1.133 +	validatation for the state of a transition before and after its execution.
   1.134 +	on the CRegistrar test class for a transition.
   1.135 + */
   1.136 +class TRegistrar_Default_TransitionValidator : public TTransitionValidator
   1.137 +	{
   1.138 +public:
   1.139 +	/**
   1.140 +		@fn				TRegistrar_Default_TransitionValidator(CUnitTestContext& aUTContext)
   1.141 +		Intended Usage	:	
   1.142 +		@leave  		KErrNoMemory
   1.143 +		@since			7.0
   1.144 +		@param			aUTContext The context within which this transition is executing
   1.145 +	 */
   1.146 +	inline TRegistrar_Default_TransitionValidator(CUnitTestContext& aUTContext);
   1.147 +
   1.148 +	/**
   1.149 +		@fn				ValidatePreConditions()
   1.150 +		Intended Usage	: Implemented by the developer to check the
   1.151 +						end state of the transition behaviour.
   1.152 +		Error Condition	: Invalid pre-conditions
   1.153 +		@since			7.0
   1.154 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.155 +		@pre 			TRegistrar_Default_TransitionValidator is fully constructed.
   1.156 +		@post			No change to the iUTContext class.
   1.157 +	*/
   1.158 +	virtual inline TBool ValidatePreConditions();
   1.159 +
   1.160 +	/**
   1.161 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.162 +		Intended Usage	:	Implemented by the developer to check the
   1.163 +						end state of the transition behaviour.
   1.164 +						When overriding, if the transition calls an asynchronous function
   1.165 +						ValidatePostConditions will be called twice. Firstly, after the
   1.166 +						asynchronous function has been called and, secondly, after the 
   1.167 +						asynchronous request has completed. The parameter aAsyncState can
   1.168 +						be used to distinguish between these two cases.
   1.169 +		Error Condition	: Invalid post-conditions.
   1.170 +		@since			7.0
   1.171 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.172 +						EAsyncCompleted if the function has completed.
   1.173 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.174 +		@pre 			TRegistrar_Default_TransitionValidator is fully constructed.
   1.175 +		@post			No change to the iUTContext class.
   1.176 +	*/
   1.177 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.178 +	};	// TRegistrar_Default_TransitionValidator
   1.179 +
   1.180 +// ______________________________________________________________________________
   1.181 +//
   1.182 +/**
   1.183 +	@internalComponent
   1.184 +	Comments : Provide all the RegisterDiscoveryLUnit Test's specific
   1.185 +	validatation for the state of a transition before and after its execution.
   1.186 +	on the CRegistrar test class for a transition.
   1.187 + */
   1.188 +class TRegistrar_RegisterDiscoveryL_TransitionValidator : public TTransitionValidator
   1.189 +	{
   1.190 +public:
   1.191 +	/**
   1.192 +		@fn				TRegistrar_RegisterDiscoveryL_TransitionValidator(CUnitTestContext& aUTContext)
   1.193 +		Intended Usage	:	
   1.194 +		@leave  		KErrNoMemory
   1.195 +		@since			7.0
   1.196 +		@param			aUTContext The context within which this transition is executing
   1.197 +	 */
   1.198 +	inline TRegistrar_RegisterDiscoveryL_TransitionValidator(CUnitTestContext& aUTContext);
   1.199 +
   1.200 +	/**
   1.201 +		@fn				ValidatePreConditions()
   1.202 +		Intended Usage	: Implemented by the developer to check the
   1.203 +						end state of the transition behaviour.
   1.204 +		Error Condition	: Invalid pre-conditions
   1.205 +		@since			7.0
   1.206 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.207 +		@pre 			TRegistrar_RegisterDiscoveryL_TransitionValidator is fully constructed.
   1.208 +		@post			No change to the iUTContext class.
   1.209 +	*/
   1.210 +	virtual inline TBool ValidatePreConditions();
   1.211 +
   1.212 +	/**
   1.213 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.214 +		Intended Usage	:	Implemented by the developer to check the
   1.215 +						end state of the transition behaviour.
   1.216 +						When overriding, if the transition calls an asynchronous function
   1.217 +						ValidatePostConditions will be called twice. Firstly, after the
   1.218 +						asynchronous function has been called and, secondly, after the 
   1.219 +						asynchronous request has completed. The parameter aAsyncState can
   1.220 +						be used to distinguish between these two cases.
   1.221 +		Error Condition	: Invalid post-conditions.
   1.222 +		@since			7.0
   1.223 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.224 +						EAsyncCompleted if the function has completed.
   1.225 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.226 +		@pre 			TRegistrar_RegisterDiscoveryL_TransitionValidator is fully constructed.
   1.227 +		@post			No change to the iUTContext class.
   1.228 +	*/
   1.229 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.230 +	};	// TRegistrar_RegisterDiscoveryL_TransitionValidator
   1.231 +
   1.232 +// ______________________________________________________________________________
   1.233 +//
   1.234 +/**
   1.235 +	@internalComponent
   1.236 +	Comments : Provide all the DriveRemoved Transition's validatation.
   1.237 + */
   1.238 +class TRegistrar_DriveRemoved_TransitionValidator : public TTransitionValidator
   1.239 +	{
   1.240 +public:
   1.241 +	/**
   1.242 +		@fn				TRegistrar_DriveRemoved_TransitionValidator(CUnitTestContext& aUTContext)
   1.243 +		Intended Usage	:	
   1.244 +		@leave  		KErrNoMemory
   1.245 +		@since			7.0
   1.246 +		@param			aUTContext The context within which this transition is executing
   1.247 +	 */
   1.248 +	inline TRegistrar_DriveRemoved_TransitionValidator(CUnitTestContext& aUTContext);
   1.249 +
   1.250 +	/**
   1.251 +		@fn				ValidatePreConditions()
   1.252 +		Intended Usage	: Implemented by the developer to check the
   1.253 +						end state of the transition behaviour.
   1.254 +		Error Condition	: Invalid pre-conditions
   1.255 +		@since			7.0
   1.256 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.257 +		@pre 			TRegistrar_DriveRemoved_TransitionValidator is fully constructed.
   1.258 +		@post			No change to the iUTContext class.
   1.259 +	*/
   1.260 +	virtual inline TBool ValidatePreConditions();
   1.261 +
   1.262 +	/**
   1.263 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.264 +		Intended Usage	:	Implemented by the developer to check the
   1.265 +						end state of the transition behaviour.
   1.266 +						When overriding, if the transition calls an asynchronous function
   1.267 +						ValidatePostConditions will be called twice. Firstly, after the
   1.268 +						asynchronous function has been called and, secondly, after the 
   1.269 +						asynchronous request has completed. The parameter aAsyncState can
   1.270 +						be used to distinguish between these two cases.
   1.271 +		Error Condition	: Invalid post-conditions.
   1.272 +		@since			7.0
   1.273 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.274 +						EAsyncCompleted if the function has completed.
   1.275 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.276 +		@pre 			TRegistrar_DriveRemoved_TransitionValidator is fully constructed.
   1.277 +		@post			No change to the iUTContext class.
   1.278 +	*/
   1.279 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.280 +	};	// TRegistrar_DriveRemoved_TransitionValidator
   1.281 +
   1.282 +// ______________________________________________________________________________
   1.283 +//
   1.284 +/**
   1.285 +	@internalComponent 
   1.286 +	Comments : Provide all the DriveRemoved Transition's validatation.
   1.287 + */
   1.288 +class TRegistrar_CheckRegWhileDiscovering_TransitionValidator : public TTransitionValidator
   1.289 +	{
   1.290 +public:
   1.291 +	/**
   1.292 +		@fn				TRegistrar_CheckRegWhileDiscovering_TransitionValidator(CUnitTestContext& aUTContext)
   1.293 +		Intended Usage	:	
   1.294 +		@leave  		KErrNoMemory
   1.295 +		@since			7.0
   1.296 +		@param			aUTContext The context within which this transition is executing
   1.297 +	 */
   1.298 +	inline TRegistrar_CheckRegWhileDiscovering_TransitionValidator(CUnitTestContext& aUTContext);
   1.299 +
   1.300 +	/**
   1.301 +		@fn				ValidatePreConditions()
   1.302 +		Intended Usage	: Implemented by the developer to check the
   1.303 +						end state of the transition behaviour.
   1.304 +		Error Condition	: Invalid pre-conditions
   1.305 +		@since			7.0
   1.306 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.307 +		@pre 			TRegistrar_CheckRegWhileDiscovering_TransitionValidator is fully constructed.
   1.308 +		@post			No change to the iUTContext class.
   1.309 +	*/
   1.310 +	virtual inline TBool ValidatePreConditions();
   1.311 +
   1.312 +	/**
   1.313 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.314 +		Intended Usage	:	Implemented by the developer to check the
   1.315 +						end state of the transition behaviour.
   1.316 +						When overriding, if the transition calls an asynchronous function
   1.317 +						ValidatePostConditions will be called twice. Firstly, after the
   1.318 +						asynchronous function has been called and, secondly, after the 
   1.319 +						asynchronous request has completed. The parameter aAsyncState can
   1.320 +						be used to distinguish between these two cases.
   1.321 +		Error Condition	: Invalid post-conditions.
   1.322 +		@since			7.0
   1.323 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.324 +						EAsyncCompleted if the function has completed.
   1.325 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.326 +		@pre 			TRegistrar_CheckRegWhileDiscovering_TransitionValidator is fully constructed.
   1.327 +		@post			No change to the iUTContext class.
   1.328 +	*/
   1.329 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.330 +	};	// TRegistrar_CheckRegWhileDiscovering_TransitionValidator
   1.331 +
   1.332 +// ______________________________________________________________________________
   1.333 +//
   1.334 +/**
   1.335 +	@internalComponent 
   1.336 +	Comments : Provide all the DiscoveriesComplete Transition's validatation.
   1.337 + */
   1.338 +class TRegistrar_NewLHasContent_TransitionValidator : public TTransitionValidator
   1.339 +	{
   1.340 +public:
   1.341 +	/**
   1.342 +		@fn				TRegistrar_NewLHasContent_TransitionValidator(CUnitTestContext& aUTContext)
   1.343 +		Intended Usage	:	
   1.344 +		@leave  		KErrNoMemory
   1.345 +		@since			7.0
   1.346 +		@param			aUTContext The context within which this transition is executing
   1.347 +	 */
   1.348 +	inline TRegistrar_NewLHasContent_TransitionValidator(CUnitTestContext& aUTContext);
   1.349 +
   1.350 +	/**
   1.351 +		@fn				ValidatePreConditions()
   1.352 +		Intended Usage	: Implemented by the developer to check the
   1.353 +						end state of the transition behaviour.
   1.354 +		Error Condition	: Invalid pre-conditions
   1.355 +		@since			7.0
   1.356 +		@return			TBool ETrue if the pre-conditions were valid, EFalse otherwise.
   1.357 +		@pre 			TRegistrar_NewLHasContent_TransitionValidator is fully constructed.
   1.358 +		@post			No change to the iUTContext class.
   1.359 +	*/
   1.360 +	virtual inline TBool ValidatePreConditions();
   1.361 +
   1.362 +	/**
   1.363 +		@fn				ValidatePostConditions(TTestBedAsyncState aAsyncState)
   1.364 +		Intended Usage	:	Implemented by the developer to check the
   1.365 +						end state of the transition behaviour.
   1.366 +						When overriding, if the transition calls an asynchronous function
   1.367 +						ValidatePostConditions will be called twice. Firstly, after the
   1.368 +						asynchronous function has been called and, secondly, after the 
   1.369 +						asynchronous request has completed. The parameter aAsyncState can
   1.370 +						be used to distinguish between these two cases.
   1.371 +		Error Condition	: Invalid post-conditions.
   1.372 +		@since			7.0
   1.373 +		@param			aAsyncState EAsyncCalled if the async function has been just been called,
   1.374 +						EAsyncCompleted if the function has completed.
   1.375 +		@return			TBool ETrue if the post-conditions were valid, EFalse otherwise.
   1.376 +		@pre 			TRegistrar_NewLHasContent_TransitionValidator is fully constructed.
   1.377 +		@post			No change to the iUTContext class.
   1.378 +	*/
   1.379 +	virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
   1.380 +	};	// TRegistrar_NewLHasContent_TransitionValidator
   1.381 +
   1.382 +#include "RegistrarTransitionValidation.inl"
   1.383 +
   1.384 +#endif		// __REGISTRARTRANSITIONVALIDATION_H__