lowlevellibsandfws/pluginfw/Test_Bed/DefaultLogOutputTest/DefaultLogOutputTransitions.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 CDefaultLogOutput class methods.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __DEFAULTLOGOUTPUTTRANSITIONS_H__
       
    19 #define __DEFAULTLOGOUTPUTTRANSITIONS_H__
       
    20 
       
    21 #include "TestUtilities.h"
       
    22 #include "StateAccessor.h"
       
    23 #include "LeakTestTransition.h"
       
    24 #include <ecom/test_bed/datalogger.h>
       
    25 #include "DefaultLogOutput.h"
       
    26 #include "DefaultLogOutputStateAccessor.h"
       
    27 #include <ecom/test_bed/unittest.h>
       
    28 
       
    29 #define CTransitionType CLeakTestTransition
       
    30 
       
    31 // ______________________________________________________________________________
       
    32 //
       
    33 /**
       
    34 	@internalComponent
       
    35 
       
    36 	Comments : Provide all the CDefaultLogOutput specific
       
    37 	parameters and behaviour on the CDefaultLogOutput
       
    38 	test class for a transition.
       
    39  */
       
    40 class CDefaultLogOutput_UnitTestContext : public CUnitTestContext
       
    41 	{
       
    42 public:
       
    43 	/**
       
    44 		@fn				CDefaultLogOutput_UnitTestContext(CDataLogger& aDataLogger,
       
    45 														MStateAccessor& aStateAccessor,
       
    46 														MTransitionObserver& aObserver)
       
    47 		Intended Usage	: Default constructor.
       
    48 		Error Condition	: None. 
       
    49 		@since			7.0
       
    50 		@param			aDataLogger The output logging object.
       
    51 		@param			aObserver The observer of this UnitTest's Transitions.
       
    52 		@param			aStateAccessor WhiteBox state access to the CDefaultLogOutput class under test.
       
    53 		@pre 			None.
       
    54 		@post			CDefaultLogOutput_UnitTestContext is fully constructed, and initialised.
       
    55 	*/
       
    56 	inline CDefaultLogOutput_UnitTestContext(CDataLogger& aDataLogger,
       
    57 										MStateAccessor& aStateAccessor,
       
    58 										MTransitionObserver& aObserver);
       
    59 
       
    60 	/**
       
    61 		@fn				~CDefaultLogOutput_UnitTestContext()
       
    62 		Intended Usage	: Default Destructor
       
    63 		@since			7.0
       
    64 		@pre 			CDefaultLogOutput_UnitTestContext is fully constructed.
       
    65 		@post			CDefaultLogOutput_UnitTestContext is fully destroyed
       
    66 		*/
       
    67 		virtual inline ~CDefaultLogOutput_UnitTestContext();
       
    68 
       
    69 	/** The instance of the class under test */
       
    70 	CDefaultLogOutput* iDefaultLogOutput;
       
    71 	/** The text to output to the test log file */ 
       
    72 	const TDesC* iOutput;
       
    73 	}; // CDefaultLogOutput_UnitTestContext
       
    74 
       
    75 // ______________________________________________________________________________
       
    76 //
       
    77 /**
       
    78 	@internalComponent
       
    79 	
       
    80 	Comments : Transition test of the CDefaultLogOutput::NewL method.
       
    81  */
       
    82 class CDefaultLogOutput_NewL_Transition : public CTransitionType
       
    83 	{
       
    84 public:
       
    85 	/**
       
    86 		@fn				CDefaultLogOutput_NewL_Transition(CUnitTestContext& aUTContext,
       
    87 																	TTransitionValidator& aValidator)
       
    88 		Intended Usage	: Standard c'tor method.
       
    89 		Error Condition	: None.
       
    90 		@since			7.0
       
    91 		@param			aUTContext The context this transition is operating in.
       
    92 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
    93 		@pre 			None.
       
    94 		@post			CDefaultLogOutput_NewL_Transition is fully constructed.
       
    95 	*/
       
    96 	CDefaultLogOutput_NewL_Transition(CUnitTestContext& aUTContext,
       
    97 													TTransitionValidator& aValidator);
       
    98 	/**
       
    99 		@fn				TransitMethodL()
       
   100 		Intended Usage	: To execute the CDefaultLogOutput::NewL method for the test harness.
       
   101 		Error Condition	: Leaves with an error code.
       
   102 		@leave  		KErrNoMemory, (@see CDefaultLogOutput::NewL)
       
   103 		@since			7.0
       
   104 		@return			None
       
   105 		@pre 			CDefaultLogOutput_NewL_Transition is fully constructed.
       
   106 		@post			No change in the CDefaultLogOutput_NewL_Transition apart
       
   107 						from iDefaultLogOutput, which may have changed state.
       
   108 						(@see CDefaultLogOutput::NewL post-condition) for iDefaultLogOutput's new state.
       
   109 	*/
       
   110 	inline void TransitMethodL();
       
   111 
       
   112 	/**
       
   113 		@fn				Context() const
       
   114 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   115 		Error Condition	: None.
       
   116 		@since			7.0
       
   117 		@return			The unit test context cast to a CDefaultLogOutput_UnitTestContext
       
   118 		@pre 			iUTContext is a valid CDefaultLogOutput_UnitTestContext.
       
   119 		@post			No change in the CDefaultLogOutput_NewL_Transition
       
   120 	*/
       
   121 	inline CDefaultLogOutput_UnitTestContext& Context() const;
       
   122 	};	// CDefaultLogOutput_NewL_Transition
       
   123 
       
   124 // ______________________________________________________________________________
       
   125 //
       
   126 /**
       
   127 	@internalComponent
       
   128 	
       
   129 	Comments : Transition test of the CDefaultLogOutput::Dtor method.
       
   130  */
       
   131 class CDefaultLogOutput_Dtor_Transition : public CTransition
       
   132 	{
       
   133 public:
       
   134 	/**
       
   135 		@fn				CDefaultLogOutput_Dtor_Transition(CUnitTestContext& aUTContext,
       
   136 																	TTransitionValidator& aValidator)
       
   137 		Intended Usage	: Standard c'tor method.
       
   138 		Error Condition	: None.
       
   139 		@since			7.0
       
   140 		@param			aUTContext The context this transition is operating in.
       
   141 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   142 		@pre 			None.
       
   143 		@post			CDefaultLogOutput_Dtor_Transition is fully constructed.
       
   144 	*/
       
   145 	CDefaultLogOutput_Dtor_Transition(CUnitTestContext& aUTContext,
       
   146 													TTransitionValidator& aValidator);
       
   147 	/**
       
   148 		@fn				TransitMethodL()
       
   149 		Intended Usage	: To execute the CDefaultLogOutput::Dtor method for the test harness.
       
   150 		Error Condition	: Leaves with an error code.
       
   151 		@leave  		KErrNoMemory, (@see CDefaultLogOutput::Dtor)
       
   152 		@since			7.0
       
   153 		@return			None
       
   154 		@pre 			CDefaultLogOutput_Dtor_Transition is fully constructed.
       
   155 		@post			No change in the CDefaultLogOutput_Dtor_Transition apart
       
   156 						from iDefaultLogOutput, which may have changed state.
       
   157 						(@see CDefaultLogOutput::Dtor post-condition) for iDefaultLogOutput's new state.
       
   158 	*/
       
   159 	inline void TransitMethodL();
       
   160 
       
   161 	/**
       
   162 		@fn				Context() const
       
   163 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   164 		Error Condition	: None.
       
   165 		@since			7.0
       
   166 		@return			The unit test context cast to a CDefaultLogOutput_UnitTestContext
       
   167 		@pre 			iUTContext is a valid CDefaultLogOutput_UnitTestContext.
       
   168 		@post			No change in the CDefaultLogOutput_Dtor_Transition
       
   169 	*/
       
   170 	inline CDefaultLogOutput_UnitTestContext& Context() const;
       
   171 	};	// CDefaultLogOutput_Dtor_Transition
       
   172 
       
   173 // ______________________________________________________________________________
       
   174 //
       
   175 /**
       
   176 	@internalComponent
       
   177 	
       
   178 	Comments : Transition test of the CDefaultLogOutput::OpenL method.
       
   179  */
       
   180 class CDefaultLogOutput_OpenL_Transition : public CTransitionType
       
   181 	{
       
   182 public:
       
   183 	/**
       
   184 		@fn				CDefaultLogOutput_OpenL_Transition(CUnitTestContext& aUTContext,
       
   185 																	TTransitionValidator& aValidator)
       
   186 		Intended Usage	: Standard c'tor method.
       
   187 		Error Condition	: None.
       
   188 		@since			7.0
       
   189 		@param			aUTContext The context this transition is operating in.
       
   190 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   191 		@pre 			None.
       
   192 		@post			CDefaultLogOutput_OpenL_Transition is fully constructed.
       
   193 	*/
       
   194 	CDefaultLogOutput_OpenL_Transition(CUnitTestContext& aUTContext,
       
   195 													TTransitionValidator& aValidator);
       
   196 	/**
       
   197 		@fn				TransitMethodL()
       
   198 		Intended Usage	: To execute the CDefaultLogOutput::OpenL method for the test harness.
       
   199 		Error Condition	: Leaves with an error code.
       
   200 		@leave  		KErrNoMemory, (@see CDefaultLogOutput::OpenL)
       
   201 		@since			7.0
       
   202 		@return			None
       
   203 		@pre 			CDefaultLogOutput_OpenL_Transition is fully constructed.
       
   204 		@post			No change in the CDefaultLogOutput_OpenL_Transition apart
       
   205 						from iDefaultLogOutput, which may have changed state.
       
   206 						(@see CDefaultLogOutput::OpenL post-condition) for iDefaultLogOutput's new state.
       
   207 	*/
       
   208 	inline void TransitMethodL();
       
   209 
       
   210 	/**
       
   211 		@fn				Context() const
       
   212 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   213 		Error Condition	: None.
       
   214 		@since			7.0
       
   215 		@return			The unit test context cast to a CDefaultLogOutput_UnitTestContext
       
   216 		@pre 			iUTContext is a valid CDefaultLogOutput_UnitTestContext.
       
   217 		@post			No change in the CDefaultLogOutput_OpenL_Transition
       
   218 	*/
       
   219 	inline CDefaultLogOutput_UnitTestContext& Context() const;
       
   220 	};	// CDefaultLogOutput_OpenL_Transition
       
   221 
       
   222 
       
   223 // ______________________________________________________________________________
       
   224 //
       
   225 /**
       
   226 	@internalComponent
       
   227 
       
   228 	Comments : Transition test of the CDefaultLogOutput::Close method.
       
   229  */
       
   230 class CDefaultLogOutput_Close_Transition : public CTransition
       
   231 	{
       
   232 public:
       
   233 	/**
       
   234 		@fn				CDefaultLogOutput_Close_Transition(CUnitTestContext& aUTContext,
       
   235 																	TTransitionValidator& aValidator)
       
   236 		Intended Usage	: Standard c'tor method.
       
   237 		Error Condition	: None.
       
   238 		@since			7.0
       
   239 		@param			aUTContext The context this transition is operating in.
       
   240 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   241 		@pre 			None.
       
   242 		@post			CDefaultLogOutput_Close_Transition is fully constructed.
       
   243 	*/
       
   244 	CDefaultLogOutput_Close_Transition(CUnitTestContext& aUTContext,
       
   245 													TTransitionValidator& aValidator);
       
   246 	/**
       
   247 		@fn				TransitMethodL()
       
   248 		Intended Usage	: To execute the CDefaultLogOutput::Close method for the test harness.
       
   249 		Error Condition	: Leaves with an error code.
       
   250 		@leave  		KErrNoMemory, (@see CDefaultLogOutput::Close)
       
   251 		@since			7.0
       
   252 		@return			None
       
   253 		@pre 			CDefaultLogOutput_Close_Transition is fully constructed.
       
   254 		@post			No change in the CDefaultLogOutput_Close_Transition apart
       
   255 						from iDefaultLogOutput, which may have changed state.
       
   256 						(@see CDefaultLogOutput::Close post-condition) for iDefaultLogOutput's new state.
       
   257 	*/
       
   258 	inline void TransitMethodL();
       
   259 
       
   260 	/**
       
   261 		@fn				Context() const
       
   262 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   263 		Error Condition	: None.
       
   264 		@since			7.0
       
   265 		@return			The unit test context cast to a CDefaultLogOutput_UnitTestContext
       
   266 		@pre 			iUTContext is a valid CDefaultLogOutput_UnitTestContext.
       
   267 		@post			No change in the CDefaultLogOutput_Close_Transition
       
   268 	*/
       
   269 	inline CDefaultLogOutput_UnitTestContext& Context() const;
       
   270 	};	// CDefaultLogOutput_Close_Transition
       
   271 
       
   272 // ______________________________________________________________________________
       
   273 //
       
   274 /**
       
   275 	@internalComponent
       
   276 
       
   277 	Comments : Transition test of the CDefaultLogOutput::Write method.
       
   278  */
       
   279 class CDefaultLogOutput_Write_Transition : public CTransition
       
   280 	{
       
   281 public:
       
   282 	/**
       
   283 		@fn				CDefaultLogOutput_Write_Transition(CUnitTestContext& aUTContext,
       
   284 																	TTransitionValidator& aValidator)
       
   285 		Intended Usage	: Standard c'tor method.
       
   286 		Error Condition	: None.
       
   287 		@since			7.0
       
   288 		@param			aUTContext The context this transition is operating in.
       
   289 		@param			aValidator Used for checking the pre & post conditions of the test object.
       
   290 		@pre 			None.
       
   291 		@post			CDefaultLogOutput_Write_Transition is fully constructed.
       
   292 	*/
       
   293 	CDefaultLogOutput_Write_Transition(CUnitTestContext& aUTContext,
       
   294 													TTransitionValidator& aValidator);
       
   295 	/**
       
   296 		@fn				TransitMethodL()
       
   297 		Intended Usage	: To execute the CDefaultLogOutput::Write method for the test harness.
       
   298 		Error Condition	: Leaves with an error code.
       
   299 		@leave  		KErrNoMemory, (@see CDefaultLogOutput::Write)
       
   300 		@since			7.0
       
   301 		@return			None
       
   302 		@pre 			CDefaultLogOutput_Write_Transition is fully constructed.
       
   303 		@post			No change in the CDefaultLogOutput_Write_Transition apart
       
   304 						from iDefaultLogOutput, which may have changed state.
       
   305 						(@see CDefaultLogOutput::Write post-condition) for iDefaultLogOutput's new state.
       
   306 	*/
       
   307 	inline void TransitMethodL();
       
   308 
       
   309 	/**
       
   310 		@fn				Context() const
       
   311 		Intended Usage	: To provide access to the unit test context cast to the correct type.
       
   312 		Error Condition	: None.
       
   313 		@since			7.0
       
   314 		@return			The unit test context cast to a CDefaultLogOutput_UnitTestContext
       
   315 		@pre 			iUTContext is a valid CDefaultLogOutput_UnitTestContext.
       
   316 		@post			No change in the CDefaultLogOutput_Write_Transition
       
   317 	*/
       
   318 	inline CDefaultLogOutput_UnitTestContext& Context() const;
       
   319 	};	// CDefaultLogOutput_Write_Transition
       
   320 
       
   321 #include "DefaultLogOutputTransitions.inl"
       
   322 
       
   323 #include "DefaultLogOutputUnitTestContext.inl"
       
   324 
       
   325 #endif // __DEFAULTLOGOUTPUTTRANSITIONS_H__
       
   326