os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitions.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 implementation of the transition classes upon the CUnitTest class methods.
    15 // 
    16 //
    17 
    18 // ______________________________________________________________________________
    19 //
    20 _LIT(KUnitTestNewLTransition,"CUnitTest_NewL_Transition");
    21 
    22 inline CUnitTest_NewL_Transition::CUnitTest_NewL_Transition(CUnitTestContext& aUTContext,
    23 													TTransitionValidator& aValidator)
    24 : CTransitionType(KUnitTestNewLTransition, aUTContext, aValidator)
    25 	{
    26 	// Do nothing here.
    27 	}
    28 
    29 inline void CUnitTest_NewL_Transition::TransitMethodL()
    30 	{
    31 	_LIT(KUnitTestNewLTransitMethod, "CUnitTest::NewL transition");
    32 	Context().DataLogger().LogInformation(KUnitTestNewLTransitMethod);
    33 	TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
    34 	Context().iUnitTestUnderTest =  accessor.CreateUnitTest(*(Context().iUnitTest), *Context().iName, *Context().iDataLogger, *Context().iUnitTestObserver);
    35 	}
    36 
    37 inline CUnitTest_UnitTestContext& CUnitTest_NewL_Transition::Context() const
    38 	{
    39 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
    40 	}
    41 
    42 // ______________________________________________________________________________
    43 //
    44 _LIT(KUnitTestDtorTransition,"CUnitTest_Dtor_Transition");
    45 
    46 inline CUnitTest_Dtor_Transition::CUnitTest_Dtor_Transition(CUnitTestContext& aUTContext,
    47 													TTransitionValidator& aValidator)
    48 : CTransition(KUnitTestDtorTransition, aUTContext, aValidator)
    49 	{
    50 	// Do nothing here.
    51 	}
    52 
    53 inline void CUnitTest_Dtor_Transition::TransitMethodL()
    54 	{
    55 	_LIT(KUnitTestDtorTransitMethod, "CUnitTest::Dtor transition");
    56 	Context().DataLogger().LogInformation(KUnitTestDtorTransitMethod);
    57 	delete Context().iUnitTest;
    58 	Context().iUnitTest = NULL;
    59 	}
    60 
    61 inline CUnitTest_UnitTestContext& CUnitTest_Dtor_Transition::Context() const
    62 	{
    63 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
    64 	}
    65 
    66 // ______________________________________________________________________________
    67 //
    68 _LIT(KUnitTestTransitionSetLTransition,"CUnitTest_TransitionSetL_Transition");
    69 
    70 inline CUnitTest_TransitionSetL_Transition::CUnitTest_TransitionSetL_Transition(CUnitTestContext& aUTContext,
    71 													TTransitionValidator& aValidator)
    72 : CTransitionType(KUnitTestTransitionSetLTransition, aUTContext, aValidator)
    73 	{
    74 	// Do nothing here.
    75 	}
    76 
    77 inline void CUnitTest_TransitionSetL_Transition::TransitMethodL()
    78 	{
    79 	_LIT(KUnitTestTransitionSetLTransitMethod, "CUnitTest::TransitionSetL transition");
    80 	Context().DataLogger().LogInformation(KUnitTestTransitionSetLTransitMethod);
    81 	Context().iUnitTestUnderTest->TransitionSetL();
    82 	}
    83 
    84 inline CUnitTest_UnitTestContext& CUnitTest_TransitionSetL_Transition::Context() const
    85 	{
    86 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
    87 	}
    88 
    89 // ______________________________________________________________________________
    90 //
    91 _LIT(KUnitTestGetCurrentTransitionTransition,"CUnitTest_GetCurrentTransition_Transition");
    92 
    93 inline CUnitTest_GetCurrentTransition_Transition::CUnitTest_GetCurrentTransition_Transition(CUnitTestContext& aUTContext,
    94 													TTransitionValidator& aValidator)
    95 : CTransition(KUnitTestGetCurrentTransitionTransition, aUTContext, aValidator)
    96 	{
    97 	// Do nothing here.
    98 	}
    99 
   100 inline void CUnitTest_GetCurrentTransition_Transition::TransitMethodL()
   101 	{
   102 	_LIT(KUnitTestGetCurrentTransitionTransitMethod, "CUnitTest::GetCurrentTransition transition");
   103 	Context().DataLogger().LogInformation(KUnitTestGetCurrentTransitionTransitMethod);
   104 	/*Context().iCurrentTransition =*/ Context().iUnitTestUnderTest->GetCurrentTransition();
   105 	}
   106 
   107 inline CUnitTest_UnitTestContext& CUnitTest_GetCurrentTransition_Transition::Context() const
   108 	{
   109 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   110 	}
   111 
   112 // ______________________________________________________________________________
   113 //
   114 _LIT(KUnitTestSetCurrentTransitionTransition,"CUnitTest_SetCurrentTransition_Transition");
   115 
   116 inline CUnitTest_SetCurrentTransition_Transition::CUnitTest_SetCurrentTransition_Transition(CUnitTestContext& aUTContext,
   117 													TTransitionValidator& aValidator)
   118 : CTransition(KUnitTestSetCurrentTransitionTransition, aUTContext, aValidator)
   119 	{
   120 	// Do nothing here.
   121 	}
   122 
   123 inline void CUnitTest_SetCurrentTransition_Transition::TransitMethodL()
   124 	{
   125 	_LIT(KUnitTestSetCurrentTransitionTransitMethod, "CUnitTest::SetCurrentTransition transition");
   126 	Context().DataLogger().LogInformation(KUnitTestSetCurrentTransitionTransitMethod);
   127 	Context().iUnitTest->SetCurrentTransition(*(Context().iTransition));
   128 	}
   129 
   130 inline CUnitTest_UnitTestContext& CUnitTest_SetCurrentTransition_Transition::Context() const
   131 	{
   132 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   133 	}
   134 
   135 // ______________________________________________________________________________
   136 //
   137 _LIT(KUnitTestSetParametersLTransition,"CUnitTest_SetParametersL_Transition");
   138 
   139 inline CUnitTest_SetParametersL_Transition::CUnitTest_SetParametersL_Transition(CUnitTestContext& aUTContext,
   140 													TTransitionValidator& aValidator)
   141 : CTransitionType(KUnitTestSetParametersLTransition, aUTContext, aValidator)
   142 	{
   143 	// Do nothing here.
   144 	}
   145 
   146 inline void CUnitTest_SetParametersL_Transition::TransitMethodL()
   147 	{
   148 	_LIT(KUnitTestSetParametersLTransitMethod, "CUnitTest::SetParametersL transition");
   149 	Context().DataLogger().LogInformation(KUnitTestSetParametersLTransitMethod);
   150 	Context().iUnitTest->SetParametersL(Context().iParams);
   151 	}
   152 
   153 inline CUnitTest_UnitTestContext& CUnitTest_SetParametersL_Transition::Context() const
   154 	{
   155 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   156 	}
   157 
   158 // ______________________________________________________________________________
   159 //
   160 _LIT(KUnitTestPrepareUnitTestLTransition,"CUnitTest_PrepareUnitTestL_Transition");
   161 
   162 inline CUnitTest_PrepareUnitTestL_Transition::CUnitTest_PrepareUnitTestL_Transition(CUnitTestContext& aUTContext,
   163 													TTransitionValidator& aValidator)
   164 : CTransitionType(KUnitTestPrepareUnitTestLTransition, aUTContext, aValidator)
   165 	{
   166 	// Do nothing here.
   167 	}
   168 
   169 inline void CUnitTest_PrepareUnitTestL_Transition::TransitMethodL()
   170 	{
   171 	_LIT(KUnitTestPrepareUnitTestLTransitMethod, "CUnitTest::PrepareUnitTestL transition");
   172 	Context().DataLogger().LogInformation(KUnitTestPrepareUnitTestLTransitMethod);
   173 	Context().iUnitTest->PrepareUnitTestL();
   174 	}
   175 
   176 inline CUnitTest_UnitTestContext& CUnitTest_PrepareUnitTestL_Transition::Context() const
   177 	{
   178 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   179 	}
   180 
   181 // ______________________________________________________________________________
   182 //
   183 _LIT(KUnitTestRunTestTransition,"CUnitTest_RunTest_Transition");
   184 
   185 inline CUnitTest_RunTest_Transition::CUnitTest_RunTest_Transition(CUnitTestContext& aUTContext,
   186 													TTransitionValidator& aValidator)
   187 : CTransition(KUnitTestRunTestTransition, aUTContext, aValidator)
   188 	{
   189 	// Do nothing here.
   190 	}
   191 
   192 inline void CUnitTest_RunTest_Transition::TransitMethodL()
   193 	{
   194 	_LIT(KUnitTestRunTestTransitMethod, "CUnitTest::RunTest transition");
   195 	Context().DataLogger().LogInformation(KUnitTestRunTestTransitMethod);
   196 	Context().iUnitTest->RunTest(Context().iTimeAfter);
   197 	}
   198 
   199 inline CUnitTest_UnitTestContext& CUnitTest_RunTest_Transition::Context() const
   200 	{
   201 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   202 	}
   203 
   204 // ______________________________________________________________________________
   205 //
   206 _LIT(KUnitTestAddTransitionLTransition,"CUnitTest_AddTransitionL_Transition");
   207 
   208 inline CUnitTest_AddTransitionL_Transition::CUnitTest_AddTransitionL_Transition(CUnitTestContext& aUTContext,
   209 													TTransitionValidator& aValidator)
   210 : CTransitionType(KUnitTestAddTransitionLTransition, aUTContext, aValidator)
   211 	{
   212 	// Do nothing here.
   213 	}
   214 
   215 inline void CUnitTest_AddTransitionL_Transition::TransitMethodL()
   216 	{
   217 	_LIT(KUnitTestAddTransitionLTransitMethod, "CUnitTest::AddTransitionL transition");
   218 	Context().DataLogger().LogInformation(KUnitTestAddTransitionLTransitMethod);	
   219 	TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
   220 	accessor.AddTransitionL(*(Context().iUnitTest), (Context().iTransition));
   221 	}
   222 
   223 inline CUnitTest_UnitTestContext& CUnitTest_AddTransitionL_Transition::Context() const
   224 	{
   225 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   226 	}
   227 
   228 // ______________________________________________________________________________
   229 //
   230 _LIT(KUnitTestAddBlockingTransitionLTransition,"CUnitTest_AddBlockingTransitionL_Transition");
   231 
   232 inline CUnitTest_AddBlockingTransitionL_Transition::CUnitTest_AddBlockingTransitionL_Transition(CUnitTestContext& aUTContext,
   233 													TTransitionValidator& aValidator)
   234 : CTransitionType(KUnitTestAddBlockingTransitionLTransition, aUTContext, aValidator)
   235 	{
   236 	// Do nothing here.
   237 	}
   238 
   239 inline void CUnitTest_AddBlockingTransitionL_Transition::TransitMethodL()
   240 	{
   241 	_LIT(KUnitTestAddBlockingTransitionLTransitMethod, "CUnitTest::AddBlockingTransitionL transition");
   242 	Context().DataLogger().LogInformation(KUnitTestAddBlockingTransitionLTransitMethod);
   243 	TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
   244 	accessor.AddBlockingTransitionL(*(Context().iUnitTest), (Context().iTransition));
   245 	}
   246 
   247 inline CUnitTest_UnitTestContext& CUnitTest_AddBlockingTransitionL_Transition::Context() const
   248 	{
   249 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   250 	}
   251 
   252 // ______________________________________________________________________________
   253 //
   254 _LIT(KUnitTestAddLeaveErrorCodeLTransition,"CUnitTest_AddLeaveErrorCodeL_Transition");
   255 
   256 inline CUnitTest_AddLeaveErrorCodeL_Transition::CUnitTest_AddLeaveErrorCodeL_Transition(CUnitTestContext& aUTContext,
   257 													TTransitionValidator& aValidator)
   258 : CTransitionType(KUnitTestAddLeaveErrorCodeLTransition, aUTContext, aValidator)
   259 	{
   260 	// Do nothing here.
   261 	}
   262 
   263 inline void CUnitTest_AddLeaveErrorCodeL_Transition::TransitMethodL()
   264 	{
   265 	_LIT(KUnitTestAddLeaveErrorCodeLTransitMethod, "CUnitTest::AddLeaveErrorCodeL transition");
   266 	Context().DataLogger().LogInformation(KUnitTestAddLeaveErrorCodeLTransitMethod);
   267 	TUnitTest_StateAccessor& accessor = REINTERPRET_CAST(TUnitTest_StateAccessor&, Context().StateAccessor());
   268 	accessor.AddLeaveErrorCodeL(*(Context().iUnitTest), (Context().iLeaveErrorCode));
   269 	}
   270 
   271 inline CUnitTest_UnitTestContext& CUnitTest_AddLeaveErrorCodeL_Transition::Context() const
   272 	{
   273 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   274 	}
   275 
   276 // ______________________________________________________________________________
   277 //
   278 _LIT(KUnitTestUnitTestNameTransition,"CUnitTest_UnitTestName_Transition");
   279 
   280 inline CUnitTest_UnitTestName_Transition::CUnitTest_UnitTestName_Transition(CUnitTestContext& aUTContext,
   281 													TTransitionValidator& aValidator)
   282 : CTransition(KUnitTestUnitTestNameTransition, aUTContext, aValidator)
   283 	{
   284 	// Do nothing here.
   285 	}
   286 
   287 inline void CUnitTest_UnitTestName_Transition::TransitMethodL()
   288 	{
   289 	_LIT(KUnitTestUnitTestNameTransitMethod, "CUnitTest::UnitTestName transition");
   290 	Context().DataLogger().LogInformation(KUnitTestUnitTestNameTransitMethod);
   291 	Context().iUnitTest->UnitTestName();
   292 	}
   293 
   294 inline CUnitTest_UnitTestContext& CUnitTest_UnitTestName_Transition::Context() const
   295 	{
   296 	return REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext);
   297 	}
   298 
   299 
   300 // Add additional Transition class Implementations here...
   301