email/pop3andsmtpmtm/imapservermtm/test/inc/t_test_decode_step.h
changeset 25 84d9eb65b26f
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     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 #ifndef __T_TEST_DECODE_STEP_H__
       
    17 #define __T_TEST_DECODE_STEP_H__
       
    18  
       
    19 #include <test\testexecutestepbase.h>
       
    20 #include "emailtestutils.h"
       
    21 #include "smstestutils.h"
       
    22 #include <stdlib.h>
       
    23 #include <msvapi.h>
       
    24 #include <smuthdr.h> 
       
    25 #include <iapprefs.h>
       
    26 #include "t_decodeserver.h"
       
    27 #include "decodeimapclient.h"
       
    28 
       
    29 const TInt KMaxBufferSize = 5000;
       
    30 
       
    31 
       
    32 enum TBufferType 
       
    33 	{
       
    34 	EUndefinedBuffer = -1,
       
    35 	EBodyBuffer = 0,
       
    36 	EAttachmentBuffer = 1
       
    37 	};
       
    38 
       
    39 class TBuffer
       
    40 	{
       
    41 public:
       
    42 	TBuf8< KMaxBufferSize > iBuffer;
       
    43 	TBufferType iBufferType;
       
    44 	TBool iAllowJunkAtEnd;
       
    45 	};
       
    46 
       
    47 //
       
    48 // CTestDecode
       
    49 //
       
    50 
       
    51 class CTestDecode : public CTestStep , MImapTestEventHandler
       
    52 	{
       
    53 public:
       
    54 	CTestDecode( );
       
    55 	virtual ~CTestDecode( );
       
    56 	virtual TVerdict doTestStepPreambleL( );
       
    57 	virtual TVerdict doTestStepPostambleL( );
       
    58 	virtual TVerdict doTestStepL( );
       
    59 private:
       
    60 	void GetDetailsFromIniFileL( );
       
    61 	void CreateImapAccountL( );
       
    62 	void TraverseL( const TMsvId aTMsvId );
       
    63 	TVerdict CheckBuffer( const TDesC8& aActualBuffer, 
       
    64 						  const TDesC8& aExpectedBuffer, 
       
    65 						  TBool aAllowJunkAtEnd );
       
    66 	virtual void TestComplete( TInt aErrorCode );
       
    67 	
       
    68 	TBufferType ConvertToBufferType( const TDesC& aBufferTypeDesc );
       
    69 	
       
    70 private:
       
    71 	CSpoofServer* iSpoofServer;
       
    72 	CActiveImapClient* iImapClient;
       
    73 	CConsoleBase* iConsole;
       
    74 	CActiveScheduler* iScheduler;
       
    75 	TMsvId	iImapService;
       
    76 	CEmailTestUtils* iTestUtils;
       
    77 	CMsvSession* iSession;
       
    78 	TDummySessionObserver* iSessionObserver;
       
    79 	TPtrC16 iScriptFile;
       
    80 	TBool iFetchWholeMessage;
       
    81 
       
    82 	CDesC8ArraySeg* iActualPartsBuffer;
       
    83 	CArrayFixSeg< TBuffer >* iExpectedPartsBuffer;
       
    84 
       
    85 	RFs iFs;
       
    86 	};
       
    87 
       
    88  		
       
    89 _LIT( KTestDecode, "TestDecode" );
       
    90 	
       
    91 #endif  //__T_TEST_DECODE_STEP_H__