os/ossrv/lowlevellibsandfws/apputils/bsul/test/t_clientmessage/t_clientmessagetestserver.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 // Test server code for validating CClientMessage Framework
    15 // 
    16 //
    17 
    18 #if !defined(T_CLIENTMESSAGETESTSERVERH)
    19 #define T_CLIENTMESSAGETESTSERVERH
    20 
    21 #include <e32std.h>
    22 #include <e32base.h>
    23 #include <bsul/bsul.h>
    24 
    25 
    26 /* These types are used in testing to pass as TPckg parameter type data
    27  */
    28 enum TCMTestEnum
    29 	{
    30 	ETestVal0,
    31 	ETestVal1,
    32 	ETestVal2,
    33 	ETestVal3
    34 	};
    35 
    36 struct CMTestStruct1
    37 	{
    38 	TInt iInt;
    39 	TBuf<32> iDes;
    40 	};
    41 
    42 struct CMTestStruct2
    43 	{
    44 	TInt iCount;
    45 	CMTestStruct1* iStruct;
    46 	TInt iEnum;
    47 	TBuf<32> iDes;
    48 	};
    49 
    50 enum TTestServerMessages
    51 	{
    52 	ETestMessage0 = 10,
    53 	ETestMessage1,
    54 	ETestMessage2,
    55 	ETestMessage3,
    56 	ETestMessage4,
    57 	ETestMessage5,
    58 	ETestMessage6,
    59 	ETestMessage7,
    60 	ETestMessage8,
    61 	ETestMessage9,
    62 	ETestMessage10,
    63 	ETestMessage11,
    64 	ETestMessage12,
    65 	ETestMessage13,
    66 	ETestMessage14,
    67 	ETestMessage15,
    68 	ETestMessage16,
    69 	ETestMessage17,
    70 	ETestMessage18,
    71 	ETestMessage19,
    72 	ETestMessage20,
    73 	ETestMessage21,
    74 	ETestMessage22,
    75 	ETestMessage23,
    76 	ETestMessage24,
    77 	ETestMessage25,
    78 	ETestMessage26,
    79 	ETestMessage27,
    80 	ETestMessage28,
    81 	ETestMessage29,
    82 	ETestMessage30,
    83 	ETestMessage31,
    84 	ETestMessage32
    85 	
    86 	};
    87 
    88 enum TParameterTestFunctions
    89 	{
    90 	EGetIntL,
    91 	EGetDes8L,
    92 	EGetDes16L,
    93 	EGetDesLengthL,
    94 	EGetDesMaxLengthL,
    95 	ERead8L,
    96 	ERead16L,
    97 	EWrite8L,
    98 	EWrite16L
    99 	};
   100 
   101 /* Server class. Very basic server implementation
   102  */
   103 class CClientMessageTestServer : public CServer2
   104 	{
   105 	
   106 public:
   107 	static CServer2* NewLC();
   108 	
   109 protected:
   110 	virtual TInt RunError(TInt aError);
   111 	
   112 private:
   113 	CClientMessageTestServer(TInt aPriority);
   114 	void ConstructL();
   115 	CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
   116 	
   117 	};
   118 
   119 /* Server Session class. Basic implementation of session and associated test functions
   120  */
   121 class CClientMessageTestSession : public CSession2
   122 	{
   123 	
   124 public:
   125 	CClientMessageTestSession(){};
   126 	virtual void CreateL(const CServer2& aServer);
   127 	
   128 	
   129 private:
   130 	void TestFunction0L();
   131 	void TestFunction1L();
   132 	void TestFunction4L();
   133 	void TestFunction5L();
   134 	void TestFunction6L();
   135 	void TestFunction7L();
   136 	void TestFunction9L();
   137 	void TestFunction10L();
   138 	void TestFunction11L();
   139 	void TestFunction14L();
   140 	void TestFunction15L();
   141 	void TestFunction16L();
   142 	void TestFunction17L();
   143 	void TestFunction18L();
   144 	void TestFunction19L();
   145 	void TestFunction31L();
   146 	
   147 private:
   148 	~CClientMessageTestSession();
   149 	void ServiceL(const RMessage2& aMessage);
   150 	void DoServiceL();
   151 	BSUL::CClientMessage* iClientMessage;
   152 	
   153 	};
   154 
   155 
   156 /* Server class. Very basic server implementation
   157  */
   158 class CClientMessageTestServer2 : public CServer2
   159 	{
   160 	
   161 public:
   162 	static CServer2* NewLC();
   163 	
   164 protected:
   165 	virtual TInt RunError(TInt aError);
   166 	
   167 private:
   168 	CClientMessageTestServer2(TInt aPriority);
   169 	void ConstructL();
   170 	CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
   171 	
   172 	};
   173 
   174 /* Server Session class. Basic implementation of session and associated test functions
   175  */
   176 class CClientMessageTestSession2 : public CSession2
   177 	{
   178 	
   179 public:
   180 	CClientMessageTestSession2(){};
   181 	virtual void CreateL(const CServer2& aServer);
   182 	
   183 private:
   184 	void TestFunction0L();
   185 	void TestFunction1L();
   186 	void TestFunction2L();
   187 	
   188 private:
   189 	~CClientMessageTestSession2();
   190 	void ServiceL(const RMessage2& aMessage);
   191 	void DoServiceL();
   192 	BSUL::CClientMessage* iClientMessage;
   193 	};
   194 
   195 
   196 
   197 
   198 
   199 #endif