24
|
1 |
// Copyright (c) 2008-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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file The TEFUnit integration test suite for MBMS Context support in the Common TSY.
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include "cctsyucasembms013.h"
|
|
21 |
#include "cctsyactiveretriever.h"
|
|
22 |
#include <etel.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
#include <et_clsvr.h>
|
|
25 |
#include <ctsy/mmtsy_names.h>
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include "tmockltsydata.h"
|
|
28 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
29 |
|
|
30 |
#include <pcktcs.h>
|
|
31 |
#include <pcktlist.h>
|
|
32 |
#include "pcktretrieve.h"
|
|
33 |
#include "CMmCommonStaticUtility.h"
|
|
34 |
#include <ctsy/serviceapi/mmtsy_defaults.h>
|
|
35 |
|
|
36 |
CTestSuite* CCTsyUCaseMbms013::CreateSuiteL(const TDesC& aName)
|
|
37 |
{
|
|
38 |
SUB_SUITE;
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms013, CCtsyIntegrationTestMbms0001L );
|
|
40 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms013, CCtsyIntegrationTestMbms0002L );
|
|
41 |
END_SUITE;
|
|
42 |
}
|
|
43 |
|
|
44 |
//
|
|
45 |
// Actual test cases
|
|
46 |
//
|
|
47 |
|
|
48 |
/**
|
|
49 |
* @SYMTestCaseID BA-CTSY-INT-MB-0023
|
|
50 |
* @SYMFssID: BA/CTSY/INT/MB/0023
|
|
51 |
* @SYMTestCaseDesc MBMS local context Creation
|
|
52 |
* @SYMTestPriority High
|
|
53 |
* @SYMTestActions RPacketContext::SetConfig, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketService::EnumerateNifs, RPacketService::GetContextNameInNif, RPacketService::GetNifInfo, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate
|
|
54 |
* @SYMTestExpectedResults Pass - New context is created.
|
|
55 |
* @SYMTestType CIT
|
|
56 |
* @SYMTestCaseDependencies live/manual
|
|
57 |
*
|
|
58 |
* Reason for test: Opening succesfully context.
|
|
59 |
*
|
|
60 |
* @return - none
|
|
61 |
*/
|
|
62 |
void CCTsyUCaseMbms013::CCtsyIntegrationTestMbms0001L()
|
|
63 |
{
|
|
64 |
|
|
65 |
//
|
|
66 |
// SET UP
|
|
67 |
//
|
|
68 |
|
|
69 |
OpenEtelServerL( EUseExtendedError );
|
|
70 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
71 |
OpenPhoneL();
|
|
72 |
|
|
73 |
RPacketService packetService;
|
|
74 |
OpenPacketServiceL( packetService );
|
|
75 |
CleanupClosePushL( packetService );
|
|
76 |
|
|
77 |
//
|
|
78 |
// SET UP END
|
|
79 |
//
|
|
80 |
|
|
81 |
//
|
|
82 |
// TEST START
|
|
83 |
//
|
|
84 |
|
|
85 |
// Client requests Open New MBMS context from ETEL API.
|
|
86 |
TInfoName contextId;
|
|
87 |
TInfoName hostCid;
|
|
88 |
RPacketMbmsContext packetMbmsContext;
|
|
89 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
90 |
CleanupClosePushL( packetMbmsContext );
|
|
91 |
|
|
92 |
// Ensure a proper name is gevien to mbms context
|
|
93 |
ASSERT_EQUALS( 0, contextId.Match(_L("MBMS_Context_0")));
|
|
94 |
|
|
95 |
//
|
|
96 |
// TEST END
|
|
97 |
//
|
|
98 |
|
|
99 |
AssertMockLtsyStatusL();
|
|
100 |
|
|
101 |
CleanupStack::PopAndDestroy( 3 ); //packetMbmsContext, packetService, this
|
|
102 |
}
|
|
103 |
|
|
104 |
/**
|
|
105 |
* @SYMTestCaseID BA-CTSY-INT-MB-0024
|
|
106 |
* @SYMFssID: BA/CTSY/INT/MB/0024
|
|
107 |
* @SYMTestCaseDesc Creating too many MBMS local context
|
|
108 |
* @SYMTestPriority High
|
|
109 |
* @SYMTestActions RPacketContext::SetConfig, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketService::EnumerateNifs, RPacketService::GetContextNameInNif, RPacketService::GetNifInfo, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate
|
|
110 |
* @SYMTestExpectedResults Pass - Error KErrMaxExceeded raised.
|
|
111 |
* @SYMTestType CIT
|
|
112 |
* @SYMTestCaseDependencies live/manual
|
|
113 |
*
|
|
114 |
* Reason for test: Opening too many contexts.
|
|
115 |
*
|
|
116 |
* @return - none
|
|
117 |
*/
|
|
118 |
void CCTsyUCaseMbms013::CCtsyIntegrationTestMbms0002L()
|
|
119 |
{
|
|
120 |
|
|
121 |
//
|
|
122 |
// SET UP
|
|
123 |
//
|
|
124 |
|
|
125 |
OpenEtelServerL( EUseExtendedError );
|
|
126 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
127 |
OpenPhoneL();
|
|
128 |
|
|
129 |
//
|
|
130 |
// SET UP END
|
|
131 |
//
|
|
132 |
|
|
133 |
//
|
|
134 |
// TEST START
|
|
135 |
//
|
|
136 |
|
|
137 |
|
|
138 |
// If max number of MBMS context exceeded, CTSY completes Open
|
|
139 |
// New MBMS context with KErrMaxExceeded
|
|
140 |
TInt status, maxSessions( 10 );
|
|
141 |
|
|
142 |
RPacketService packetService;
|
|
143 |
OpenPacketServiceL( packetService,
|
|
144 |
RPacketService::EStatusUnattached,
|
|
145 |
RPacketService::EAttachWhenNeeded,
|
|
146 |
maxSessions,
|
|
147 |
maxSessions );
|
|
148 |
CleanupClosePushL( packetService );
|
|
149 |
|
|
150 |
// === Check context and service statuses ===
|
|
151 |
// Open new context
|
|
152 |
TInfoName contextId;
|
|
153 |
TInfoName hostCid;
|
|
154 |
|
|
155 |
for( TInt i = 0; i < maxSessions; i++ )
|
|
156 |
{
|
|
157 |
RPacketMbmsContext packetMbmsContext;
|
|
158 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
159 |
CleanupClosePushL( packetMbmsContext );
|
|
160 |
}
|
|
161 |
// max number of contexts exceed, add one;
|
|
162 |
RPacketMbmsContext maxMbmsContext;
|
|
163 |
status = maxMbmsContext.OpenNewContext( packetService, contextId );
|
|
164 |
CleanupClosePushL( maxMbmsContext );
|
|
165 |
|
|
166 |
ASSERT_EQUALS( KErrOverflow, status );
|
|
167 |
|
|
168 |
//
|
|
169 |
// TEST END
|
|
170 |
//
|
|
171 |
|
|
172 |
AssertMockLtsyStatusL();
|
|
173 |
|
|
174 |
CleanupStack::PopAndDestroy( maxSessions ); //maxSessions
|
|
175 |
CleanupStack::PopAndDestroy( 3 ); //packetService, maxMbmsContext, this
|
|
176 |
}
|
|
177 |
|