os/ossrv/lowlevellibsandfws/pluginfw/Framework/SuicideTests/SuicideTransitionValidation.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/SuicideTests/SuicideTransitionValidation.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,185 @@
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 +// Definitions for the transition validation classes for ECom
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __SUICIDEINTERFACETRANSITIONVALIDATION_H__
1.22 +#define __SUICIDEINTERFACETRANSITIONVALIDATION_H__
1.23 +
1.24 +#include "SuicideTransitions.h"
1.25 +
1.26 +
1.27 +// ______________________________________________________________________________
1.28 +//
1.29 +/**
1.30 + @internalComponent
1.31 +
1.32 + Comments : Provide all the CtorUnit Test's specific
1.33 + validatation for the state of a transition before and after its execution.
1.34 + on the sucicidal CExampleInterface test class for a transition.
1.35 + */
1.36 +class TSuicideInterface_Ctor_TransitionValidator : public TTransitionValidator
1.37 + {
1.38 +public:
1.39 + /**
1.40 + @fn TSuicideInterface_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
1.41 + Intended Usage : Default constructor
1.42 + @leave KErrNoMemory
1.43 + @since 7.0
1.44 + @param aUTContext The context within which this transition is executing
1.45 + */
1.46 + inline TSuicideInterface_Ctor_TransitionValidator(CUnitTestContext& aUTContext);
1.47 +
1.48 + /**
1.49 + @fn ValidatePreConditions()
1.50 + Intended Usage : Implemented by the developer to check the
1.51 + end state of the transition behaviour.
1.52 + Error Condition : Invalid pre-conditions
1.53 + @since 7.0
1.54 + @return TBool ETrue if the pre-conditions were valid, EFalse otherwise.
1.55 + @pre TSuicideInterface_Ctor_TransitionValidator is fully constructed.
1.56 + @post No change to the iUTContext class.
1.57 + */
1.58 + virtual inline TBool ValidatePreConditions();
1.59 +
1.60 + /**
1.61 + @fn ValidatePostConditions(TTestBedAsyncState aAsyncState)
1.62 + Intended Usage : Implemented by the developer to check the
1.63 + end state of the transition behaviour.
1.64 + When overriding, if the transition calls an asynchronous function
1.65 + ValidatePostConditions will be called twice. Firstly, after the
1.66 + asynchronous function has been called and, secondly, after the
1.67 + asynchronous request has completed. The parameter aAsyncState can
1.68 + be used to distinguish between these two cases.
1.69 + Error Condition : Invalid post-conditions.
1.70 + @since 7.0
1.71 + @param aAsyncState EAsyncCalled if the async function has been just been called,
1.72 + EAsyncCompleted if the function has completed.
1.73 + @return TBool ETrue if the post-conditions were valid, EFalse otherwise.
1.74 + @pre TSuicideInterface_Ctor_TransitionValidator is fully constructed.
1.75 + @post No change to the iUTContext class.
1.76 + */
1.77 + virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
1.78 + }; // TSuicideInterface_Ctor_TransitionValidator
1.79 +
1.80 +// ______________________________________________________________________________
1.81 +//
1.82 +/**
1.83 + @internalComponent
1.84 +
1.85 + Comments : Provide all the DtorUnit Test's specific
1.86 + validatation for the state of a transition before and after its execution.
1.87 + on the suicidal CExampleInterface test class for a transition.
1.88 + */
1.89 +class TSuicideInterface_Dtor_TransitionValidator : public TTransitionValidator
1.90 + {
1.91 +public:
1.92 + /**
1.93 + @fn TSuicideInterface_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
1.94 + Intended Usage : Default constructor
1.95 + @leave KErrNoMemory
1.96 + @since 7.0
1.97 + @param aUTContext The context within which this transition is executing
1.98 + */
1.99 + inline TSuicideInterface_Dtor_TransitionValidator(CUnitTestContext& aUTContext);
1.100 +
1.101 + /**
1.102 + @fn ValidatePreConditions()
1.103 + Intended Usage : Implemented by the developer to check the
1.104 + end state of the transition behaviour.
1.105 + Error Condition : Invalid pre-conditions
1.106 + @since 7.0
1.107 + @return TBool ETrue if the pre-conditions were valid, EFalse otherwise.
1.108 + @pre TSuicideInterface_Dtor_TransitionValidator is fully constructed.
1.109 + @post No change to the iUTContext class.
1.110 + */
1.111 + virtual inline TBool ValidatePreConditions();
1.112 +
1.113 + /**
1.114 + @fn ValidatePostConditions(TTestBedAsyncState aAsyncState)
1.115 + Intended Usage : Implemented by the developer to check the
1.116 + end state of the transition behaviour.
1.117 + When overriding, if the transition calls an asynchronous function
1.118 + ValidatePostConditions will be called twice. Firstly, after the
1.119 + asynchronous function has been called and, secondly, after the
1.120 + asynchronous request has completed. The parameter aAsyncState can
1.121 + be used to distinguish between these two cases.
1.122 + Error Condition : Invalid post-conditions.
1.123 + @since 7.0
1.124 + @param aAsyncState EAsyncCalled if the async function has been just been called,
1.125 + EAsyncCompleted if the function has completed.
1.126 + @return TBool ETrue if the post-conditions were valid, EFalse otherwise.
1.127 + @pre TSuicideInterface_Dtor_TransitionValidator is fully constructed.
1.128 + @post No change to the iUTContext class.
1.129 + */
1.130 + virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
1.131 + }; // TSuicideInterface_Dtor_TransitionValidator
1.132 +
1.133 +// ______________________________________________________________________________
1.134 +//
1.135 +/**
1.136 + @internalComponent
1.137 +
1.138 + Comments : Provide all the FireAndForgetUnit Test's specific
1.139 + validatation for the state of a transition before and after its execution.
1.140 + on the suicidal CExampleInterface test class for a transition.
1.141 + */
1.142 +class TSuicideInterface_FireAndForget_TransitionValidator : public TTransitionValidator
1.143 + {
1.144 +public:
1.145 + /**
1.146 + @fn TSuicideInterface_FireAndForget_TransitionValidator(CUnitTestContext& aUTContext)
1.147 + Intended Usage :
1.148 + @leave KErrNoMemory
1.149 + @since 7.0
1.150 + @param aUTContext The context within which this transition is executing
1.151 + */
1.152 + inline TSuicideInterface_FireAndForget_TransitionValidator(CUnitTestContext& aUTContext);
1.153 +
1.154 + /**
1.155 + @fn ValidatePreConditions()
1.156 + Intended Usage : Implemented by the developer to check the
1.157 + end state of the transition behaviour.
1.158 + Error Condition : Invalid pre-conditions
1.159 + @since 7.0
1.160 + @return TBool ETrue if the pre-conditions were valid, EFalse otherwise.
1.161 + @pre TSuicideInterface_FireAndForget_TransitionValidator is fully constructed.
1.162 + @post No change to the iUTContext class.
1.163 + */
1.164 + virtual inline TBool ValidatePreConditions();
1.165 +
1.166 + /**
1.167 + @fn ValidatePostConditions(TTestBedAsyncState aAsyncState)
1.168 + Intended Usage : Implemented by the developer to check the
1.169 + end state of the transition behaviour.
1.170 + When overriding, if the transition calls an asynchronous function
1.171 + ValidatePostConditions will be called twice. Firstly, after the
1.172 + asynchronous function has been called and, secondly, after the
1.173 + asynchronous request has completed. The parameter aAsyncState can
1.174 + be used to distinguish between these two cases.
1.175 + Error Condition : Invalid post-conditions.
1.176 + @since 7.0
1.177 + @param aAsyncState EAsyncCalled if the async function has been just been called,
1.178 + EAsyncCompleted if the function has completed.
1.179 + @return TBool ETrue if the post-conditions were valid, EFalse otherwise.
1.180 + @pre TSuicideInterface_FireAndForget_TransitionValidator is fully constructed.
1.181 + @post No change to the iUTContext class.
1.182 + */
1.183 + virtual inline TBool ValidatePostConditions(TTestBedAsyncState aAsyncState);
1.184 + }; // TSuicideInterface_FireAndForget_TransitionValidator
1.185 +
1.186 +#include "SuicideTransitionValidation.inl"
1.187 +
1.188 +#endif // __SUICIDEINTERFACETRANSITIONVALIDATION_H__