natfw/natfwstunturnclient/tsrc/ut_stunturnclient/inc/ut_cstunclient.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __UT_CSTUNCLIENT_H__
       
    22 #define __UT_CSTUNCLIENT_H__
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 #include <digia/eunit/ceunittestsuiteclass.h>
       
    26 
       
    27 //  INTERNAL INCLUDES
       
    28 
       
    29 #include "cncmconnectionmultiplexer.h"
       
    30 #include "mncmconnectionmultiplexerobserver.h"
       
    31 #include "natfwstunclientobserver.h"
       
    32 
       
    33 //  FORWARD DECLARATIONS
       
    34 class CSTUNClient;
       
    35 
       
    36 #include <e32def.h>
       
    37 #include <es_sock.h>
       
    38 #ifndef NONSHARABLE_CLASS
       
    39     #define NONSHARABLE_CLASS(x) class x
       
    40 #endif
       
    41 
       
    42 //  CLASS DEFINITION
       
    43 /**
       
    44  *
       
    45  * EUnitWizard generated test class. 
       
    46  *
       
    47  */
       
    48 NONSHARABLE_CLASS( ut_cstunclient )
       
    49      : public CEUnitTestSuiteClass, public MSTUNClientObserver, 
       
    50        public MNcmConnectionMultiplexerObserver
       
    51     {
       
    52     public:     // Constructors and destructors
       
    53 
       
    54         /**
       
    55          * Two phase construction
       
    56          */
       
    57         static ut_cstunclient* NewL();
       
    58         static ut_cstunclient* NewLC();
       
    59         /**
       
    60          * Destructor
       
    61          */
       
    62         ~ut_cstunclient();
       
    63 
       
    64     private:    // Constructors and destructors
       
    65 
       
    66         ut_cstunclient();
       
    67         void ConstructL();
       
    68 
       
    69     public:     // From mstunclientobserver
       
    70 
       
    71         void STUNClientInitCompleted( const CSTUNClient& aClient,
       
    72                                       TInt aCompletionCode );   
       
    73     
       
    74 
       
    75         void STUNBindingEventOccurredL( TSTUNBindingEvent aEvent, 
       
    76                                         const CBinding& aBinding );
       
    77 
       
    78 
       
    79         void STUNBindingErrorOccurred( const CBinding& aBinding, 
       
    80                                        TInt aError );
       
    81 
       
    82     public:     // From MNcmConnectionMultiplexerObserver
       
    83     
       
    84         void Notify( TUint aSessionId, TUint aStreamId, TNotifyType aType, TInt aError );
       
    85         void IcmpError( TUint aSessionId, TUint aStreamId, const TInetAddr& aAddress );
       
    86         
       
    87     private:    // New methods
       
    88 
       
    89          void SetupL();
       
    90         
       
    91          void Teardown();
       
    92         
       
    93          void UT_CSTUNClient_NewLL();
       
    94         
       
    95         
       
    96          void UT_CSTUNClient_NewL_1L();
       
    97          
       
    98          
       
    99          void UT_CSTUNClient_NewL_2L();
       
   100         
       
   101         
       
   102          void UT_CSTUNClient_NewLCL();
       
   103         
       
   104         
       
   105          void UT_CSTUNClient_NewLC_1L();
       
   106         
       
   107         
       
   108          void UT_CSTUNClient_IsInitializedL();
       
   109         
       
   110         
       
   111          void UT_CSTUNClient_STUNServerAddrLL();
       
   112         
       
   113         
       
   114          void UT_CSTUNClient_SetCredentialsLL();
       
   115         
       
   116         
       
   117          void UT_CSTUNClient_SharedSecretObtainedL();
       
   118         
       
   119         
       
   120          //void UT_CSTUNClient_SetSTUNServerAddrLL();
       
   121         
       
   122         
       
   123          void UT_CSTUNClient_ObtainTransactionIDLL();
       
   124         
       
   125         
       
   126          void UT_CSTUNClient_ImplementationL();
       
   127         
       
   128 
       
   129     private:    // Data
       
   130 
       
   131         EUNIT_DECLARE_TEST_TABLE;
       
   132         
       
   133         RSocketServ iSocketServ;
       
   134         RConnection iConnection;
       
   135         CDeltaTimer* iDeltatimer;
       
   136         CSTUNClient* iStunclient;
       
   137         TUint iStreamId;
       
   138         TUint iSubstreamId;
       
   139         HBufC8* iServeraddress;
       
   140         HBufC8* iResponse;
       
   141         HBufC8* iRespDataIndication;
       
   142         CNcmConnectionMultiplexer* iMux;
       
   143         RSocket iSocket;
       
   144         TRequestStatus iStatus; 
       
   145         TBool iCallbackCalled;
       
   146 
       
   147     };
       
   148 
       
   149 #endif      //  __UT_CSTUNCLIENT_H__
       
   150 
       
   151 // End of file