datacommsserver/esockserver/test/TE_ESock/EsockTestSection27.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2001-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 // This is the header file for ESOCK test section 27
       
    15 // Integration test for DNS Query interface.
       
    16 // 
       
    17 //
       
    18 
       
    19 #if (!defined __ESOCKTEST_27_H__)
       
    20 #define __ESOCKTEST_27_H__
       
    21 #include "TestStepEsock.h"
       
    22 
       
    23 //-------------------------------------------------------------------------------------------------------
       
    24 
       
    25 
       
    26 
       
    27 /**
       
    28 *   Implements common functionality for the set of RHostResolver Query interface tests:
       
    29 *   opening Host Resolver etc. 
       
    30 *   N.B. Host Resolver is opened in IMPLICIT connection mode (without using RConnection functionality)
       
    31 */
       
    32 class CTestRHostRslvQuery_27 : public CESockTestStep_OOMCapable
       
    33     {
       
    34     
       
    35     public:
       
    36         
       
    37         /** inherited from CTestStep */
       
    38         virtual TVerdict doTestStepPreambleL (void);
       
    39         virtual TVerdict doTestStepPostambleL(void);
       
    40         
       
    41     protected:
       
    42         
       
    43         TInt    ListDnsRecordsA(const TDesC8& aHostName);
       
    44         TInt    ListDnsRecordsSRV(const TDesC8& aQuery);
       
    45         TInt    ListDnsRecordsPTR(const TDesC8& aQuery);
       
    46         TInt    ListDnsRecordsNAPTR(const TDesC8& aHostName);
       
    47         TInt    ListDnsRecordsMX(const TDesC8& aHostName);
       
    48         TInt    ListDnsRecordsAAAA(const TDesC8& aHostName);
       
    49         
       
    50         TBool   GetIniFileIpAddr(const TDesC &aSectName,const TDesC &aKeyName,TInetAddr& aInetAddr);
       
    51         TBool   GetIniFileString8(const TDesC &aSectName,const TDesC &aKeyName,TDes8& aStr);
       
    52         
       
    53         TInt    ProcessDndError(TInt aErrCode, TInt aEntryCount);
       
    54         
       
    55         /** pointer type for the one of the ListDnsRecords* methods */
       
    56         typedef TInt (CTestRHostRslvQuery_27::*TpListRRFunct) (const TDesC8&);
       
    57         
       
    58         TInt    ListDnsRecordsL(TpListRRFunct apFunct);
       
    59 		
       
    60         
       
    61     protected:
       
    62         
       
    63         RHostResolver   iHostRslv;
       
    64     };
       
    65 
       
    66 
       
    67 //-------------------------------------------------------------------------------------------------------
       
    68 
       
    69 /**
       
    70 *   Implements common functionality for the set of RHostResolver Query interface tests:
       
    71 *   establishing connection, opening Host Resolver,  etc. 
       
    72 *   N.B. Host Resolver is opened in EXPLICIT connection mode (with using RConnection functionality)
       
    73 */
       
    74 class CTestRHostRslvQuery_27_ExplConn : public CTestRHostRslvQuery_27
       
    75     {
       
    76     public:
       
    77         
       
    78         /** inherited from CTestStep */
       
    79         virtual TVerdict doTestStepPreambleL (void);
       
    80         virtual TVerdict doTestStepPostambleL(void);
       
    81         
       
    82     protected:
       
    83         RConnection iConnection;
       
    84         
       
    85     };
       
    86 
       
    87 //-------------------------------------------------------------------------------------------------------
       
    88 
       
    89 
       
    90 /**
       
    91 *   Testing RHostResolver::Query() of 'A' type
       
    92 */
       
    93 class CEsockTest27_1 : public CTestRHostRslvQuery_27
       
    94     {
       
    95     public:
       
    96        	static const TDesC& GetTestName();
       
    97         ~CEsockTest27_1() {}
       
    98         
       
    99         virtual TVerdict easyTestStepL();
       
   100         
       
   101     };
       
   102 
       
   103 //-------------------------------------------------------------------------------------------------------
       
   104 
       
   105 /**
       
   106 *   Testing RHostResolver::Query() of 'SVR' type
       
   107 */
       
   108 class CEsockTest27_2 : public CTestRHostRslvQuery_27
       
   109     {
       
   110     public:
       
   111        	static const TDesC& GetTestName();
       
   112         ~CEsockTest27_2() {}
       
   113         
       
   114         virtual TVerdict easyTestStepL();
       
   115         
       
   116     };
       
   117 
       
   118 //-------------------------------------------------------------------------------------------------------
       
   119 
       
   120 /**
       
   121 *   Testing RHostResolver::Query() of 'PTR' type
       
   122 */
       
   123 class CEsockTest27_3 : public CTestRHostRslvQuery_27
       
   124     {
       
   125     public:
       
   126        	static const TDesC& GetTestName();
       
   127         ~CEsockTest27_3() {}
       
   128         
       
   129         virtual TVerdict easyTestStepL();
       
   130         
       
   131     };
       
   132 
       
   133 //-------------------------------------------------------------------------------------------------------
       
   134 
       
   135 /**
       
   136 *   Testing RHostResolver::Query() of 'NAPTR' type
       
   137 */
       
   138 class CEsockTest27_4 : public CTestRHostRslvQuery_27
       
   139     {
       
   140     public:
       
   141        	static const TDesC& GetTestName();
       
   142         ~CEsockTest27_4() {}
       
   143         
       
   144         virtual TVerdict easyTestStepL();
       
   145         
       
   146     };
       
   147 
       
   148 //-------------------------------------------------------------------------------------------------------
       
   149 
       
   150 /**
       
   151 *   Testing RHostResolver::Query() of 'MX' type
       
   152 */
       
   153 class CEsockTest27_5 : public CTestRHostRslvQuery_27
       
   154     {
       
   155     public:
       
   156        	static const TDesC& GetTestName();
       
   157         ~CEsockTest27_5() {}
       
   158         
       
   159         virtual TVerdict easyTestStepL();
       
   160         
       
   161     };
       
   162 
       
   163 //-------------------------------------------------------------------------------------------------------
       
   164 
       
   165 /**
       
   166 *   Testing RHostResolver::Query() of 'AAAA' type
       
   167 */
       
   168 class CEsockTest27_6 : public CTestRHostRslvQuery_27
       
   169     {
       
   170     public:
       
   171        	static const TDesC& GetTestName();
       
   172         ~CEsockTest27_6() {}
       
   173         
       
   174         virtual TVerdict easyTestStepL();
       
   175         
       
   176     };
       
   177 
       
   178 
       
   179 
       
   180 //-------------------------------------------------------------------------------------------------------
       
   181 
       
   182 /**
       
   183 *   Testing RHostResolver::Query() of 'A' type
       
   184 *   Using explicit connection scenario.
       
   185 */
       
   186 class CEsockTest27_1_ExplConn : public CTestRHostRslvQuery_27_ExplConn
       
   187     {
       
   188     public:
       
   189        	static const TDesC& GetTestName();
       
   190         ~CEsockTest27_1_ExplConn() {}
       
   191         
       
   192         virtual TVerdict easyTestStepL();
       
   193         
       
   194     };
       
   195 
       
   196 //-------------------------------------------------------------------------------------------------------
       
   197 
       
   198 /**
       
   199 *   Testing RHostResolver::Query() functionality on several threads:       
       
   200 *   one thread performs Query() while another GetByName()
       
   201 */
       
   202 class CEsockTest27_1_MThread: public CTestRHostRslvQuery_27
       
   203     {
       
   204     public:
       
   205        	static const TDesC& GetTestName();
       
   206         ~CEsockTest27_1_MThread() {}
       
   207         
       
   208         virtual TVerdict easyTestStepL();
       
   209         
       
   210     };
       
   211 
       
   212 
       
   213 
       
   214 //-------------------------------------------------------------------------------------------------------
       
   215 
       
   216 
       
   217 #endif //(__ESOCKTEST_27_H__)
       
   218