email/imap4mtm/imapsession/test/inc/ctestimapservereventwait.h
changeset 80 8b14b30db193
parent 0 72b543305e3a
equal deleted inserted replaced
79:2981cb3aa489 80:8b14b30db193
       
     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 CTESTIMAPSERVEREVENTWAIT_H
       
    17 #define CTESTIMAPSERVEREVENTWAIT_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 CTestImapServerEventWait.
       
    30 @internalTechnology
       
    31 @prototype
       
    32 */
       
    33 class CTestImapServerEventWait  : public CActiveTestFixture
       
    34 								, public MFakeInputStreamIsEmptyObserver
       
    35 								, public MActiveWaiterObserver
       
    36 // Note that all test suites must begin with "CTest"
       
    37 // WARNING: Despite being a C class, CActiveTestFixture is NOT derrived from CBase
       
    38 // ... so don't expect your data members to be zero'ed
       
    39 	{
       
    40 public:
       
    41 	// Constructor & Destructor (explicitly virtual because CTestFixture is NOT derrived from CBase)
       
    42 	CTestImapServerEventWait();
       
    43 	virtual ~CTestImapServerEventWait();
       
    44 	
       
    45 	// SetUp and TearDown code (optional)
       
    46 	virtual void SetupL();
       
    47 	virtual void TearDownL();
       
    48 	
       
    49 	// Tests
       
    50 	void TestSimpleL();
       
    51 	void TestTwoEventsL();
       
    52 	void TestCancelAfterNoEventL();
       
    53 	void TestCancelAfterWholeEventL();
       
    54 	void TestCancelDuringEventL();
       
    55 		
       
    56 	static CTestSuite* CreateSuiteL(const TDesC& aName);
       
    57 	
       
    58 	// Implement MFakeInputStreamIsEmptyObserver
       
    59 	void OnInputStreamIsEmptyL();
       
    60 	
       
    61 	// Implement MActiveWaiterObserver
       
    62 	void DoCancel();
       
    63 	
       
    64 private:
       
    65 	CFakeInputStream* iInputStream;
       
    66 	CFakeOutputStream* iOutputStream;
       
    67 	CActiveWaiter* iActiveWaiter;
       
    68 	CImapSession* iImapSession;
       
    69 	
       
    70 	enum 
       
    71 		{
       
    72 		ENotifyOpCompleteXLiteralAndCancel
       
    73 		} 
       
    74 		iInputStreamNotifyOp;
       
    75 	};
       
    76 	
       
    77 #endif // CTESTIMAPSERVEREVENTWAIT_H