os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/TestManagerTest/TestManagerTransitions.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/TestManagerTest/TestManagerTransitions.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,299 @@
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 definitions of the transition classes upon the CTestManager class methods.
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __TESTMANAGERTRANSITIONS_H__
1.22 +#define __TESTMANAGERTRANSITIONS_H__
1.23 +
1.24 +#include "TestUtilities.h"
1.25 +#include "StateAccessor.h"
1.26 +#include "LeakTestTransition.h"
1.27 +#include <ecom/test_bed/datalogger.h>
1.28 +#include "TestManager.h"
1.29 +#include "TestManagerStateAccessor.h"
1.30 +#include <ecom/test_bed/unittest.h>
1.31 +#include "TestController.h"
1.32 +#include "TestManagerObserverStub.h"
1.33 +
1.34 +#define CTransitionType CLeakTestTransition
1.35 +
1.36 +// ______________________________________________________________________________
1.37 +//
1.38 +/**
1.39 + @internalComponent
1.40 +
1.41 + Comments : Provide all the CTestManager specific
1.42 + parameters and behaviour on the CTestManager
1.43 + test class for a transition.
1.44 + */
1.45 +class CTestManager_UnitTestContext : public CUnitTestContext
1.46 + {
1.47 +public:
1.48 + /**
1.49 + @fn CTestManager_UnitTestContext(CDataLogger& aDataLogger,
1.50 + MStateAccessor& aStateAccessor,
1.51 + MTransitionObserver& aObserver)
1.52 + Intended Usage : Default constructor.
1.53 + Error Condition : None.
1.54 + @since 6.0
1.55 + @param aDataLogger The output logging object.
1.56 + @param aObserver The observer of this UnitTest's Transitions.
1.57 + @param aStateAccessor WhiteBox state access to the CTestManager class under test.
1.58 + @pre None.
1.59 + @post CTestManager_UnitTestContext is fully constructed, and initialised.
1.60 + */
1.61 + inline CTestManager_UnitTestContext(CDataLogger& aDataLogger,
1.62 + MStateAccessor& aStateAccessor,
1.63 + MTransitionObserver& aObserver);
1.64 +
1.65 + /**
1.66 + @fn ~CTestManager_UnitTestContext()
1.67 + Intended Usage : Default Destructor
1.68 + @since 6.0
1.69 + @pre CTestManager_UnitTestContext is fully constructed.
1.70 + @post CTestManager_UnitTestContext is fully destroyed
1.71 + */
1.72 + virtual inline ~CTestManager_UnitTestContext();
1.73 +
1.74 + inline MManagerObserver& ManagerObserver();
1.75 +
1.76 + /** The instance of the class under test */
1.77 + CTestManager* iTestManager;
1.78 + /** A component info to be used by the TestManager */
1.79 + CComponentInfo* iComponentInfo;
1.80 + /** A reference to the observer stub of the CTestManager */
1.81 + CTestManagerObserverStub* iTestManagerObserverStub;
1.82 + /** A test controller to be used by the TestManager */
1.83 + CTestController* iTestController;
1.84 + /** A component tester to be used by the TestManager */
1.85 + CComponentTester* iTester;
1.86 + /** An array of all the tests avaialble to be run */
1.87 + RPointerArray<CComponentInfo>* iTestListArray;
1.88 + /** An array of all the available components */
1.89 + const RPointerArray<CComponentInfo>* iComponents;
1.90 + /** An array of all the tests that are to be run */
1.91 + RPointerArray<TTestInfo> iTests;
1.92 + /** The index of the component to test */
1.93 + TInt iComponentIndex;
1.94 +
1.95 + }; // CTestManager_UnitTestContext
1.96 +
1.97 +// ______________________________________________________________________________
1.98 +//
1.99 +/**
1.100 + @internalComponent
1.101 +
1.102 + Comments : Transition test of the CTestManager::NewL method.
1.103 + */
1.104 +class CTestManager_NewL_Transition : public CTransitionType
1.105 + {
1.106 +public:
1.107 + /**
1.108 + @fn CTestManager_NewL_Transition(CUnitTestContext& aUTContext,
1.109 + TTransitionValidator& aValidator)
1.110 + Intended Usage : Standard c'tor method.
1.111 + Error Condition : None.
1.112 + @since 6.0
1.113 + @param aUTContext The context this transition is operating in.
1.114 + @param aValidator Used for checking the pre & post conditions of the test object.
1.115 + @pre None.
1.116 + @post CTestManager_NewL_Transition is fully constructed.
1.117 + */
1.118 + CTestManager_NewL_Transition(CUnitTestContext& aUTContext,
1.119 + TTransitionValidator& aValidator);
1.120 + /**
1.121 + @fn TransitMethodL()
1.122 + Intended Usage : To execute the CTestManager::NewL method for the test harness.
1.123 + Error Condition : Leaves with an error code.
1.124 + @leave KErrNoMemory, (@see CTestManager::NewL)
1.125 + @since 6.0
1.126 + @return None
1.127 + @pre CTestManager_NewL_Transition is fully constructed.
1.128 + @post No change in the CTestManager_NewL_Transition apart
1.129 + from iTestManager, which may have changed state.
1.130 + (@see CTestManager::NewL post-condition) for iTestManager's new state.
1.131 + */
1.132 + inline void TransitMethodL();
1.133 +
1.134 + /**
1.135 + @fn Context() const
1.136 + Intended Usage : To provide access to the unit test context cast to the correct type.
1.137 + Error Condition : None.
1.138 + @since 6.0
1.139 + @return The unit test context cast to a CTestManager_UnitTestContext
1.140 + @pre iUTContext is a valid CTestManager_UnitTestContext.
1.141 + @post No change in the CTestManager_NewL_Transition
1.142 + */
1.143 + inline CTestManager_UnitTestContext& Context() const;
1.144 + }; // CTestManager_NewL_Transition
1.145 +
1.146 +// ______________________________________________________________________________
1.147 +//
1.148 +/**
1.149 + @internalComponent
1.150 +
1.151 + Comments : Transition test of the CTestManager::Dtor method.
1.152 + */
1.153 +class CTestManager_Dtor_Transition : public CTransition
1.154 + {
1.155 +public:
1.156 + /**
1.157 + @fn CTestManager_Dtor_Transition(CUnitTestContext& aUTContext,
1.158 + TTransitionValidator& aValidator)
1.159 + Intended Usage : Standard c'tor method.
1.160 + Error Condition : None.
1.161 + @since 6.0
1.162 + @param aUTContext The context this transition is operating in.
1.163 + @param aValidator Used for checking the pre & post conditions of the test object.
1.164 + @pre None.
1.165 + @post CTestManager_Dtor_Transition is fully constructed.
1.166 + */
1.167 + CTestManager_Dtor_Transition(CUnitTestContext& aUTContext,
1.168 + TTransitionValidator& aValidator);
1.169 + /**
1.170 + @fn TransitMethodL()
1.171 + Intended Usage : To execute the CTestManager::Dtor method for the test harness.
1.172 + Error Condition : Leaves with an error code.
1.173 + @leave KErrNoMemory, (@see CTestManager::Dtor)
1.174 + @since 6.0
1.175 + @return None
1.176 + @pre CTestManager_Dtor_Transition is fully constructed.
1.177 + @post No change in the CTestManager_Dtor_Transition apart
1.178 + from iTestManager, which may have changed state.
1.179 + (@see CTestManager::Dtor post-condition) for iTestManager's new state.
1.180 + */
1.181 + inline void TransitMethodL();
1.182 +
1.183 + /**
1.184 + @fn Context() const
1.185 + Intended Usage : To provide access to the unit test context cast to the correct type.
1.186 + Error Condition : None.
1.187 + @since 6.0
1.188 + @return The unit test context cast to a CTestManager_UnitTestContext
1.189 + @pre iUTContext is a valid CTestManager_UnitTestContext.
1.190 + @post No change in the CTestManager_Dtor_Transition
1.191 + */
1.192 + inline CTestManager_UnitTestContext& Context() const;
1.193 + }; // CTestManager_Dtor_Transition
1.194 +
1.195 +// ______________________________________________________________________________
1.196 +//
1.197 +/**
1.198 + @internalComponent
1.199 +
1.200 + Comments : Transition test of the CTestManager::RunTests method.
1.201 + */
1.202 +class CTestManager_RunTests_Transition : public CTransition
1.203 + {
1.204 +public:
1.205 + /**
1.206 + @fn CTestManager_RunTests_Transition(CUnitTestContext& aUTContext,
1.207 + TTransitionValidator& aValidator)
1.208 + Intended Usage : Standard c'tor method.
1.209 + Error Condition : None.
1.210 + @since 6.0
1.211 + @param aUTContext The context this transition is operating in.
1.212 + @param aValidator Used for checking the pre & post conditions of the test object.
1.213 + @pre None.
1.214 + @post CTestManager_RunTests_Transition is fully constructed.
1.215 + */
1.216 + CTestManager_RunTests_Transition(CUnitTestContext& aUTContext,
1.217 + TTransitionValidator& aValidator);
1.218 + /**
1.219 + @fn TransitMethodL()
1.220 + Intended Usage : To execute the CTestManager::RunTests method for the test harness.
1.221 + Error Condition : Leaves with an error code.
1.222 + @leave KErrNoMemory, (@see CTestManager::RunTests)
1.223 + @since 6.0
1.224 + @return None
1.225 + @pre CTestManager_RunTests_Transition is fully constructed.
1.226 + @post No change in the CTestManager_RunTests_Transition apart
1.227 + from iTestManager, which may have changed state.
1.228 + (@see CTestManager::RunTests post-condition) for iTestManager's new state.
1.229 + */
1.230 + inline void TransitMethodL();
1.231 +
1.232 + /**
1.233 + @fn Context() const
1.234 + Intended Usage : To provide access to the unit test context cast to the correct type.
1.235 + Error Condition : None.
1.236 + @since 6.0
1.237 + @return The unit test context cast to a CTestManager_UnitTestContext
1.238 + @pre iUTContext is a valid CTestManager_UnitTestContext.
1.239 + @post No change in the CTestManager_RunTests_Transition
1.240 + */
1.241 + inline CTestManager_UnitTestContext& Context() const;
1.242 + }; // CTestManager_RunTests_Transition
1.243 +
1.244 +
1.245 +// ______________________________________________________________________________
1.246 +//
1.247 +/**
1.248 + @internalComponent
1.249 +
1.250 + Comments : Transition test of the CTestManager::TestComponentL method.
1.251 + */
1.252 +class CTestManager_TestComponentL_Transition : public CTransitionType
1.253 + {
1.254 +public:
1.255 + /**
1.256 + @fn CTestManager_TestComponentL_Transition(CUnitTestContext& aUTContext,
1.257 + TTransitionValidator& aValidator)
1.258 + Intended Usage : Standard c'tor method.
1.259 + Error Condition : None.
1.260 + @since 6.0
1.261 + @param aUTContext The context this transition is operating in.
1.262 + @param aValidator Used for checking the pre & post conditions of the test object.
1.263 + @pre None.
1.264 + @post CTestManager_TestComponentL_Transition is fully constructed.
1.265 + */
1.266 + CTestManager_TestComponentL_Transition(CUnitTestContext& aUTContext,
1.267 + TTransitionValidator& aValidator);
1.268 + /**
1.269 + @fn TransitMethodL()
1.270 + Intended Usage : To execute the CTestManager::TestComponentL method for the test harness.
1.271 + Error Condition : Leaves with an error code.
1.272 + @leave KErrNoMemory, (@see CTestManager::TestComponentL)
1.273 + @since 6.0
1.274 + @return None
1.275 + @pre CTestManager_TestComponentL_Transition is fully constructed.
1.276 + @post No change in the CTestManager_TestComponentL_Transition apart
1.277 + from iTestManager, which may have changed state.
1.278 + (@see CTestManager::TestComponentL post-condition) for iTestManager's new state.
1.279 + */
1.280 + inline void TransitMethodL();
1.281 +
1.282 + /**
1.283 + @fn Context() const
1.284 + Intended Usage : To provide access to the unit test context cast to the correct type.
1.285 + Error Condition : None.
1.286 + @since 6.0
1.287 + @return The unit test context cast to a CTestManager_UnitTestContext
1.288 + @pre iUTContext is a valid CTestManager_UnitTestContext.
1.289 + @post No change in the CTestManager_TestComponentL_Transition
1.290 + */
1.291 + inline CTestManager_UnitTestContext& Context() const;
1.292 + }; // CTestManager_TestComponentL_Transition
1.293 +
1.294 +
1.295 +// Add additional Transition class definitions here...
1.296 +
1.297 +#include "TestManagerTransitions.inl"
1.298 +
1.299 +#include "TestManagerUnitTestContext.inl"
1.300 +
1.301 +#endif // __TESTMANAGERTRANSITIONS_H__
1.302 +