messagingfw/msgurlhandler/test/basic/inc/MailtoSchemeHandlerTransitions.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 1997-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 // The definitions of the transition classes upon the CMailtoSchemeHandler class methods.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @SYMCreationDate Created : 24/05/01 15:57:46
       
    21 */
       
    22 
       
    23 #ifndef __MAILTOSCHEMEHANDLERTRANSITIONS_H__
       
    24 #define __MAILTOSCHEMEHANDLERTRANSITIONS_H__
       
    25 
       
    26 
       
    27 #include "emailtestutils.h"
       
    28 
       
    29 #include <ecom/test_bed/testutilities.h>
       
    30 #include <ecom/test_bed/stateaccessor.h>
       
    31 #include <ecom/test_bed/leaktesttransition.h>
       
    32 #include <ecom/test_bed/datalogger.h>
       
    33 #include "MTSCHEME.H"
       
    34 #include "MailtoSchemeHandlerStateAccessor.h"
       
    35 #include <ecom/test_bed/unittest.h>
       
    36 
       
    37 #define CTransitionType CLeakTestTransition
       
    38 //#define CTransitionType CTransition
       
    39 
       
    40 // ______________________________________________________________________________
       
    41 //
       
    42 /**
       
    43 	@internalTechnology
       
    44 	@class
       
    45 	Comments : Provide all the CMailtoSchemeHandler specific
       
    46 	parameters and behaviour on the CMailtoSchemeHandler
       
    47 	test class for a transition.
       
    48  */
       
    49 class CMailtoSchemeHandler_UnitTestContext : public CUnitTestContext
       
    50 	{
       
    51 public:
       
    52 	/**
       
    53 		@fn				CMailtoSchemeHandler_UnitTestContext(CDataLogger& aDataLogger,
       
    54 														MStateAccessor& aStateAccessor,
       
    55 														MTransitionObserver& aObserver)
       
    56 		Intended Usage	: Default constructor.
       
    57 		Error Condition	: None. 
       
    58 		@since			6.0
       
    59 		@param			aDataLogger The output logging object.
       
    60 		@param			aObserver The observer of this UnitTest's Transitions.
       
    61 		@param			aStateAccessor WhiteBox state access to the CMailtoSchemeHandler class under test.
       
    62 		@pre 			None.
       
    63 		@post			CMailtoSchemeHandler_UnitTestContext is fully constructed, and initialised.
       
    64 	*/
       
    65 	inline CMailtoSchemeHandler_UnitTestContext(CDataLogger& aDataLogger,
       
    66 										MStateAccessor& aStateAccessor,
       
    67 										MTransitionObserver& aObserver);
       
    68 
       
    69 	/**
       
    70 		@fn				~CMailtoSchemeHandler_UnitTestContext()
       
    71 		Intended Usage	: Default Destructor
       
    72 		@since			6.0
       
    73 		@pre 			CMailtoSchemeHandler_UnitTestContext is fully constructed.
       
    74 		@post			CMailtoSchemeHandler_UnitTestContext is fully destroyed
       
    75 		*/
       
    76 		virtual inline ~CMailtoSchemeHandler_UnitTestContext();
       
    77 
       
    78 	/** The instance of the class under test */
       
    79 	CMailtoSchemeHandler* iMailtoSchemeHandler;
       
    80 	const TDesC* iUrl;
       
    81 	TPtrC iBody;
       
    82 	TBool iVisible;
       
    83 	TMsvId iId;
       
    84 
       
    85 	RArray<TPtrC> iArray;
       
    86 	const TDesC* iSubjectCheck;
       
    87 	const TDesC* iBodyCheck;
       
    88 
       
    89 	}; // CMailtoSchemeHandler_UnitTestContext
       
    90 
       
    91 // ______________________________________________________________________________
       
    92 //
       
    93 /**
       
    94 	@internalTechnology
       
    95 	@class
       
    96 	Comments : Transition test of the CMailtoSchemeHandler::NewL method.
       
    97  */
       
    98 class CMailtoSchemeHandler_NewL_Transition : public CTransitionType
       
    99 	{
       
   100 public:
       
   101 	/**
       
   102 		@fn				CMailtoSchemeHandler_NewL_Transition(CUnitTestContext& aUTContext,
       
   103 																	TTransitionValidator& aValidator)
       
   104 		Intended Usage	: Standard c'tor method.
       
   105 		Error Condition	: None.
       
   106 		@since			6.0
       
   107 		@param			aUTContext The context this transition is operating in.
       
   108 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   109 		@pre 			None.
       
   110 		@post			CMailtoSchemeHandler_NewL_Transition is fully constructed.
       
   111 	*/
       
   112 	CMailtoSchemeHandler_NewL_Transition(CUnitTestContext& aUTContext,
       
   113 													TTransitionValidator& aValidator);
       
   114 	/**
       
   115 		@fn				TransitMethodL()
       
   116 		Intended Usage	: To execute the CMailtoSchemeHandler::NewL method for the test harness.
       
   117 		Error Condition	: Leaves with an error code.
       
   118 		@leave		KErrNoMemory, (@see CMailtoSchemeHandler::NewL)
       
   119 		@since			6.0
       
   120 		@return			None
       
   121 		@pre 			CMailtoSchemeHandler_NewL_Transition is fully constructed.
       
   122 		@post			No change in the CMailtoSchemeHandler_NewL_Transition apart
       
   123 						from iMailtoSchemeHandler, which may have changed state.
       
   124 						(@see CMailtoSchemeHandler::NewL post-condition) for iMailtoSchemeHandler's new state.
       
   125 	*/
       
   126 	inline void TransitMethodL();
       
   127 
       
   128 	/**
       
   129 		@fn				Context() const
       
   130 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   131 		Error Condition	: None.
       
   132 		@since			6.0
       
   133 		@return			The unit test context cast to a CMailtoSchemeHandler_UnitTestContext
       
   134 		@pre 			iUTContext is a valid CMailtoSchemeHandler_UnitTestContext.
       
   135 		@post			No change in the CMailtoSchemeHandler_NewL_Transition
       
   136 	*/
       
   137 	inline CMailtoSchemeHandler_UnitTestContext& Context() const;
       
   138 	};	// CMailtoSchemeHandler_NewL_Transition
       
   139 
       
   140 // ______________________________________________________________________________
       
   141 //
       
   142 /**
       
   143 	@internalTechnology
       
   144 	@class
       
   145 	Comments : Transition test of the CMailtoSchemeHandler::Dtor method.
       
   146  */
       
   147 class CMailtoSchemeHandler_Dtor_Transition : public CTransitionType
       
   148 	{
       
   149 public:
       
   150 	/**
       
   151 		@fn				CMailtoSchemeHandler_Dtor_Transition(CUnitTestContext& aUTContext,
       
   152 																	TTransitionValidator& aValidator)
       
   153 		Intended Usage	: Standard c'tor method.
       
   154 		Error Condition	: None.
       
   155 		@since			6.0
       
   156 		@param			aUTContext The context this transition is operating in.
       
   157 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   158 		@pre 			None.
       
   159 		@post			CMailtoSchemeHandler_Dtor_Transition is fully constructed.
       
   160 	*/
       
   161 	CMailtoSchemeHandler_Dtor_Transition(CUnitTestContext& aUTContext,
       
   162 													TTransitionValidator& aValidator);
       
   163 	/**
       
   164 		@fn				TransitMethodL()
       
   165 		Intended Usage	: To execute the CMailtoSchemeHandler::Dtor method for the test harness.
       
   166 		Error Condition	: Leaves with an error code.
       
   167 		@leave		KErrNoMemory, (@see CMailtoSchemeHandler::Dtor)
       
   168 		@since			6.0
       
   169 		@return			None
       
   170 		@pre 			CMailtoSchemeHandler_Dtor_Transition is fully constructed.
       
   171 		@post			No change in the CMailtoSchemeHandler_Dtor_Transition apart
       
   172 						from iMailtoSchemeHandler, which may have changed state.
       
   173 						(@see CMailtoSchemeHandler::Dtor post-condition) for iMailtoSchemeHandler's new state.
       
   174 	*/
       
   175 	inline void TransitMethodL();
       
   176 
       
   177 	/**
       
   178 		@fn				Context() const
       
   179 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   180 		Error Condition	: None.
       
   181 		@since			6.0
       
   182 		@return			The unit test context cast to a CMailtoSchemeHandler_UnitTestContext
       
   183 		@pre 			iUTContext is a valid CMailtoSchemeHandler_UnitTestContext.
       
   184 		@post			No change in the CMailtoSchemeHandler_Dtor_Transition
       
   185 	*/
       
   186 	inline CMailtoSchemeHandler_UnitTestContext& Context() const;
       
   187 	};	// CMailtoSchemeHandler_Dtor_Transition
       
   188 
       
   189 
       
   190 // ______________________________________________________________________________
       
   191 //
       
   192 /**
       
   193 	@internalTechnology
       
   194 	@class
       
   195 	Comments : Transition test of the CMailtoSchemeHandler::ParseUrlL method.
       
   196  */
       
   197 class CMailtoSchemeHandler_ParseUrlL_Transition : public CTransitionType
       
   198 	{
       
   199 public:
       
   200 	/**
       
   201 		@fn				CMailtoSchemeHandler_ParseUrlL_Transition(CUnitTestContext& aUTContext,
       
   202 																	TTransitionValidator& aValidator)
       
   203 		Intended Usage	: Standard c'tor method.
       
   204 		Error Condition	: None.
       
   205 		@since			6.0
       
   206 		@param			aUTContext The context this transition is operating in.
       
   207 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   208 		@pre 			None.
       
   209 		@post			CMailtoSchemeHandler_ParseUrlL_Transition is fully constructed.
       
   210 	*/
       
   211 	CMailtoSchemeHandler_ParseUrlL_Transition(CUnitTestContext& aUTContext,
       
   212 													TTransitionValidator& aValidator);
       
   213 	/**
       
   214 		@fn				TransitMethodL()
       
   215 		Intended Usage	: To execute the CMailtoSchemeHandler::ParseUrlL method for the test harness.
       
   216 		Error Condition	: Leaves with an error code.
       
   217 		@leave		KErrNoMemory, (@see CMailtoSchemeHandler::ParseUrlL)
       
   218 		@since			6.0
       
   219 		@return			None
       
   220 		@pre 			CMailtoSchemeHandler_ParseUrlL_Transition is fully constructed.
       
   221 		@post			No change in the CMailtoSchemeHandler_ParseUrlL_Transition apart
       
   222 						from iMailtoSchemeHandler, which may have changed state.
       
   223 						(@see CMailtoSchemeHandler::ParseUrlL post-condition) for iMailtoSchemeHandler's new state.
       
   224 	*/
       
   225 	inline void TransitMethodL();
       
   226 
       
   227 	/**
       
   228 		@fn				Context() const
       
   229 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   230 		Error Condition	: None.
       
   231 		@since			6.0
       
   232 		@return			The unit test context cast to a CMailtoSchemeHandler_UnitTestContext
       
   233 		@pre 			iUTContext is a valid CMailtoSchemeHandler_UnitTestContext.
       
   234 		@post			No change in the CMailtoSchemeHandler_ParseUrlL_Transition
       
   235 	*/
       
   236 	inline CMailtoSchemeHandler_UnitTestContext& Context() const;
       
   237 	};	// CMailtoSchemeHandler_ParseUrlL_Transition
       
   238 
       
   239 
       
   240 
       
   241 
       
   242 // ______________________________________________________________________________
       
   243 //
       
   244 /**
       
   245 	@internalTechnology
       
   246 	@class
       
   247 	Comments : Transition test of the CMailtoSchemeHandler::ParseUrlAndSendL method.
       
   248  */
       
   249 class CMailtoSchemeHandler_ParseUrlAndSendL_Transition : public CTransition
       
   250 	{
       
   251 public:
       
   252 	/**
       
   253 		@fn				CMailtoSchemeHandler_ParseUrlAndSendL_Transition(CUnitTestContext& aUTContext,
       
   254 																	TTransitionValidator& aValidator)
       
   255 		Intended Usage	: Standard c'tor method.
       
   256 		Error Condition	: None.
       
   257 		@since			6.0
       
   258 		@param			aUTContext The context this transition is operating in.
       
   259 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   260 		@pre 			None.
       
   261 		@post			CMailtoSchemeHandler_ParseUrlAndSendL_Transition is fully constructed.
       
   262 	*/
       
   263 	CMailtoSchemeHandler_ParseUrlAndSendL_Transition(CUnitTestContext& aUTContext,
       
   264 													TTransitionValidator& aValidator);
       
   265 	/**
       
   266 		@fn				TransitMethodL()
       
   267 		Intended Usage	: To execute the CMailtoSchemeHandler::ParseUrlAndSendL method for the test harness.
       
   268 		Error Condition	: Leaves with an error code.
       
   269 		@leave		KErrNoMemory, (@see CMailtoSchemeHandler::ParseUrlAndSendL)
       
   270 		@since			6.0
       
   271 		@return			None
       
   272 		@pre 			CMailtoSchemeHandler_ParseUrlAndSendL_Transition is fully constructed.
       
   273 		@post			No change in the CMailtoSchemeHandler_ParseUrlAndSendL_Transition apart
       
   274 						from iMailtoSchemeHandler, which may have changed state.
       
   275 						(@see CMailtoSchemeHandler::ParseUrlAndSendL post-condition) for iMailtoSchemeHandler's new state.
       
   276 	*/
       
   277 	inline void TransitMethodL();
       
   278 
       
   279 	/**
       
   280 		@fn				Context() const
       
   281 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   282 		Error Condition	: None.
       
   283 		@since			6.0
       
   284 		@return			The unit test context cast to a CMailtoSchemeHandler_UnitTestContext
       
   285 		@pre 			iUTContext is a valid CMailtoSchemeHandler_UnitTestContext.
       
   286 		@post			No change in the CMailtoSchemeHandler_ParseUrlAndSendL_Transition
       
   287 	*/
       
   288 	inline CMailtoSchemeHandler_UnitTestContext& Context() const;
       
   289 	};	// CMailtoSchemeHandler_ParseUrlAndSendL_Transition
       
   290 
       
   291 
       
   292 // Add additional Transition class definitions here...
       
   293 
       
   294 #include "MailtoSchemeHandlerTransitions.inl"
       
   295 
       
   296 #include "MailtoSchemeHandlerUnitTestContext.inl"
       
   297 
       
   298 #endif // __MAILTOSCHEMEHANDLERTRANSITIONS_H__
       
   299