messagingfw/msgtest/integration/email/inc/emailsmoke.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 1999-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 <e32test.h>
       
    17 #include <csdprog.h>
       
    18 #include "emailtestutils.h"
       
    19 #include "testframeutils.h"
       
    20 
       
    21 #ifndef EMAILSMOKE_H
       
    22 #define EMAILSMOKE_H
       
    23 
       
    24 
       
    25 #define KInvalidState	-99  //Invalid progress state
       
    26 #define KInvalidIAP	-99 
       
    27 //
       
    28 //
       
    29 // MBaseTestState
       
    30 //
       
    31 
       
    32 class MBaseTestState
       
    33 	{
       
    34 public:
       
    35 	virtual void StartL(TRequestStatus& aStatus) = 0;
       
    36 	virtual ~MBaseTestState() {};
       
    37 
       
    38 	void SetDebugInfo(const TTestDebugInfo& aDebugInfo) {iDebugInfo = aDebugInfo;};
       
    39 	const TTestDebugInfo& GetDebugInfo() const {return iDebugInfo;};
       
    40 
       
    41 protected:
       
    42 	TTestDebugInfo iDebugInfo;
       
    43 	};
       
    44 
       
    45 class TTestDebugInfo;
       
    46 
       
    47 //
       
    48 //
       
    49 // CBaseTestHarness
       
    50 //
       
    51 
       
    52 class CBaseTestHarness : public CActive, public MBaseTestState
       
    53 	{
       
    54 public:
       
    55 	virtual ~CBaseTestHarness();
       
    56 
       
    57 	virtual void StartL(TRequestStatus& aStatus);
       
    58 
       
    59 	virtual void AddStateL(MBaseTestState* aTestState, TTestDebugInfo aDebugInfo);
       
    60 
       
    61 	virtual void LogComment(const TDesC& aError);
       
    62 	
       
    63 	// From CActive
       
    64 	void RunL();
       
    65 	void DoCancel();
       
    66 	TInt RunError(TInt aError);
       
    67 	RTest& TestConsole();
       
    68 
       
    69 protected:
       
    70 	virtual void ConstructL();
       
    71 	CBaseTestHarness(RTest& aTest);
       
    72 
       
    73 	TInt iCurrentState;
       
    74 	TRequestStatus* iReportStatus;
       
    75 
       
    76 	RTest& iTest;
       
    77 	CArrayPtrFlat<MBaseTestState>* iStateList;
       
    78 
       
    79 private:
       
    80 //	CTestScript& iScript;
       
    81 	};
       
    82 
       
    83 
       
    84 //
       
    85 //
       
    86 // CMainTestHarness
       
    87 //
       
    88 
       
    89 class CMainTestHarness : public CBaseTestHarness
       
    90 	{
       
    91 public:
       
    92 	static CMainTestHarness* NewL(RTest& aTest);
       
    93 	virtual void StartL(TRequestStatus& aStatus);
       
    94 
       
    95 protected:
       
    96 	virtual void ConstructL();
       
    97 	CMainTestHarness(RTest& aTest);
       
    98 	};
       
    99 
       
   100 
       
   101 //
       
   102 //
       
   103 // CMsvClientTest
       
   104 //
       
   105 
       
   106 class CMsvClientTest : public CBaseTestHarness
       
   107 	{
       
   108 public:
       
   109 	static CMsvClientTest* NewL(CEmailTestUtils& aTestUtils, RTest& aTest);
       
   110 	static CMsvClientTest* NewL(CEmailTestUtils* aTestUtils, RTest& aTest);
       
   111 	virtual ~CMsvClientTest();
       
   112 	CEmailTestUtils& MsvTestUtils();
       
   113 	void DoCancel();
       
   114 	void SetCurrentOperation(CMsvOperation* aOperation);
       
   115 	CMsvOperation& CurrentOperation();
       
   116 
       
   117 protected:
       
   118 	virtual void ConstructL();
       
   119 	CMsvClientTest(CEmailTestUtils& aMsvTestUtils, RTest& aTest);
       
   120 	CMsvClientTest(CEmailTestUtils* aMsvTestUtils, RTest& aTest);
       
   121 
       
   122 public:
       
   123 	CMsvEntrySelection* iCurrentSelection;
       
   124 	TMsvId iSelectedFolder;
       
   125 	TMsvId iDestinationFolder;
       
   126 	TMsvId iCurrentServiceId;
       
   127 
       
   128 protected:
       
   129 	CEmailTestUtils& iMsvTestUtils;
       
   130 
       
   131 private:
       
   132 	CMsvTestUtils* iOwnedMsvTestUtils;
       
   133 	CMsvOperation* iOperation;
       
   134 	};
       
   135 
       
   136 
       
   137 
       
   138 //
       
   139 //
       
   140 // CEmailClientTest
       
   141 //
       
   142 
       
   143 class CEmailClientTest : public CMsvClientTest
       
   144 	{
       
   145 public:
       
   146 	static CEmailClientTest* NewL(CEmailTestUtils& aTestUtils, RTest& aTest);
       
   147 	static CEmailClientTest* NewL(CEmailTestUtils* aTestUtils, RTest& aTest);
       
   148 	virtual ~CEmailClientTest();
       
   149 
       
   150 	void LogComment(const TDesC& aError);
       
   151 
       
   152 	CEmailTestUtils& EmailTestUtils();
       
   153 protected:
       
   154 	virtual void ConstructL();
       
   155 	CEmailClientTest(CEmailTestUtils& aTestUtils, RTest& aTest);
       
   156 	CEmailClientTest(CEmailTestUtils* aTestUtils, RTest& aTest);
       
   157 
       
   158 protected:
       
   159 	CEmailTestUtils& iEmailTestUtils;
       
   160 
       
   161 private:
       
   162 	CEmailTestUtils* iOwnedEmailTestUtils;
       
   163 	};
       
   164 
       
   165 #endif