|
1 // Copyright (c) 2005-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 // Example CTestStep derived implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file molr11Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr11Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 /** |
|
26 Destructor |
|
27 */ |
|
28 Cmolr11Step::~Cmolr11Step() |
|
29 |
|
30 { |
|
31 } |
|
32 |
|
33 /** |
|
34 Constructor |
|
35 */ |
|
36 Cmolr11Step::Cmolr11Step() |
|
37 { |
|
38 SetTestStepName(Kmolr11Step); |
|
39 } |
|
40 |
|
41 /** |
|
42 @return - TVerdict code |
|
43 Override of base class virtual |
|
44 */ |
|
45 TVerdict Cmolr11Step::doTestStepPreambleL() |
|
46 { |
|
47 // Call base class method for pre test actions |
|
48 CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); |
|
49 |
|
50 TLbsNetProtocolModuleParams param(*iGatewayObserver); |
|
51 iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(¶m)); |
|
52 |
|
53 return TestStepResult(); |
|
54 } |
|
55 |
|
56 |
|
57 /** Perform CMoLrStep1 test step. |
|
58 This test verifies that the SUPL Protocol Module correctly handles |
|
59 a connection error reported from the Connection Manager. |
|
60 |
|
61 @return TVerdict test result code |
|
62 */ |
|
63 TVerdict Cmolr11Step::doTestStepL() |
|
64 { |
|
65 |
|
66 |
|
67 INFO_PRINTF1(_L("\t********************************************************************")); |
|
68 INFO_PRINTF1(_L("\tMOLR Connection error on connection creation")); |
|
69 INFO_PRINTF1(_L("\t********************************************************************")); |
|
70 INFO_PRINTF1(_L("- START -")); |
|
71 // Initiate MO-LR |
|
72 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
73 TLbsNetPosRequestOptionsAssistance options1; |
|
74 options1.SetNewClientConnected(ETrue); |
|
75 TLbsNetPosRequestQuality quality1; |
|
76 options1.SetRequestQuality(quality1); |
|
77 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
78 options1.SetDataRequestMask(dataRequestMask1); |
|
79 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
80 iModule->RequestSelfLocation(sessionId1, options1); |
|
81 |
|
82 // Check Connection Manager receives a request for connecting |
|
83 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
84 { |
|
85 SetTestStepResult(EFail); |
|
86 return TestStepResult(); |
|
87 } |
|
88 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
89 |
|
90 // Fake Connection Manager sending a ConnectionError indication |
|
91 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connection Error (ESecurityInsufficient) <- NET")); |
|
92 iNetworkObserver->InjectConnectionErrorIndication(iNetworkObserver->SessionId(), MSuplConnectionManagerObserver::ESecurityInsufficient); |
|
93 |
|
94 // Check gateway session completed |
|
95 if (EFail == CheckGatewayCallbackL( |
|
96 CSuplGatewayObserver::EProcessSessionComplete)) |
|
97 { |
|
98 SetTestStepResult(EFail); |
|
99 return TestStepResult(); |
|
100 } |
|
101 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
102 |
|
103 // Check Connection Manager receives a disconnection request |
|
104 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
105 { |
|
106 SetTestStepResult(EFail); |
|
107 return TestStepResult(); |
|
108 } |
|
109 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
110 |
|
111 // Check if more observer activity takes place |
|
112 if (iGatewayObserver->IsMoreObserverActivity() || |
|
113 iNetworkObserver->IsMoreObserverActivity()) |
|
114 { |
|
115 SetTestStepResult(EFail); |
|
116 return TestStepResult(); |
|
117 } |
|
118 INFO_PRINTF1(_L("- END -")); |
|
119 |
|
120 SetTestStepResult(EPass); |
|
121 return TestStepResult(); |
|
122 } |
|
123 |
|
124 |
|
125 /** |
|
126 * @return - TVerdict code |
|
127 * Override of base class virtual |
|
128 */ |
|
129 TVerdict Cmolr11Step::doTestStepPostambleL() |
|
130 { |
|
131 delete iModule; |
|
132 |
|
133 // Call base class method for post test actions |
|
134 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
135 return TestStepResult(); |
|
136 } |