os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitions.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitions.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,301 @@
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 implementation of the transition classes upon the CUnitTest class methods.
1.18 +//
1.19 +//
1.20 +
1.21 +// ______________________________________________________________________________
1.22 +//
1.23 +_LIT(KUnitTestNewLTransition,"CUnitTest_NewL_Transition");
1.24 +
1.25 +inline CUnitTest_NewL_Transition::CUnitTest_NewL_Transition(CUnitTestContext& aUTContext,
1.26 + TTransitionValidator& aValidator)
1.27 +: CTransitionType(KUnitTestNewLTransition, aUTContext, aValidator)
1.28 + {
1.29 + // Do nothing here.
1.30 + }
1.31 +
1.32 +inline void CUnitTest_NewL_Transition::TransitMethodL()
1.33 + {
1.34 + _LIT(KUnitTestNewLTransitMethod, "CUnitTest::NewL transition");
1.35 + Context().DataLogger().LogInformation(KUnitTestNewLTransitMethod);
1.36 + TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
1.37 + Context().iUnitTestUnderTest = accessor.CreateUnitTest(*(Context().iUnitTest), *Context().iName, *Context().iDataLogger, *Context().iUnitTestObserver);
1.38 + }
1.39 +
1.40 +inline CUnitTest_UnitTestContext& CUnitTest_NewL_Transition::Context() const
1.41 + {
1.42 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.43 + }
1.44 +
1.45 +// ______________________________________________________________________________
1.46 +//
1.47 +_LIT(KUnitTestDtorTransition,"CUnitTest_Dtor_Transition");
1.48 +
1.49 +inline CUnitTest_Dtor_Transition::CUnitTest_Dtor_Transition(CUnitTestContext& aUTContext,
1.50 + TTransitionValidator& aValidator)
1.51 +: CTransition(KUnitTestDtorTransition, aUTContext, aValidator)
1.52 + {
1.53 + // Do nothing here.
1.54 + }
1.55 +
1.56 +inline void CUnitTest_Dtor_Transition::TransitMethodL()
1.57 + {
1.58 + _LIT(KUnitTestDtorTransitMethod, "CUnitTest::Dtor transition");
1.59 + Context().DataLogger().LogInformation(KUnitTestDtorTransitMethod);
1.60 + delete Context().iUnitTest;
1.61 + Context().iUnitTest = NULL;
1.62 + }
1.63 +
1.64 +inline CUnitTest_UnitTestContext& CUnitTest_Dtor_Transition::Context() const
1.65 + {
1.66 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.67 + }
1.68 +
1.69 +// ______________________________________________________________________________
1.70 +//
1.71 +_LIT(KUnitTestTransitionSetLTransition,"CUnitTest_TransitionSetL_Transition");
1.72 +
1.73 +inline CUnitTest_TransitionSetL_Transition::CUnitTest_TransitionSetL_Transition(CUnitTestContext& aUTContext,
1.74 + TTransitionValidator& aValidator)
1.75 +: CTransitionType(KUnitTestTransitionSetLTransition, aUTContext, aValidator)
1.76 + {
1.77 + // Do nothing here.
1.78 + }
1.79 +
1.80 +inline void CUnitTest_TransitionSetL_Transition::TransitMethodL()
1.81 + {
1.82 + _LIT(KUnitTestTransitionSetLTransitMethod, "CUnitTest::TransitionSetL transition");
1.83 + Context().DataLogger().LogInformation(KUnitTestTransitionSetLTransitMethod);
1.84 + Context().iUnitTestUnderTest->TransitionSetL();
1.85 + }
1.86 +
1.87 +inline CUnitTest_UnitTestContext& CUnitTest_TransitionSetL_Transition::Context() const
1.88 + {
1.89 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.90 + }
1.91 +
1.92 +// ______________________________________________________________________________
1.93 +//
1.94 +_LIT(KUnitTestGetCurrentTransitionTransition,"CUnitTest_GetCurrentTransition_Transition");
1.95 +
1.96 +inline CUnitTest_GetCurrentTransition_Transition::CUnitTest_GetCurrentTransition_Transition(CUnitTestContext& aUTContext,
1.97 + TTransitionValidator& aValidator)
1.98 +: CTransition(KUnitTestGetCurrentTransitionTransition, aUTContext, aValidator)
1.99 + {
1.100 + // Do nothing here.
1.101 + }
1.102 +
1.103 +inline void CUnitTest_GetCurrentTransition_Transition::TransitMethodL()
1.104 + {
1.105 + _LIT(KUnitTestGetCurrentTransitionTransitMethod, "CUnitTest::GetCurrentTransition transition");
1.106 + Context().DataLogger().LogInformation(KUnitTestGetCurrentTransitionTransitMethod);
1.107 + /*Context().iCurrentTransition =*/ Context().iUnitTestUnderTest->GetCurrentTransition();
1.108 + }
1.109 +
1.110 +inline CUnitTest_UnitTestContext& CUnitTest_GetCurrentTransition_Transition::Context() const
1.111 + {
1.112 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.113 + }
1.114 +
1.115 +// ______________________________________________________________________________
1.116 +//
1.117 +_LIT(KUnitTestSetCurrentTransitionTransition,"CUnitTest_SetCurrentTransition_Transition");
1.118 +
1.119 +inline CUnitTest_SetCurrentTransition_Transition::CUnitTest_SetCurrentTransition_Transition(CUnitTestContext& aUTContext,
1.120 + TTransitionValidator& aValidator)
1.121 +: CTransition(KUnitTestSetCurrentTransitionTransition, aUTContext, aValidator)
1.122 + {
1.123 + // Do nothing here.
1.124 + }
1.125 +
1.126 +inline void CUnitTest_SetCurrentTransition_Transition::TransitMethodL()
1.127 + {
1.128 + _LIT(KUnitTestSetCurrentTransitionTransitMethod, "CUnitTest::SetCurrentTransition transition");
1.129 + Context().DataLogger().LogInformation(KUnitTestSetCurrentTransitionTransitMethod);
1.130 + Context().iUnitTest->SetCurrentTransition(*(Context().iTransition));
1.131 + }
1.132 +
1.133 +inline CUnitTest_UnitTestContext& CUnitTest_SetCurrentTransition_Transition::Context() const
1.134 + {
1.135 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.136 + }
1.137 +
1.138 +// ______________________________________________________________________________
1.139 +//
1.140 +_LIT(KUnitTestSetParametersLTransition,"CUnitTest_SetParametersL_Transition");
1.141 +
1.142 +inline CUnitTest_SetParametersL_Transition::CUnitTest_SetParametersL_Transition(CUnitTestContext& aUTContext,
1.143 + TTransitionValidator& aValidator)
1.144 +: CTransitionType(KUnitTestSetParametersLTransition, aUTContext, aValidator)
1.145 + {
1.146 + // Do nothing here.
1.147 + }
1.148 +
1.149 +inline void CUnitTest_SetParametersL_Transition::TransitMethodL()
1.150 + {
1.151 + _LIT(KUnitTestSetParametersLTransitMethod, "CUnitTest::SetParametersL transition");
1.152 + Context().DataLogger().LogInformation(KUnitTestSetParametersLTransitMethod);
1.153 + Context().iUnitTest->SetParametersL(Context().iParams);
1.154 + }
1.155 +
1.156 +inline CUnitTest_UnitTestContext& CUnitTest_SetParametersL_Transition::Context() const
1.157 + {
1.158 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.159 + }
1.160 +
1.161 +// ______________________________________________________________________________
1.162 +//
1.163 +_LIT(KUnitTestPrepareUnitTestLTransition,"CUnitTest_PrepareUnitTestL_Transition");
1.164 +
1.165 +inline CUnitTest_PrepareUnitTestL_Transition::CUnitTest_PrepareUnitTestL_Transition(CUnitTestContext& aUTContext,
1.166 + TTransitionValidator& aValidator)
1.167 +: CTransitionType(KUnitTestPrepareUnitTestLTransition, aUTContext, aValidator)
1.168 + {
1.169 + // Do nothing here.
1.170 + }
1.171 +
1.172 +inline void CUnitTest_PrepareUnitTestL_Transition::TransitMethodL()
1.173 + {
1.174 + _LIT(KUnitTestPrepareUnitTestLTransitMethod, "CUnitTest::PrepareUnitTestL transition");
1.175 + Context().DataLogger().LogInformation(KUnitTestPrepareUnitTestLTransitMethod);
1.176 + Context().iUnitTest->PrepareUnitTestL();
1.177 + }
1.178 +
1.179 +inline CUnitTest_UnitTestContext& CUnitTest_PrepareUnitTestL_Transition::Context() const
1.180 + {
1.181 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.182 + }
1.183 +
1.184 +// ______________________________________________________________________________
1.185 +//
1.186 +_LIT(KUnitTestRunTestTransition,"CUnitTest_RunTest_Transition");
1.187 +
1.188 +inline CUnitTest_RunTest_Transition::CUnitTest_RunTest_Transition(CUnitTestContext& aUTContext,
1.189 + TTransitionValidator& aValidator)
1.190 +: CTransition(KUnitTestRunTestTransition, aUTContext, aValidator)
1.191 + {
1.192 + // Do nothing here.
1.193 + }
1.194 +
1.195 +inline void CUnitTest_RunTest_Transition::TransitMethodL()
1.196 + {
1.197 + _LIT(KUnitTestRunTestTransitMethod, "CUnitTest::RunTest transition");
1.198 + Context().DataLogger().LogInformation(KUnitTestRunTestTransitMethod);
1.199 + Context().iUnitTest->RunTest(Context().iTimeAfter);
1.200 + }
1.201 +
1.202 +inline CUnitTest_UnitTestContext& CUnitTest_RunTest_Transition::Context() const
1.203 + {
1.204 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.205 + }
1.206 +
1.207 +// ______________________________________________________________________________
1.208 +//
1.209 +_LIT(KUnitTestAddTransitionLTransition,"CUnitTest_AddTransitionL_Transition");
1.210 +
1.211 +inline CUnitTest_AddTransitionL_Transition::CUnitTest_AddTransitionL_Transition(CUnitTestContext& aUTContext,
1.212 + TTransitionValidator& aValidator)
1.213 +: CTransitionType(KUnitTestAddTransitionLTransition, aUTContext, aValidator)
1.214 + {
1.215 + // Do nothing here.
1.216 + }
1.217 +
1.218 +inline void CUnitTest_AddTransitionL_Transition::TransitMethodL()
1.219 + {
1.220 + _LIT(KUnitTestAddTransitionLTransitMethod, "CUnitTest::AddTransitionL transition");
1.221 + Context().DataLogger().LogInformation(KUnitTestAddTransitionLTransitMethod);
1.222 + TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
1.223 + accessor.AddTransitionL(*(Context().iUnitTest), (Context().iTransition));
1.224 + }
1.225 +
1.226 +inline CUnitTest_UnitTestContext& CUnitTest_AddTransitionL_Transition::Context() const
1.227 + {
1.228 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.229 + }
1.230 +
1.231 +// ______________________________________________________________________________
1.232 +//
1.233 +_LIT(KUnitTestAddBlockingTransitionLTransition,"CUnitTest_AddBlockingTransitionL_Transition");
1.234 +
1.235 +inline CUnitTest_AddBlockingTransitionL_Transition::CUnitTest_AddBlockingTransitionL_Transition(CUnitTestContext& aUTContext,
1.236 + TTransitionValidator& aValidator)
1.237 +: CTransitionType(KUnitTestAddBlockingTransitionLTransition, aUTContext, aValidator)
1.238 + {
1.239 + // Do nothing here.
1.240 + }
1.241 +
1.242 +inline void CUnitTest_AddBlockingTransitionL_Transition::TransitMethodL()
1.243 + {
1.244 + _LIT(KUnitTestAddBlockingTransitionLTransitMethod, "CUnitTest::AddBlockingTransitionL transition");
1.245 + Context().DataLogger().LogInformation(KUnitTestAddBlockingTransitionLTransitMethod);
1.246 + TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
1.247 + accessor.AddBlockingTransitionL(*(Context().iUnitTest), (Context().iTransition));
1.248 + }
1.249 +
1.250 +inline CUnitTest_UnitTestContext& CUnitTest_AddBlockingTransitionL_Transition::Context() const
1.251 + {
1.252 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.253 + }
1.254 +
1.255 +// ______________________________________________________________________________
1.256 +//
1.257 +_LIT(KUnitTestAddLeaveErrorCodeLTransition,"CUnitTest_AddLeaveErrorCodeL_Transition");
1.258 +
1.259 +inline CUnitTest_AddLeaveErrorCodeL_Transition::CUnitTest_AddLeaveErrorCodeL_Transition(CUnitTestContext& aUTContext,
1.260 + TTransitionValidator& aValidator)
1.261 +: CTransitionType(KUnitTestAddLeaveErrorCodeLTransition, aUTContext, aValidator)
1.262 + {
1.263 + // Do nothing here.
1.264 + }
1.265 +
1.266 +inline void CUnitTest_AddLeaveErrorCodeL_Transition::TransitMethodL()
1.267 + {
1.268 + _LIT(KUnitTestAddLeaveErrorCodeLTransitMethod, "CUnitTest::AddLeaveErrorCodeL transition");
1.269 + Context().DataLogger().LogInformation(KUnitTestAddLeaveErrorCodeLTransitMethod);
1.270 + TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
1.271 + accessor.AddLeaveErrorCodeL(*(Context().iUnitTest), (Context().iLeaveErrorCode));
1.272 + }
1.273 +
1.274 +inline CUnitTest_UnitTestContext& CUnitTest_AddLeaveErrorCodeL_Transition::Context() const
1.275 + {
1.276 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.277 + }
1.278 +
1.279 +// ______________________________________________________________________________
1.280 +//
1.281 +_LIT(KUnitTestUnitTestNameTransition,"CUnitTest_UnitTestName_Transition");
1.282 +
1.283 +inline CUnitTest_UnitTestName_Transition::CUnitTest_UnitTestName_Transition(CUnitTestContext& aUTContext,
1.284 + TTransitionValidator& aValidator)
1.285 +: CTransition(KUnitTestUnitTestNameTransition, aUTContext, aValidator)
1.286 + {
1.287 + // Do nothing here.
1.288 + }
1.289 +
1.290 +inline void CUnitTest_UnitTestName_Transition::TransitMethodL()
1.291 + {
1.292 + _LIT(KUnitTestUnitTestNameTransitMethod, "CUnitTest::UnitTestName transition");
1.293 + Context().DataLogger().LogInformation(KUnitTestUnitTestNameTransitMethod);
1.294 + Context().iUnitTest->UnitTestName();
1.295 + }
1.296 +
1.297 +inline CUnitTest_UnitTestContext& CUnitTest_UnitTestName_Transition::Context() const
1.298 + {
1.299 + return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
1.300 + }
1.301 +
1.302 +
1.303 +// Add additional Transition class Implementations here...
1.304 +