|
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 CTESTIMAPCANCELANDFLUSH_H |
|
17 #define CTESTIMAPCANCELANDFLUSH_H |
|
18 |
|
19 #include <test/tefunit.h> |
|
20 |
|
21 #include "cfakeinputstream.h" |
|
22 #include "cactivewaiter.h" |
|
23 |
|
24 // Forward Declarations |
|
25 class CFakeOutputStream; |
|
26 class CImapSession; |
|
27 |
|
28 /** |
|
29 This test fixture tests the Cancel() and FlushCancelledCommand() |
|
30 functionality of CImapSession |
|
31 @internalTechnology |
|
32 @prototype |
|
33 */ |
|
34 class CTestImapCancelAndFlush : public CActiveTestFixture |
|
35 , public MFakeInputStreamIsEmptyObserver |
|
36 , public MActiveWaiterObserver |
|
37 // Note that all test suites must begin with "CTest" |
|
38 // WARNING: Despite being a C class, CActiveTestFixture is NOT derrived from CBase |
|
39 // ... so don't expect your data members to be zero'ed |
|
40 { |
|
41 public: |
|
42 // Constructor & Destructor (explicitly virtual because CTestFixture is NOT derrived from CBase) |
|
43 CTestImapCancelAndFlush(); |
|
44 virtual ~CTestImapCancelAndFlush(); |
|
45 |
|
46 // SetUp and TearDown code (optional) |
|
47 virtual void SetupL(); |
|
48 virtual void TearDownL(); |
|
49 |
|
50 // Implement MFakeInputStreamIsEmptyObserver |
|
51 void OnInputStreamIsEmptyL(); |
|
52 |
|
53 // Implement MActiveWaiterObserver |
|
54 void DoCancel(); |
|
55 |
|
56 // Tests |
|
57 void TestListInPartsL(); |
|
58 void TestCancelAndFlushL(); |
|
59 void TestCancelAndFlushWithTimeoutL(); |
|
60 |
|
61 static CTestSuite* CreateSuiteL(const TDesC& aName); |
|
62 |
|
63 private: |
|
64 CFakeInputStream* iInputStream; |
|
65 CFakeOutputStream* iOutputStream; |
|
66 CActiveWaiter* iActiveWaiter; |
|
67 CImapSession* iImapSession; |
|
68 |
|
69 enum |
|
70 { |
|
71 ENotifyOpCancelWaitActive, |
|
72 ENotifyOpListInParts, |
|
73 } |
|
74 iInputStreamNotifyOp; |
|
75 }; |
|
76 |
|
77 #endif // CTESTIMAPCANCELANDFLUSH_H |