|
1 // Copyright (c) 2003-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 // __ACTION_INFO_BEGIN__ |
|
15 // [Action Name] |
|
16 // CreateSession |
|
17 // [Action Parameters] |
|
18 // Session <output>: Reference to the created session. |
|
19 // [Action Description] |
|
20 // Creates a session to the messaging server. |
|
21 // [APIs Used] |
|
22 // MMsvSessionObserver |
|
23 // CMsvSession::OpenSyncL |
|
24 // __ACTION_INFO_END__ |
|
25 // |
|
26 // |
|
27 |
|
28 /** |
|
29 @file |
|
30 */ |
|
31 |
|
32 |
|
33 #include "CMtfTestActionCreateSession.h" |
|
34 #include "CMtfTestCase.h" |
|
35 #include "CMtfTestActionParameters.h" |
|
36 |
|
37 |
|
38 CMtfTestAction* CMtfTestActionCreateSession::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
39 { |
|
40 CMtfTestActionCreateSession* self = new (ELeave) CMtfTestActionCreateSession(aTestCase); |
|
41 CleanupStack::PushL(self); |
|
42 self->ConstructL(aActionParameters); |
|
43 CleanupStack::Pop(); |
|
44 return self; |
|
45 } |
|
46 |
|
47 |
|
48 CMtfTestActionCreateSession::CMtfTestActionCreateSession(CMtfTestCase& aTestCase) |
|
49 : CMtfSynchronousTestAction(aTestCase) |
|
50 { |
|
51 } |
|
52 |
|
53 |
|
54 CMtfTestActionCreateSession::~CMtfTestActionCreateSession() |
|
55 { |
|
56 delete iSessionObserver; |
|
57 } |
|
58 |
|
59 void CMtfTestActionCreateSession::ExecuteActionL() |
|
60 { |
|
61 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCreateSession); |
|
62 iSessionObserver = new (ELeave) CSessionObserver; |
|
63 CMsvSession* paramSession = CMsvSession::OpenSyncL(*iSessionObserver); |
|
64 CleanupStack::PushL(paramSession); |
|
65 |
|
66 StoreParameterL<CMsvSession>(TestCase(),*paramSession,ActionParameters().Parameter(0)); |
|
67 CleanupStack::Pop(paramSession); |
|
68 |
|
69 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCreateSession ); |
|
70 TestCase().ActionCompletedL(*this); |
|
71 } |
|
72 |