|
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 // |
|
15 |
|
16 #include "T_DEF062024_Imap_AttachmentCannotBeOpenedServer.h" |
|
17 #include "t_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.h" |
|
18 |
|
19 _LIT(KServerName,"T_DEF062024_Imap_AttachmentCannotBeOpened"); |
|
20 |
|
21 CImapAttachmentServer* CImapAttachmentServer::NewL() |
|
22 { |
|
23 CImapAttachmentServer * server = new (ELeave) CImapAttachmentServer(); |
|
24 CleanupStack::PushL(server); |
|
25 server-> ConstructL(KServerName); |
|
26 CleanupStack::Pop(server); |
|
27 return server; |
|
28 } |
|
29 |
|
30 CImapAttachmentServer::CImapAttachmentServer() |
|
31 {} |
|
32 |
|
33 CImapAttachmentServer::~CImapAttachmentServer() |
|
34 {} |
|
35 |
|
36 |
|
37 LOCAL_C void MainL() |
|
38 { |
|
39 CActiveScheduler* sched=NULL; |
|
40 sched=new(ELeave) CActiveScheduler; |
|
41 CleanupStack::PushL(sched); |
|
42 CActiveScheduler::Install(sched); |
|
43 CImapAttachmentServer* server = NULL; |
|
44 // Create the CTestServer derived server |
|
45 TRAPD(err,server = CImapAttachmentServer::NewL()); |
|
46 CleanupStack::PushL(server); |
|
47 if(!err) |
|
48 { |
|
49 // Sync with the client and enter the active scheduler |
|
50 RProcess::Rendezvous(KErrNone); |
|
51 sched->Start(); |
|
52 } |
|
53 CleanupStack::PopAndDestroy(2,sched); |
|
54 } |
|
55 |
|
56 |
|
57 GLDEF_C TInt E32Main() |
|
58 { |
|
59 __UHEAP_MARK; |
|
60 |
|
61 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
62 if(cleanup == NULL) |
|
63 { |
|
64 return KErrNoMemory; |
|
65 } |
|
66 TRAPD(err,MainL()); |
|
67 delete cleanup; |
|
68 |
|
69 __UHEAP_MARKEND; |
|
70 return err; |
|
71 } |
|
72 |
|
73 |
|
74 RFs& CImapAttachmentServer::Fs() |
|
75 { |
|
76 return iFs; |
|
77 }; |
|
78 |
|
79 CTestStep* CImapAttachmentServer::CreateTestStep(const TDesC& aStepName) |
|
80 { |
|
81 |
|
82 CTestStep* testStep = NULL; |
|
83 |
|
84 if(aStepName == KTestImapAttachment) |
|
85 testStep = new CTestImapAttachmentStep(); |
|
86 |
|
87 |
|
88 return testStep; |
|
89 } |