|
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 // |
|
15 |
|
16 #ifndef CTESTIMAPFETCHBODY_H |
|
17 #define CTESTIMAPFETCHBODY_H |
|
18 |
|
19 #include "cfakeinputstream.h" |
|
20 #include "cfakeoutputstream.h" |
|
21 #include "cfetchbodyinfo.h" |
|
22 #include "cimapmailstore.h" |
|
23 #include <test/tefunit.h> |
|
24 |
|
25 #include "cfakeinputstream.h" |
|
26 #include "cactivewaiter.h" |
|
27 |
|
28 // Forward Declarations |
|
29 class CFakeOutputStream; |
|
30 class CImapSession; |
|
31 class CImapMailStore; |
|
32 class CImapFetchBodyResponse; |
|
33 class CImapSettings; |
|
34 class CMsvServer; |
|
35 |
|
36 /** |
|
37 This test fixture tests CImapCreate. |
|
38 @internalTechnology |
|
39 @prototype |
|
40 */ |
|
41 class CTestImapFetchBody : public CActiveTestFixture |
|
42 , public MFakeInputStreamIsEmptyObserver |
|
43 , public MActiveWaiterObserver |
|
44 // Note that all test suites must begin with "CTest" |
|
45 // WARNING: Despite being a C class, CActiveTestFixture is NOT derrived from CBase |
|
46 // ... so don't expect your data members to be zero'ed |
|
47 { |
|
48 public: |
|
49 // Constructor & Destructor (explicitly virtual because CTestFixture is NOT derrived from CBase) |
|
50 CTestImapFetchBody(); |
|
51 virtual ~CTestImapFetchBody(); |
|
52 |
|
53 // SetUp and TearDown code (optional) |
|
54 virtual void SetupL(); |
|
55 virtual void TearDownL(); |
|
56 |
|
57 // Implement MFakeInputStreamIsEmptyObserver |
|
58 void OnInputStreamIsEmptyL(); |
|
59 |
|
60 // Implement MActiveWaiterObserver |
|
61 void DoCancel(); |
|
62 |
|
63 // Tests |
|
64 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT) |
|
65 void TestFetchBinaryBodyL(); |
|
66 void TestFetchBinaryBodyWithCancelL(); |
|
67 #endif |
|
68 void TestFetchBodyL(); |
|
69 void TestFetchBodyWithCancelL(); |
|
70 void TestFetchMultiChunkBodyL(); |
|
71 void TestFetchBodyWithMimeL(); |
|
72 void TestFetchBodyWithMimeZeroAngelBracketL(); |
|
73 void TestFetchBodyWithMime2L(); |
|
74 void TestFetchBodyWithNoBodyLengthInServerResponseL(); |
|
75 void TestFetchBodyWithNilMimeL(); |
|
76 void TestFetchBodyWithEmptyMimeL(); |
|
77 |
|
78 static CTestSuite* CreateSuiteL(const TDesC& aName); |
|
79 |
|
80 private: |
|
81 void CreateMessageStructureL(TMsvId aId); |
|
82 private: |
|
83 CFakeInputStream* iInputStream; |
|
84 CFakeOutputStream* iOutputStream; |
|
85 CActiveWaiter* iActiveWaiter; |
|
86 CImapSession* iImapSession; |
|
87 CFetchBodyInfo* iFetchBodyInfo; |
|
88 TMsvId iMsvMessageEntry; |
|
89 TMsvId iAttMessageEntry; |
|
90 TMsvId iBodyMessageEntry; |
|
91 TMsvId iFolderId; |
|
92 CImapSettings* iImapSettings; |
|
93 CImapMailStore* iImapMailStore; |
|
94 CMsvServerEntry* iServerEntry; |
|
95 CImapFetchBodyResponse* iFetchBodyResponse; |
|
96 CMsvServer* iMsvServer; |
|
97 }; |
|
98 |
|
99 #endif CTESTIMAPFETCHBODY_H |