telephonyserverplugins/ctsydispatchlayer/test/dispatchertests/dispatchinc/cctsypacketservicesfu.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-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 // functional unit of the Common TSY Dispatcher.
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file The TEFUnit header file which tests the PacketServices
       
    21 */
       
    22 
       
    23 /**
       
    24  @file
       
    25  @internalAll 
       
    26 */
       
    27 
       
    28 #ifndef CCTSYPACKETSERVICESFU_H
       
    29 #define CCTSYPACKETSERVICESFU_H
       
    30 
       
    31 #include <test/tefunit.h>
       
    32 
       
    33 #include <etelmm.h>
       
    34 #include <etelmmcs.h>
       
    35 
       
    36 #include "cctsycomponenttestbase.h"
       
    37 
       
    38 /*
       
    39 GPRS Requested
       
    40 
       
    41 iMinDelay, iMinMeanThroughput, iMinPeakThroughput, iMinPrecedence,
       
    42 iMinReliability, iReqDelay, iReqMeanThroughput, iReqPeakThroughput, iReqPrecedence, iReqReliability
       
    43 */
       
    44 
       
    45 const RPacketContext::TGSNAddress KDefaultAccessPoint = _L8("");
       
    46 const RPacketContext::TProtocolType KDefaultPdpType = RPacketContext::EPdpTypeIPv4;
       
    47 const TUint KDefaultServiceOption = 1;
       
    48 const TInt KMaxMiscBufferSize = 40;
       
    49 const TInt KAppendableBufferSize=3;
       
    50 const TInt KPrimaryAndSecondaryDNSLength = 16;
       
    51 const TUint KPasswordUsernameHeaderLength = 7;
       
    52 const TUint KIPCRequestCode = 1;
       
    53 const TUint KRequestID = 0;
       
    54 const TUint KIDLength = 3;
       
    55 const TUint KMaxUserAndPassLength = 80;
       
    56 const TUint KMaxPdpAddressLength = 50;
       
    57 const TUint KPrimaryAndSecondaryDNSID = 0xC023;
       
    58 const TUint KUsenamePasswordDNSID = 0x8021;
       
    59 const TUint KIndicatePrimaryAddress = 0x81;
       
    60 const TUint KIndicateSecondaryAddress = 0x83;
       
    61 const TUint KPacketLengthMSB = 0x0;
       
    62 const TUint KIPv4Len = 4;
       
    63 const TUint KDnsAddressLength = 6;
       
    64 const TUint KDnsLength = 32;
       
    65 
       
    66 _LIT(KDefaultContextName, "");
       
    67 _LIT(KFirstAllocatedContextName, "100Int_0");
       
    68 _LIT(KSecondAllocatedContextName, "101Int_0");
       
    69 _LIT(KThirdAllocatedContextName, "102Int_1");
       
    70 _LIT(KSecondaryContextName, "101Int_1");
       
    71 _LIT(KMBMSFirstAllocatedContextName, "MBMS_Context_0");
       
    72 _LIT(KDefaultChannelId, "1");
       
    73 _LIT(KSecondaryContextChannelId, "2");
       
    74 _LIT(KPdpAdd99, "0.0.0.0");
       
    75 _LIT(KPointName99, "internet");
       
    76 _LIT(KPrimaryDns99, "127.0.0.1");
       
    77 _LIT(KPrimaryDns99ForUN0006, "1.2.3.44");
       
    78 _LIT(KSecondaryDns99, "0.0.0.0");
       
    79 _LIT(KPrimaryDns, "0.0.0.0");
       
    80 _LIT(KSecondaryDns, "0.0.0.0");
       
    81 _LIT(KPdpAddGPRS, "0.0.0.0");
       
    82 _LIT(KPdpAddGPRSActive, "1.1.1.1");
       
    83 _LIT(KPointNameGPRS, "internet");
       
    84 _LIT(KUsername, "USER");
       
    85 _LIT(KLongUsername, "LONGUSER");
       
    86 _LIT(KDummyMiscBuffer,"DummyPCO");
       
    87 _LIT(KPassword, "USER");
       
    88 _LIT8(KAddress, "1.1.1.1");
       
    89 _LIT8(KAPN, "0.0.0.0");
       
    90 const TInt8 KRejectionCodePass = 0;
       
    91 const TInt8 KRejectionCodeFail = 1;
       
    92 
       
    93 class CCTsyPacketServicesFU : public CCtsyComponentTestBase
       
    94 	{
       
    95 public:
       
    96 	// Create a suite of all the tests
       
    97 	static CTestSuite* CreateSuiteL(const TDesC& aName);
       
    98 
       
    99 public:
       
   100 
       
   101 	void ConvertDNSToPCOBuffer (const TDes8& aPrimaryDNS, const TDes8& aSecondaryDNS, const TUint8 aRequestID, TDes8&  aFormatPcoBufferAddr);
       
   102 	void ConvertUsernameAndPasswordToPCOBuffer(const TDes8& aUsername, const TDes8& aPassword, const TUint8 aRequestID, TDes8& aFormatedBuffer);
       
   103 	void CCTsyPacketServicesFU::PCOGeneratorL(RPacketContext::TProtocolConfigOptionV2& aPco, RPacketContext::TMiscProtocolBuffer& aPcoBuffer);
       
   104 	void DriverDeleteContextL(TInfoName aContextName);
       
   105 	void DriverAttachPacketServiceL();
       
   106 	void DriverDetachPacketServiceL();
       
   107 	void DriverInitialiseContextL();
       
   108 	void DriverInitialiseContextL(const TInfoName& aPrimaryContextId, const TInfoName& aSecondaryContextId);
       
   109 	void DriverSetConfigContextL(TInfoName aContextId,  RPacketContext::TGSNAddress aAccessPoint,  RPacketContext::TProtocolType aPdpType,  RPacketContext::TProtocolAddress aPdpAddress,RPacketContext::TMiscProtocolBuffer aPcoBuffer);
       
   110 	void DriverModifyActiveContextL(TInt8 aRejectionCode, TInt aError);
       
   111 	void OpenInitialiseMbmsContextLC(RPacketService& aPacketService,  RPacketMbmsContext& aPacketContext, TDes& aContextName, const TDesC& aChannelId, TInt aCompError);
       
   112 
       
   113 	
       
   114 	// use-case tests
       
   115 	void TestUseCase0001L();
       
   116 	void TestUseCase0002L();
       
   117 	void TestUseCase0003L();
       
   118 	void TestUseCase0004L();
       
   119 	void TestUseCase0005L();
       
   120 	void TestUseCase0006L();
       
   121 	void TestUseCase0007L();
       
   122 	
       
   123 
       
   124 	//other unit tests
       
   125 	void TestUnit0001L();
       
   126 	void TestUnit0002L();
       
   127 	void TestUnit0003L();
       
   128 	void TestUnit0004L();
       
   129 	void TestUnit0005L();
       
   130 	void TestUnit0006L();
       
   131 	void TestUnit0007L();
       
   132 	void TestUnit0008L();
       
   133 	void TestUnit0009L();
       
   134 	void TestUnit00010L();
       
   135 	void TestUnit00011AL();
       
   136 	void TestUnit00011BL();
       
   137 	void TestUnit00011CL();
       
   138 	void TestUnit00012L();
       
   139 	void TestUnit00013L();
       
   140 	void TestUnit00014L();
       
   141 	void TestUnit00015L();
       
   142 	void TestUnit00016L();
       
   143 	void TestUnit00017L();
       
   144 	void TestUnit00018L();
       
   145 	void TestUnit00019L();
       
   146 	void TestUnit00020L();
       
   147 	void TestUnit00021L();
       
   148 	void TestUnit00022L();
       
   149 	void TestUnit00023L();
       
   150 	void TestUnit00024L();
       
   151 	void TestUnit00025L();
       
   152 	void TestUnit00026L();
       
   153 
       
   154 private:
       
   155 
       
   156 	}; // class CCTsyPacketServicesFU
       
   157 
       
   158 #endif // CCTSYPACKETSERVICESFU_H
       
   159