os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/ComponentInfoTest/ComponentInfoUnitTest.h
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The unit test class definitions for the CComponentInfo class.
18 #ifndef __COMPONENTINFOUNITTEST_H__
19 #define __COMPONENTINFOUNITTEST_H__
21 #include <ecom/test_bed/testbeddefinitions.h>
22 #include "ComponentInfoStateAccessor.h"
23 #include "ComponentInfoTransitionValidation.h"
24 #include "ComponentInfoTransitions.h"
26 // ______________________________________________________________________________
31 Comments : Unit Test for CreateAndDestroy on CComponentInfo, the class under test.
33 class CComponentInfo_CreateAndDestroy_UnitTest : public CUnitTest
37 @fn NewL(CDataLogger& aDataLogger,
38 MUnitTestObserver& aObserver)
39 Intended Usage : Standard two-phase construction which leaves nothing on the
41 Error Condition : Leaves with the error code.
44 @param aDataLogger The output logging object.
45 @param aObserver The observer of this UnitTest.
46 @return CComponentInfo_CreateAndDestroy_UnitTest* The constructed object.
48 @post CComponentInfo_CreateAndDestroy_UnitTest is fully constructed, and initialised.
50 static CComponentInfo_CreateAndDestroy_UnitTest* NewL(CDataLogger& aDataLogger,
51 MUnitTestObserver& aObserver);
54 @fn RunError(TInt aError)
55 Intended Usage : Intercept the panic caused by a RunL leave,
56 to restore the CComponentInfo_CreateAndDestroy_UnitTest
57 object to a sensible state.
58 (called by the Active Scheduler immediately before the Panic).
59 Error Condition : @see CUnitTest::RunError().
61 @return TInt KErrNone if cleanup successful, otherwise
62 @see CUnitTest::RunError()
63 @pre CComponentInfo_CreateAndDestroy_UnitTest is fully constructed, and initialised.
64 @post The object has been restored to a sensible state.
66 inline TInt RunError(TInt aError);
69 @fn ~CComponentInfo_CreateAndDestroy_UnitTest()
70 Intended Usage : Standard Destructor.
71 Error Condition : None.
73 @pre CComponentInfo_CreateAndDestroy_UnitTest is fully constructed.
74 @post CComponentInfo_CreateAndDestroy_UnitTest is fully destroyed.
76 ~CComponentInfo_CreateAndDestroy_UnitTest();
80 @fn CComponentInfo_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger,
81 MUnitTestObserver& aObserver)
82 Intended Usage : Default constructor.
83 Error Condition : None.
85 @param aDataLogger The output logging object.
86 @param aObserver The observer of this UnitTest.
87 @param aStateAccessor WhiteBox state access to the CComponentInfo class.
89 @post CComponentInfo_CreateAndDestroy_UnitTest is fully constructed.
91 inline CComponentInfo_CreateAndDestroy_UnitTest(CDataLogger& aDataLogger,
92 MUnitTestObserver& aObserver);
96 Intended Usage : Second phase of safe two phase construction,
97 to complete the object initialisation.
98 Error Condition : Leaves with an error code.
99 @leave KErrNoMemory, and @see CUnitTest::BaseNewL().
102 @pre CComponentInfo_CreateAndDestroy_UnitTest is fully constructed.
103 @post CComponentInfo_CreateAndDestroy_UnitTest is fully initialised.
108 The context of the Unit Test.
109 i.e The CComponentInfo class tested by this UnitTest's transitions.
111 CComponentInfo_UnitTestContext* iUTContext;
112 TComponentInfo_StateAccessor* iStateAccessor;
113 // C'tor, d'tor, and method transition validators
114 TComponentInfo_Ctor_TransitionValidator* iCtorValidator;
115 TComponentInfo_Dtor_TransitionValidator* iDtorValidator;
116 }; // CComponentInfo_CreateAndDestroy_UnitTest
118 // ______________________________________________________________________________
123 Comments : Unit Test for RetrieveTestNames on CComponentInfo, the class under test.
125 class CComponentInfo_RetrieveTestNames_UnitTest : public CUnitTest
129 @fn NewL(CDataLogger& aDataLogger,
130 MUnitTestObserver& aObserver)
131 Intended Usage : Standard two-phase construction which leaves nothing on the
133 Error Condition : Leaves with the error code.
136 @param aDataLogger The output logging object.
137 @param aObserver The observer of this UnitTest.
138 @return CComponentInfo_RetrieveTestNames_UnitTest* The constructed object.
140 @post CComponentInfo_RetrieveTestNames_UnitTest is fully constructed, and initialised.
142 static CComponentInfo_RetrieveTestNames_UnitTest* NewL(CDataLogger& aDataLogger,
143 MUnitTestObserver& aObserver);
146 @fn RunError(TInt aError)
147 Intended Usage : Intercept the panic caused by a RunL leave,
148 to restore the CComponentInfo_RetrieveTestNames_UnitTest
149 object to a sensible state.
150 (called by the Active Scheduler immediately before the Panic).
151 Error Condition : @see CUnitTest::RunError().
153 @return TInt KErrNone if cleanup successful, otherwise
154 @see CUnitTest::RunError()
155 @pre CComponentInfo_RetrieveTestNames_UnitTest is fully constructed, and initialised.
156 @post The object has been restored to a sensible state.
158 inline TInt RunError(TInt aError);
161 @fn ~CComponentInfo_RetrieveTestNames_UnitTest()
162 Intended Usage : Standard Destructor.
163 Error Condition : None.
165 @pre CComponentInfo_RetrieveTestNames_UnitTest is fully constructed.
166 @post CComponentInfo_RetrieveTestNames_UnitTest is fully destroyed.
168 ~CComponentInfo_RetrieveTestNames_UnitTest();
172 @fn CComponentInfo_RetrieveTestNames_UnitTest(CDataLogger& aDataLogger,
173 MUnitTestObserver& aObserver)
174 Intended Usage : Default constructor.
175 Error Condition : None.
177 @param aDataLogger The output logging object.
178 @param aObserver The observer of this UnitTest.
179 @param aStateAccessor WhiteBox state access to the CComponentInfo class.
181 @post CComponentInfo_RetrieveTestNames_UnitTest is fully constructed.
183 inline CComponentInfo_RetrieveTestNames_UnitTest(CDataLogger& aDataLogger,
184 MUnitTestObserver& aObserver);
187 @fn void ConstructL()
188 Intended Usage : Second phase of safe two phase construction,
189 to complete the object initialisation.
190 Error Condition : Leaves with an error code.
191 @leave KErrNoMemory, and @see CUnitTest::BaseNewL().
194 @pre CComponentInfo_RetrieveTestNames_UnitTest is fully constructed.
195 @post CComponentInfo_RetrieveTestNames_UnitTest is fully initialised.
200 The context of the Unit Test.
201 i.e The CComponentInfo class tested by this UnitTest's transitions.
203 CComponentInfo_UnitTestContext* iUTContext;
204 TComponentInfo_StateAccessor* iStateAccessor;
205 // C'tor, d'tor, and method transition validators
206 TComponentInfo_Ctor_TransitionValidator* iCtorValidator;
207 TComponentInfo_Entry_TransitionValidator* iEntryValidator;
208 TComponentInfo_UnitTestsInfo_TransitionValidator* iUnitTestsInfoValidator;
209 TComponentInfo_Dtor_TransitionValidator* iDtorValidator;
210 }; // CComponentInfo_RetrieveTestNames_UnitTest
213 #endif // __COMPONENTINFOUNITTEST_H__