datacommsserver/esockserver/test/util/inc/te_esockutilsteps.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-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 #if (!defined __TE_ESOCKUTILSTEPS_H__)
       
    17 #define __TE_ESOCKUTILSTEPS_H__
       
    18 
       
    19 #include <test/testexecutestepbase.h>
       
    20 #include "te_esockutilserver.h"
       
    21 #include "esockloader.h"
       
    22 #include <cfshared.h>
       
    23 
       
    24 class CEasyTestStep : public CTestStep
       
    25 /**
       
    26 This class makes things easier, the test steps doesnt have to
       
    27 explicitely call SetTestStepResult, they just return the result.
       
    28 */
       
    29 	{
       
    30 public:
       
    31 	virtual TVerdict doTestStepPreambleL()
       
    32 		{
       
    33 		MergeVerdict(easyTestStepPreambleL());
       
    34 		return TestStepResult();
       
    35 		}
       
    36 	virtual TVerdict doTestStepL()
       
    37 		{
       
    38 		MergeVerdict(easyTestStepL());
       
    39 		return TestStepResult();
       
    40 		}
       
    41 	virtual TVerdict doTestStepPostambleL()
       
    42 		{
       
    43 		MergeVerdict(easyTestStepPostambleL());
       
    44 		return TestStepResult();
       
    45 		}
       
    46 
       
    47 	virtual TVerdict easyTestStepPreambleL()
       
    48 		{ return EPass; }
       
    49 
       
    50 	virtual TVerdict easyTestStepL() = 0;
       
    51 	virtual TVerdict easyTestStepPostambleL()
       
    52 		{ return EPass; }
       
    53 
       
    54 	void MergeVerdict(TVerdict aVerdict)
       
    55 		{
       
    56 		if(TestStepResult() == EPass)
       
    57 			{
       
    58 			SetTestStepResult(aVerdict);
       
    59 			}
       
    60 		}
       
    61 	};
       
    62 
       
    63 class CTestStepESockUtil : public CTestStep, public MHarnessLogAdaptor
       
    64 	{
       
    65 public:
       
    66 	void Log( TRefByValue<const TDesC16> format, ... );
       
    67 	void Log( TRefByValue<const TDesC8> format, ... );
       
    68 	};
       
    69 
       
    70 class CTestStepLoadESock : public CTestStepESockUtil
       
    71 	{
       
    72 public:
       
    73 	CTestStepLoadESock();
       
    74 	virtual TVerdict doTestStepL();
       
    75 	};
       
    76 
       
    77 class CTestStepUnloadESock : public CTestStepESockUtil
       
    78 	{
       
    79 public:
       
    80 	enum TLeak {ENoLeak, EMayLeak, ELeaks};
       
    81 	CTestStepUnloadESock(CommsFW::TCFShutdownType aType, TLeak aLeak, TBool aExpectTimeout);
       
    82 	virtual TVerdict doTestStepL();
       
    83 private:
       
    84 	CommsFW::TCFShutdownType iType;
       
    85 	TLeak iLeak;
       
    86 	TBool iExpectTimeout;
       
    87 	};
       
    88 
       
    89 class CTestStepStopAllInterfaces : public CTestStepESockUtil
       
    90 	{
       
    91 public:
       
    92 	CTestStepStopAllInterfaces();
       
    93 	virtual TVerdict doTestStepL();
       
    94 	};
       
    95 
       
    96 class CTestStepDefaultToConfig1 : public CTestStepESockUtil
       
    97 	{
       
    98 public:
       
    99 	CTestStepDefaultToConfig1();
       
   100 	virtual TVerdict doTestStepL();
       
   101 	};
       
   102 
       
   103 
       
   104 //from genconnn test 6_2
       
   105 class CTestStepIsNetworkNotActive : public CTestStepESockUtil
       
   106 	{
       
   107 public:
       
   108 	CTestStepIsNetworkNotActive();
       
   109 	virtual TVerdict doTestStepL();
       
   110 	};
       
   111 
       
   112 
       
   113 class CTestStepDelay : public CTestStepESockUtil
       
   114 	{
       
   115 public:
       
   116 	CTestStepDelay();
       
   117 	virtual TVerdict doTestStepL();
       
   118 	};
       
   119 
       
   120 class CTestStepAlwaysFail : public CTestStepESockUtil
       
   121 	{
       
   122 public:
       
   123 	CTestStepAlwaysFail();
       
   124 	virtual TVerdict doTestStepL();
       
   125 	};
       
   126 	
       
   127 class CTestStepResetAllocFails : public CTestStepESockUtil
       
   128 	{
       
   129 public:
       
   130 	CTestStepResetAllocFails();
       
   131 	virtual TVerdict doTestStepL();
       
   132 	};
       
   133 	
       
   134 class CTestStepLoadConfig : public CTestStepESockUtil
       
   135 	{
       
   136 public:
       
   137 	CTestStepLoadConfig();
       
   138 	virtual TVerdict doTestStepL();
       
   139 	TInt UpdateIniL(const TDesC &aFileSpec, const TDesC &aSectName, const TDesC &aKeyName, const TDesC &aValue);
       
   140 	};
       
   141 	
       
   142 class CTestStepCopyFiles : public CTestStepESockUtil
       
   143 	{
       
   144 public:
       
   145 	CTestStepCopyFiles();
       
   146 	virtual TVerdict doTestStepL();
       
   147 	};
       
   148 
       
   149 
       
   150 _LIT(KTestStepLoadESock,"TE_ESockUtilLoadESock");
       
   151 _LIT(KTestStepUnloadESock,"TE_ESockUtilUnloadESock");
       
   152 _LIT(KTestStepUnloadESockForced,"TE_ESockUtilUnloadESockForced");
       
   153 _LIT(KTestStepUnloadESockForcedTimeout,"TE_ESockUtilUnloadESockForcedTimeout");
       
   154 _LIT(KTestStepUnloadESock_Leaks,"TE_ESockUtilUnloadESock_Leaks");
       
   155 _LIT(KTestStepUnloadESock_MayLeak,"TE_ESockUtilUnloadESock_MayLeak");
       
   156 _LIT(KTestStepStopAllInterfaces,"TE_ESockUtilStopAllInterfaces");
       
   157 _LIT(KTestStepDefaultToConfig1, "TE_ESockDefaultToConfig1");
       
   158 _LIT(KTestStepIsNetworkNotActive, "TE_ESockUtilIsNetworkNotActive");
       
   159 _LIT(KTestStepDelay, "TE_ESockUtilDelay");
       
   160 _LIT(KTestStepAlwaysFail, "TE_ESockUtilAlwaysFail");
       
   161 _LIT(KTestStepResetAllocFails, "TE_ESockUtilResetAllocFails");
       
   162 _LIT(KTestStepLoadConfig, "LoadConfig");
       
   163 _LIT(KTestStepCopyFiles, "CopyFiles");
       
   164 
       
   165 #endif // __TE_ESOCKUTILSTEPS_H__
       
   166 
       
   167