|
1 // Copyright (c) 2006-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 // @file ctlbsconflictserver.cpp |
|
15 // This is the class implementation for the LBS Conflict Test Server |
|
16 // |
|
17 // |
|
18 |
|
19 // User includes |
|
20 #include "ctlbsconflictserver.h" |
|
21 |
|
22 // System includes |
|
23 #include <e32std.h> |
|
24 #include <rsshared.h> |
|
25 |
|
26 // Header files of LBS Client API Test Steps |
|
27 #include "ctlbsconflictstepexample.h" |
|
28 #include "ctlbsconflictstepx3ppushselflocate.h" |
|
29 #include "ctlbsconflictstepx3pmenupush.h" |
|
30 #include "ctlbsconflictstepx3ptimerpush.h" |
|
31 #include "ctlbsconflictstepx3ppushtimer.h" |
|
32 #include "ctlbsconflictstepx3ppushmenu.h" |
|
33 #include "ctlbsconflictstepx3ppushpush.h" |
|
34 #include "ctlbsconflictstepx3pmenumenu.h" |
|
35 #include "ctlbsconflictstepselflocatex3ppush.h" |
|
36 #include "ctlbsconflictstepmtlrx3ppush.h" |
|
37 #include "ctlbsconflictstepcanceltracking.h" |
|
38 #include "ctlbsconflictstepcanceltrackingconflict.h" |
|
39 #include "ctlbsconflictstepcanceltrackingconflictb.h" |
|
40 #include "ctlbsconflictstepmtlrnetlocreq.h" |
|
41 |
|
42 /** |
|
43 MainL() |
|
44 Description : This is the main function which installs the |
|
45 active scheduler and creates an object of the Email server |
|
46 @internalTechnology |
|
47 @param none |
|
48 @return none |
|
49 @pre None |
|
50 @post None |
|
51 */ |
|
52 LOCAL_C void MainL() |
|
53 { |
|
54 CActiveScheduler* sched = new (ELeave) CActiveScheduler; |
|
55 CleanupStack::PushL(sched); |
|
56 CActiveScheduler::Install(sched); |
|
57 |
|
58 __UHEAP_MARK; |
|
59 // this registers the server with the active scheduler and calls SetActive |
|
60 CT_LbsConflictServer* server = CT_LbsConflictServer::NewL(); |
|
61 |
|
62 // signal to the client that we are ready by |
|
63 // rendevousing process |
|
64 RProcess::Rendezvous(KErrNone); |
|
65 |
|
66 // run the active scheduler |
|
67 sched->Start(); |
|
68 |
|
69 // clean up |
|
70 delete server; |
|
71 __UHEAP_MARKEND; |
|
72 CleanupStack::PopAndDestroy(sched); |
|
73 } |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 /** |
|
79 E32Main() |
|
80 Description : It is the entry point |
|
81 @internalTechnology |
|
82 @param none |
|
83 @return Returns the error code |
|
84 @pre None |
|
85 @post None |
|
86 */ |
|
87 GLDEF_C TInt E32Main() |
|
88 { |
|
89 __UHEAP_MARK; |
|
90 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
91 if(cleanup == NULL) |
|
92 { |
|
93 return KErrNoMemory; |
|
94 } |
|
95 |
|
96 TRAPD(err, MainL()); |
|
97 |
|
98 delete cleanup; |
|
99 __UHEAP_MARKEND; |
|
100 |
|
101 return err; |
|
102 } |
|
103 |
|
104 |
|
105 |
|
106 /** |
|
107 NewL() |
|
108 Constructs a CT_LbsClientServer object. |
|
109 Uses two phase construction and leaves nothing on the CleanupStack. |
|
110 @internalTechnology |
|
111 @param none |
|
112 @return Created object of type CT_LbsClientServer |
|
113 @pre None |
|
114 @post None |
|
115 */ |
|
116 CT_LbsConflictServer* CT_LbsConflictServer::NewL() |
|
117 { |
|
118 CT_LbsConflictServer*server = new(ELeave) CT_LbsConflictServer(); |
|
119 CleanupStack::PushL(server); |
|
120 server->ConstructL(KLbsConflictTestServer); |
|
121 CleanupStack::Pop(server); |
|
122 return server; |
|
123 } |
|
124 |
|
125 |
|
126 CT_LbsConflictServer::~CT_LbsConflictServer() |
|
127 { |
|
128 } |
|
129 |
|
130 |
|
131 /** |
|
132 Function : CT_LbsClientServer |
|
133 Description : Constructor |
|
134 @internalTechnology |
|
135 @param : |
|
136 @return : N/A |
|
137 @precondition : none |
|
138 @postcondition : none |
|
139 */ |
|
140 CT_LbsConflictServer::CT_LbsConflictServer() |
|
141 { |
|
142 } |
|
143 |
|
144 /** |
|
145 Function : ConstructL |
|
146 Description : |
|
147 @internalTechnology |
|
148 @param : |
|
149 @return : N/A |
|
150 @precondition : none |
|
151 @postcondition : none |
|
152 */ |
|
153 void CT_LbsConflictServer::ConstructL(const TDesC& aName) |
|
154 { |
|
155 CT_LbsServer::ConstructL(aName); |
|
156 |
|
157 iSharedData = CT_LbsConflictSharedData::NewL(); |
|
158 } |
|
159 |
|
160 |
|
161 /** |
|
162 Function : CreateTestStep |
|
163 Description : Creates a test step based on the step name read from the script file |
|
164 @internalTechnology |
|
165 @param : aStepName The step name which needs to be created |
|
166 @return : Created object of type CTestStep |
|
167 @precondition : none |
|
168 @postcondition : none |
|
169 */ |
|
170 CTestStep* CT_LbsConflictServer::CreateTestStep(const TDesC& aStepName) |
|
171 { |
|
172 // NULL if insufficient memory. This suits the API. |
|
173 |
|
174 // Test case test steps, each test step supports one or more test cases. |
|
175 if(aStepName == KLbsConflictStep_Example) |
|
176 { |
|
177 return CT_LbsConflictStep_Example::New(*this); |
|
178 } |
|
179 if(aStepName == KLbsConflictStepselflocatex3ppush) |
|
180 { |
|
181 return CT_LbsConflictStep_selflocatex3ppush::New(*this); |
|
182 } |
|
183 if(aStepName == KLbsConflictStepx3ppushselflocate) |
|
184 { |
|
185 return CT_LbsConflictStepx3ppushselflocate::New(*this); |
|
186 } |
|
187 if (aStepName == KLbsConflictStep_X3PMenuPush) |
|
188 { |
|
189 return CT_LbsConflictStep_X3PMenuPush::New(*this); |
|
190 } |
|
191 if (aStepName == KLbsConflictStep_X3PTimerPush) |
|
192 { |
|
193 return CT_LbsConflictStep_X3PTimerPush::New(*this); |
|
194 } |
|
195 if(aStepName == KLbsConflictStep_X3PPushTimer) |
|
196 { |
|
197 return CT_LbsConflictStep_X3PPushTimer::New(*this); |
|
198 } |
|
199 if (aStepName == KLbsConflictStep_MTLRX3PPush) |
|
200 { |
|
201 return CT_LbsConflictStep_MTLRX3PPush::New(*this); |
|
202 } |
|
203 if (aStepName == KLbsConflictStep_X3PPushMenu) |
|
204 { |
|
205 return CT_LbsConflictStep_X3PPushMenu::New(*this); |
|
206 } |
|
207 if (aStepName == KLbsConflictStep_X3PPushPush) |
|
208 { |
|
209 return CT_LbsConflictStep_X3PPushPush::New(*this); |
|
210 } |
|
211 if (aStepName == KLbsConflictStep_X3PMenuMenu) |
|
212 { |
|
213 return CT_LbsConflictStep_X3PMenuMenu::New(*this); |
|
214 } |
|
215 |
|
216 if(aStepName == KLbsConflictStep_canceltracking) |
|
217 { |
|
218 return CT_LbsConflictStep_canceltracking::New(*this); |
|
219 } |
|
220 if(aStepName == KLbsConflictStep_canceltrackingconflict) |
|
221 { |
|
222 return CT_LbsConflictStep_canceltrackingconflict::New(*this); |
|
223 } |
|
224 if(aStepName == KLbsConflictStep_canceltrackingconflictb) |
|
225 { |
|
226 return CT_LbsConflictStep_canceltrackingconflictb::New(*this); |
|
227 } |
|
228 |
|
229 if(aStepName == KLbsConflictStep_MTLRNETLOCREQ) |
|
230 { |
|
231 return CT_LbsConflictStep_MTLRNETLOCREQ::New(*this); |
|
232 } |
|
233 // Let base class handle any common test steps - will return NULL if test step is not supported. |
|
234 return CT_LbsServer::CreateTestStep(aStepName); |
|
235 } |
|
236 |