os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/TestControllerTest/TestControllerTest.cpp
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 // Demonstrates a simple set of derived class implementations to
15 // test the CTestController class using the test bed.
16 // It may be used as a basis to develop a full test bed dll.
17 // For support and comment please contact the authors.
21 #include "TestControllerUnitTest.h"
22 #include "ComponentTester.h"
25 // ______________________________________________________________________________
30 Comments : Test the CTestController class.
32 class CTestController_ComponentTest : public CComponentTester
36 @fn NewLC(CDataLogger& aDataLogger,
37 MComponentTestObserver& aObserver)
38 Intended Usage : Standard two-phase construction which leaves nothing on the
40 Error Condition : Leaves with the error code.
43 @param aDataLogger The output logging object.
44 @param aObserver The observer of this component test.
45 @return CTestController_ComponentTest* The constructed object.
47 @post CTestController_ComponentTest is fully constructed.
49 static CTestController_ComponentTest* NewLC(CDataLogger& aDataLogger,
50 MComponentTestObserver& aObserver);
54 @fn CTestController_ComponentTest(CDataLogger& aDataLogger,
55 MComponentTestObserver& aObserver)
56 Intended Usage : Standard c'tor method.
57 Error Condition : None.
59 @param aDataLogger The logging object.
60 @param aObserver The observer of this component test.
62 @post CTestController_ComponentTest is fully constructed.
64 inline CTestController_ComponentTest(CDataLogger& aDataLogger,
65 MComponentTestObserver& aObserver);
68 Intended Usage : Second phase of safe two phase construction,
69 to complete the object initialisation.
70 Error Condition : Leaves with an error code.
74 @pre CTestController_ComponentTest is fully constructed.
75 @post CTestController_ComponentTest is fully initialised.
77 inline void ConstructL();
79 }; // CTestController_ComponentTest
81 // ______________________________________________________________________________
83 inline CTestController_ComponentTest* CTestController_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
85 CTestController_ComponentTest* self = new (ELeave) CTestController_ComponentTest(aDataLogger, aObserver);
86 CleanupStack::PushL(self);
91 inline CTestController_ComponentTest::CTestController_ComponentTest(CDataLogger& aDataLogger,
92 MComponentTestObserver& aObserver)
93 : CComponentTester(aDataLogger, aObserver)
98 inline void CTestController_ComponentTest::ConstructL()
100 // Perform base class initialization
101 ComponentTesterConstructL();
103 AddUnitTestL(CTestController_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
104 AddUnitTestL(CTestController_FindTests_UnitTest::NewL(iDataLogger, *this));
107 // ______________________________________________________________________________
109 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
110 MComponentTestObserver& aComponentTestObserver)
112 return CTestController_ComponentTest::NewLC(aDataLogger, aComponentTestObserver);
116 // ___________________________________________________________________________
118 // This section of the module simply includes the exported test harness template which
119 // makes this a "whole" CPP file with a E32Main entry point below. The test MMP
120 // project file can then produce a EXE for the test project instead of a DLL.
122 #include <ecom/test_bed/testharnesstemplate.h>
124 GLDEF_C TInt E32Main()
126 return E32Main_TestHarness(NewComponentTestLC);
129 // ______________________________________________________________________________
131 class CTestController_ComponentTest_STUB : public CComponentTester
134 static CTestController_ComponentTest_STUB* NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver);
137 inline CTestController_ComponentTest_STUB(CDataLogger& aDataLogger, MComponentTestObserver& aObserver);
138 inline void ConstructL();
141 // ______________________________________________________________________________
143 inline CTestController_ComponentTest_STUB* CTestController_ComponentTest_STUB::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
145 CTestController_ComponentTest_STUB* self = new (ELeave) CTestController_ComponentTest_STUB(aDataLogger, aObserver);
146 CleanupStack::PushL(self);
151 inline CTestController_ComponentTest_STUB::CTestController_ComponentTest_STUB(CDataLogger& aDataLogger,
152 MComponentTestObserver& aObserver)
153 : CComponentTester(aDataLogger, aObserver)
159 @SYMTestCaseID SYSLIB-ECOM-CT-0780
160 @SYMTestCaseDesc Tests for the implementations of CTransition class
161 @SYMTestPriority High
162 @SYMTestActions Tests for create and destroy,asynchronous,transit method operations
163 @SYMTestExpectedResults Test must not fail
166 inline void CTestController_ComponentTest_STUB::ConstructL()
168 // Perform base class initialization
169 ComponentTesterConstructL();
171 AddUnitTestL(CTestController_CreateAndDestroy_UnitTest_STUB::NewL(iDataLogger, *this));
174 // ______________________________________________________________________________
176 EXPORT_C CComponentTester* NewComponentTestLC_STUB(CDataLogger& aDataLogger,
177 MComponentTestObserver& aComponentTestObserver)
180 return CTestController_ComponentTest_STUB::NewLC(aDataLogger, aComponentTestObserver);