servicediscoveryandcontrol/pnp/test/upnp/unittests/udpclient/inc/pudpclienttests.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /*
       
     2 * Copyright (c) 2008 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 #if !defined(PUDPCLIENTTESTS_H)
       
    20 #define PUDPCLIENTTESTS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <testexecutestepbase.h>
       
    24 #include "proxyprotocol.h"
       
    25 #include <comms-infras/eintsock.h>
       
    26 #include "es_mbuf.h"
       
    27 #include "testmudpserver.h"
       
    28 #include <elements/nm_node.h>
       
    29 
       
    30 #include <cchunkmanager.h>
       
    31 #include <rmemchunk.h>
       
    32 
       
    33 _LIT8 ( KTestCase1, "testcase1" );
       
    34 _LIT8 ( KMissingContentLength, "HTTP/1.1 200 OK\r\nST: testcase1\r\nEXT: \r\nSERVER: Apache 9.x, UPnP/1.0\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: max-age=900\r\nLOCATION: http://10.192.196.204:54042/\r\n\r\n");
       
    35 _LIT8 ( KMissingST, "HTTP/1.1 200 OK\r\nEXT: \r\nSERVER: Apache 9.x, UPnP/1.0\r\nDATE: 27\11\08\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: max-age=900\r\nLOCATION: http://10.192.196.204:54042/\r\nContent-Length: 0\r\n\r\n");
       
    36 _LIT8 ( KTestCase2, "testcase2" );
       
    37 _LIT8 ( KTestCase3, "testcase3" );
       
    38 
       
    39 NONSHARABLE_CLASS(CUdpClientTestBase) : protected CActive
       
    40 	{
       
    41 public:
       
    42 	static void StartTestL(const TDesC& aTestName, CProxyProvd* aProvd);
       
    43 	virtual void RunL();
       
    44 
       
    45 protected:		
       
    46 	CUdpClientTestBase(CProxyProvd* aProvd);
       
    47 	virtual ~CUdpClientTestBase();
       
    48 	
       
    49 	//Utilities function to be use in RunTest()
       
    50 	void Reschedule();
       
    51 	CTestExecuteLogger iLogger;
       
    52 	void CompleteSelf ( TInt aError );
       
    53 	void FinishTest(TVerdict result);
       
    54 	RMemoryAllocator 			iAllocator;
       
    55 	CChunkManager*  iChunkManager;			
       
    56 private:
       
    57 	//Implemented you own of these		
       
    58 	virtual TVerdict RunTestL() = 0;
       
    59 	virtual void Cleanup();
       
    60 	
       
    61 	void DoCancel();
       
    62 	void ConstructL();
       
    63 	void SetLoggerL();
       
    64 	CTestExecuteLogger& Logger();	
       
    65 	static CUdpClientTestBase* CreateTestL(const TDesC& aTestName, CProxyProvd* aProvd);
       
    66 		
       
    67 private:
       
    68 	CProxyProvd* iProvd;
       
    69 	TBool iReschedule; //Determines whether rescheduling is required
       
    70 	
       
    71 	};
       
    72 	
       
    73 inline CTestExecuteLogger& CUdpClientTestBase::Logger()
       
    74 	{
       
    75 	return iLogger;
       
    76 	}
       
    77 
       
    78 
       
    79 /*struct TObserverBundle 
       
    80 	{
       
    81 	enum TObserverState {EState1,EState2,EState3};
       
    82 	TObserverState iObserverState;
       
    83 	};
       
    84 */
       
    85 class MTestServerObserver
       
    86 	{
       
    87 public:
       
    88 	/**
       
    89 	Callback method which returns the responses.
       
    90 	@param aObserverInfo bundle containg the response.
       
    91 	*/
       
    92 	virtual void OnTestServerEventL ( TInt aError ) = 0;
       
    93 	//virtual void OnTestServerEventL ( TBool aFlag) = 0;
       
    94 	/**
       
    95 	Callback method which handles the errors of OnPnPEventL.
       
    96 	@param aError error code.
       
    97 	*/
       
    98 	//virtual void OnTestServerError (TInt aError) = 0;
       
    99 	};
       
   100 
       
   101 /*class MTestClientObserver
       
   102 	{
       
   103 public:
       
   104 	/**
       
   105 	Callback method which returns the responses.
       
   106 	@param aObserverInfo bundle containg the response.
       
   107 	*
       
   108 	virtual void OnTestClientEventL ( TObserverBundle& aObserverInfo) = 0;
       
   109 	/**
       
   110 	Callback method which handles the errors of OnPnPEventL.
       
   111 	@param aError error code.
       
   112 	*
       
   113 	virtual void OnTestClientError (TInt aError) = 0;
       
   114 	};
       
   115 */
       
   116 //----------------------------------------------------------//
       
   117 /////////////////// CUdpClientTestUPnP /////////////////////////
       
   118 //////Testcase: Send the test data from the test client/////////
       
   119 //----------------------------------------------------------//
       
   120 
       
   121 NONSHARABLE_CLASS(CUdpClientTestUPnP) : public CUdpClientTestBase,
       
   122 										public Messages::ASimpleNodeIdBase,
       
   123 										public MTestServerObserver
       
   124 	{
       
   125 public:
       
   126 	static CUdpClientTestUPnP* NewL ( CProxyProvd* aProvd );
       
   127 
       
   128 	//MTestServerObserver
       
   129 	void OnTestServerEventL ( TInt aError );
       
   130 
       
   131 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   132 	
       
   133 private:
       
   134 	enum TState
       
   135 		{
       
   136 		ECreateTestServer = 0,
       
   137 		ECreateTestClient,
       
   138 		ESendRequestData,
       
   139 		EFailed,
       
   140 		ECleanup,
       
   141 		};
       
   142 		
       
   143 	CUdpClientTestUPnP ( CProxyProvd* aProvd );
       
   144 	~CUdpClientTestUPnP();
       
   145 	void ConstructL ();
       
   146 	virtual TVerdict RunTestL ();
       
   147 	//void Cleanup();
       
   148 
       
   149 private:	
       
   150 	CTestMUdpServer*	iTestServer;	
       
   151 	Messages::TNodeId 	iClientId;
       
   152 	RTimer				iTimer;
       
   153 	TState				iState;
       
   154 	};
       
   155 
       
   156 //---------------------------------------------------------------------------------------------------------------------------------------
       
   157 
       
   158 NONSHARABLE_CLASS(CUdpClientTestUPnP1) : public CUdpClientTestBase,
       
   159 										public Messages::ASimpleNodeIdBase,
       
   160 										public MTestServerObserver
       
   161 	{
       
   162 public:
       
   163 	static CUdpClientTestUPnP1* NewL ( CProxyProvd* aProvd );
       
   164 
       
   165 	//MTestServerObserver
       
   166 	void OnTestServerEventL ( TInt aError );
       
   167 
       
   168 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   169 	
       
   170 private:
       
   171 	enum TState
       
   172 		{
       
   173 		ECreateTestServer = 0,
       
   174 		ECreateTestClient,
       
   175 		ESendRequestData,
       
   176 		EFailed,
       
   177 		ECleanup,
       
   178 		};
       
   179 		
       
   180 	CUdpClientTestUPnP1 ( CProxyProvd* aProvd );
       
   181 	~CUdpClientTestUPnP1();
       
   182 	void ConstructL ();
       
   183 	virtual TVerdict RunTestL ();
       
   184 	//void Cleanup();
       
   185 
       
   186 private:	
       
   187 	CTestMUdpServer*	iTestServer;	
       
   188 	Messages::TNodeId 	iClientId;
       
   189 	RTimer				iTimer;
       
   190 	TState				iState;
       
   191 	};
       
   192 	
       
   193 
       
   194 
       
   195 //----------------------------------------------------------------------------------------------------------------------------------
       
   196 
       
   197 
       
   198 
       
   199 _LIT8 ( KMissingRespLocn, "HTTP/1.1 200 OK\r\nEXT: \r\nST: testcase3\r\nSERVER: Apache 9.x, UPnP/1.0\r\nDATE: 27\11\08\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: max-age=900\r\nContent-Length: 0\r\n\r\n");
       
   200 
       
   201 
       
   202 NONSHARABLE_CLASS(CUdpClientTestUPnP2) : public CUdpClientTestBase,public Messages::ASimpleNodeIdBase,
       
   203 										public MTestServerObserver
       
   204 	{
       
   205 public:
       
   206 	static CUdpClientTestUPnP2* NewL ( CProxyProvd* aProvd );
       
   207 
       
   208 	//MTestServerObserver
       
   209 	void OnTestServerEventL ( TInt aError );
       
   210 
       
   211 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient,Messages::TSignatureBase& aMessage );
       
   212 	
       
   213 private:
       
   214 	enum TState
       
   215 		{
       
   216 		ECreateTestServer = 0,
       
   217 		ECreateTestClient,
       
   218 		ESendRequestData,
       
   219 		EFailed,
       
   220 		ECleanup,
       
   221 		};
       
   222 		
       
   223 	CUdpClientTestUPnP2 ( CProxyProvd* aProvd );
       
   224 	~CUdpClientTestUPnP2();
       
   225 	void ConstructL ();
       
   226 	virtual TVerdict RunTestL ();
       
   227 	//void Cleanup();
       
   228 
       
   229 private:	
       
   230 	CTestMUdpServer*	iTestServer;	
       
   231 	Messages::TNodeId 	iClientId;
       
   232 	RTimer				iTimer;
       
   233 	TState				iState;
       
   234 	};
       
   235 	
       
   236 	
       
   237 	
       
   238 _LIT8 ( KTestCase4, "testcase4" );
       
   239 
       
   240 //----------------------------------------------------------------------------------------------------------------------------------
       
   241 
       
   242 
       
   243 
       
   244 _LIT8 ( KMissingRespUSN, "HTTP/1.1 200 OK\r\nEXT: \r\nST: testcase4\r\nSERVER: Apache 9.x, UPnP/1.0\r\nDATE: 27\11\08\r\nCACHE-CONTROL: max-age=900\r\nLOCATION: http://10.192.196.204:54042/\r\nContent-Length: 0\r\n\r\n");
       
   245 
       
   246 
       
   247 NONSHARABLE_CLASS(CUdpClientTestUPnP3) : public CUdpClientTestBase,public Messages::ASimpleNodeIdBase,
       
   248 										public MTestServerObserver
       
   249 	{
       
   250 public:
       
   251 	static CUdpClientTestUPnP3* NewL ( CProxyProvd* aProvd );
       
   252 
       
   253 	//MTestServerObserver
       
   254 	void OnTestServerEventL ( TInt aError );
       
   255 
       
   256 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   257 	
       
   258 private:
       
   259 	enum TState
       
   260 		{
       
   261 		ECreateTestServer = 0,
       
   262 		ECreateTestClient,
       
   263 		ESendRequestData,
       
   264 		EFailed,
       
   265 		ECleanup,
       
   266 		};
       
   267 		
       
   268 	CUdpClientTestUPnP3 ( CProxyProvd* aProvd );
       
   269 	~CUdpClientTestUPnP3();
       
   270 	void ConstructL ();
       
   271 	virtual TVerdict RunTestL ();
       
   272 	//void Cleanup();
       
   273 
       
   274 private:	
       
   275 	CTestMUdpServer*	iTestServer;	
       
   276 	Messages::TNodeId 	iClientId;
       
   277 	RTimer				iTimer;
       
   278 	TState				iState;
       
   279 	};
       
   280 
       
   281 
       
   282 _LIT8 ( KTestCase5, "testcase5" );
       
   283 
       
   284 //----------------------------------------------------------------------------------------------------------------------------------
       
   285 
       
   286 
       
   287 
       
   288 _LIT8 ( KInvalidCacheControl, "HTTP/1.1 200 OK\r\nST: testcase5\r\nEXT: \r\nSERVER: Apache 9.x, UPnP/1.0\r\nDATE: 27\11\08\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: \r\nLOCATION: http://10.192.196.204:54042/\r\nContent-Length: 0\r\n\r\n");
       
   289 
       
   290 
       
   291 NONSHARABLE_CLASS(CUdpClientTestUPnP4) : public CUdpClientTestBase,
       
   292 										public Messages::ASimpleNodeIdBase,
       
   293 										public MTestServerObserver
       
   294 	{
       
   295 public:
       
   296 	static CUdpClientTestUPnP4* NewL ( CProxyProvd* aProvd );
       
   297 
       
   298 	//MTestServerObserver
       
   299 	void OnTestServerEventL ( TInt aError );
       
   300 
       
   301 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   302 	
       
   303 private:
       
   304 	enum TState
       
   305 		{
       
   306 		ECreateTestServer = 0,
       
   307 		ECreateTestClient,
       
   308 		ESendRequestData,
       
   309 		EFailed,
       
   310 		ECleanup,
       
   311 		};
       
   312 		
       
   313 	CUdpClientTestUPnP4 ( CProxyProvd* aProvd );
       
   314 	~CUdpClientTestUPnP4();
       
   315 	void ConstructL ();
       
   316 	virtual TVerdict RunTestL ();
       
   317 	//void Cleanup();
       
   318 
       
   319 private:	
       
   320 	CTestMUdpServer*	iTestServer;	
       
   321 	Messages::TNodeId 	iClientId;
       
   322 	RTimer				iTimer;
       
   323 	TState				iState;
       
   324 	};
       
   325 
       
   326 
       
   327 
       
   328 
       
   329 _LIT8 ( KTestCase6, "testcase6" );
       
   330 
       
   331 //----------------------------------------------------------------------------------------------------------------------------------
       
   332 
       
   333 
       
   334 
       
   335 
       
   336 _LIT8 ( KInvalidCL, "HTTP/1.1 200 OK\r\nST: testcase1\r\nEXT: \r\nSERVER: Apache 9.x, UPnP/1.0\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: max-age=900\r\nLOCATION: http://10.192.196.204:54042/\r\nContent-Length: 100\r\n\r\n");
       
   337 
       
   338 
       
   339 NONSHARABLE_CLASS(CUdpClientTestUPnP5) : public CUdpClientTestBase,
       
   340 										public Messages::ASimpleNodeIdBase,
       
   341 										public MTestServerObserver
       
   342 	{
       
   343 public:
       
   344 	static CUdpClientTestUPnP5* NewL ( CProxyProvd* aProvd );
       
   345 
       
   346 	//MTestServerObserver
       
   347 	void OnTestServerEventL ( TInt aError );
       
   348 
       
   349 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient,Messages::TSignatureBase& aMessage );
       
   350 	
       
   351 private:
       
   352 	enum TState
       
   353 		{
       
   354 		ECreateTestServer = 0,
       
   355 		ECreateTestClient,
       
   356 		ESendRequestData,
       
   357 		EFailed,
       
   358 		ECleanup,
       
   359 		};
       
   360 		
       
   361 	CUdpClientTestUPnP5 ( CProxyProvd* aProvd );
       
   362 	~CUdpClientTestUPnP5();
       
   363 	void ConstructL ();
       
   364 	virtual TVerdict RunTestL ();
       
   365 	//void Cleanup();
       
   366 
       
   367 private:	
       
   368 	CTestMUdpServer*	iTestServer;	
       
   369 	Messages::TNodeId 	iClientId;
       
   370 	RTimer				iTimer;
       
   371 	TState				iState;
       
   372 	};
       
   373 
       
   374 
       
   375 
       
   376 _LIT8 ( KTestCase7, "testcase7" );
       
   377 
       
   378 //----------------------------------------------------------------------------------------------------------------------------------
       
   379 
       
   380 
       
   381 
       
   382 
       
   383 _LIT8 ( KMissingExtn, "HTTP/1.1 200 OK\r\nST: testcase1\r\nSERVER: Apache 9.x, UPnP/1.0\r\nUSN: uuid:ae30fdec-16e3-4d75-ac72-b61c5d6d30d5::urn:schemas-upnp-org:device:BinaryLight:1\r\nCACHE-CONTROL: max-age=900\r\nLOCATION:http://10.192.196.204:54042/\r\nContent-Length: 0\r\n\r\n");
       
   384 
       
   385 
       
   386 NONSHARABLE_CLASS(CUdpClientTestUPnP6) : public CUdpClientTestBase,
       
   387 										public Messages::ASimpleNodeIdBase,
       
   388 										public MTestServerObserver
       
   389 	{
       
   390 public:
       
   391 	static CUdpClientTestUPnP6* NewL ( CProxyProvd* aProvd );
       
   392 
       
   393 	//MTestServerObserver
       
   394 	void OnTestServerEventL ( TInt aError );
       
   395 
       
   396 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   397 	
       
   398 private:
       
   399 	enum TState
       
   400 		{
       
   401 		ECreateTestServer = 0,
       
   402 		ECreateTestClient,
       
   403 		ESendRequestData,
       
   404 		EFailed,
       
   405 		ECleanup,
       
   406 		};
       
   407 		
       
   408 	CUdpClientTestUPnP6 ( CProxyProvd* aProvd );
       
   409 	~CUdpClientTestUPnP6();
       
   410 	void ConstructL ();
       
   411 	virtual TVerdict RunTestL ();
       
   412 	//void Cleanup();
       
   413 
       
   414 private:	
       
   415 	CTestMUdpServer*	iTestServer;	
       
   416 	Messages::TNodeId 	iClientId;
       
   417 	RTimer				iTimer;
       
   418 	TState				iState;
       
   419 	};
       
   420 	
       
   421 
       
   422 
       
   423 _LIT8 ( KTestCase8, "testcase8" );
       
   424 _LIT8 ( KTestCase9, "testcase9" );
       
   425 _LIT8 ( KTestCase10, "testcase10" );
       
   426 _LIT8 ( KTestCase11, "testcase11" );
       
   427 _LIT8 ( KTestCase12, "testcase12" );
       
   428 
       
   429 
       
   430 //----------------------------------------------------------------------------------------------------------------------------------
       
   431 
       
   432 
       
   433 
       
   434 
       
   435 _LIT8 ( KInvalidRes8, "HTTP/1.0 200 OK\r\nCACHE-CONTROL: max-age=900\r\nContent-Length: 0\r\n\r\n");
       
   436 
       
   437 
       
   438 NONSHARABLE_CLASS(CUdpClientTestUPnP7) : public CUdpClientTestBase,
       
   439 										public Messages::ASimpleNodeIdBase,
       
   440 										public MTestServerObserver
       
   441 	{
       
   442 public:
       
   443 	static CUdpClientTestUPnP7* NewL ( CProxyProvd* aProvd );
       
   444 
       
   445 	//MTestServerObserver
       
   446 	void OnTestServerEventL ( TInt aError );
       
   447 
       
   448 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   449 	
       
   450 private:
       
   451 	enum TState
       
   452 		{
       
   453 		ECreateTestServer = 0,
       
   454 		ECreateTestClient,
       
   455 		ESendRequestData,
       
   456 		EFailed,
       
   457 		ECleanup,
       
   458 		};
       
   459 		
       
   460 	CUdpClientTestUPnP7 ( CProxyProvd* aProvd );
       
   461 	~CUdpClientTestUPnP7();
       
   462 	void ConstructL ();
       
   463 	virtual TVerdict RunTestL ();
       
   464 	//void Cleanup();
       
   465 
       
   466 private:	
       
   467 	CTestMUdpServer*	iTestServer;	
       
   468 	Messages::TNodeId 	iClientId;
       
   469 	RTimer				iTimer;
       
   470 	TState				iState;
       
   471 	};
       
   472 
       
   473 
       
   474 //----------------------------------------------------------------------------------------------------------------------------------
       
   475 
       
   476 
       
   477 
       
   478 
       
   479 _LIT8 ( KInvalidRes9, "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=900\r\nContent-Length: 0\r\n\r\n");
       
   480 
       
   481 
       
   482 NONSHARABLE_CLASS(CUdpClientTestUPnP8) : public CUdpClientTestBase,
       
   483 										public Messages::ASimpleNodeIdBase,
       
   484 										public MTestServerObserver
       
   485 	{
       
   486 public:
       
   487 	static CUdpClientTestUPnP8* NewL ( CProxyProvd* aProvd );
       
   488 
       
   489 	//MTestServerObserver
       
   490 	void OnTestServerEventL ( TInt aError );
       
   491 
       
   492 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   493 	
       
   494 private:
       
   495 	enum TState
       
   496 		{
       
   497 		ECreateTestServer = 0,
       
   498 		ECreateTestClient,
       
   499 		ESendRequestData,
       
   500 		EFailed,
       
   501 		ECleanup,
       
   502 		};
       
   503 		
       
   504 	CUdpClientTestUPnP8 ( CProxyProvd* aProvd );
       
   505 	~CUdpClientTestUPnP8();
       
   506 	void ConstructL ();
       
   507 	virtual TVerdict RunTestL ();
       
   508 	//void Cleanup();
       
   509 
       
   510 private:	
       
   511 	CTestMUdpServer*	iTestServer;	
       
   512 	Messages::TNodeId 	iClientId;
       
   513 	RTimer				iTimer;
       
   514 	TState				iState;
       
   515 	};
       
   516 
       
   517 //----------------------------------------------------------------------------------------------------------------------------------
       
   518 
       
   519 
       
   520 
       
   521 
       
   522 _LIT8 ( KInvalidRes10, "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=900\r\nEXT: \r\nContent-Length: 0\r\n\r\n");
       
   523 
       
   524 
       
   525 NONSHARABLE_CLASS(CUdpClientTestUPnP9) : public CUdpClientTestBase,
       
   526 										public Messages::ASimpleNodeIdBase,
       
   527 										public MTestServerObserver
       
   528 	{
       
   529 public:
       
   530 	static CUdpClientTestUPnP9* NewL ( CProxyProvd* aProvd );
       
   531 
       
   532 	//MTestServerObserver
       
   533 	void OnTestServerEventL ( TInt aError );
       
   534 
       
   535 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   536 	
       
   537 private:
       
   538 	enum TState
       
   539 		{
       
   540 		ECreateTestServer = 0,
       
   541 		ECreateTestClient,
       
   542 		ESendRequestData,
       
   543 		EFailed,
       
   544 		ECleanup,
       
   545 		};
       
   546 		
       
   547 	CUdpClientTestUPnP9 ( CProxyProvd* aProvd );
       
   548 	~CUdpClientTestUPnP9();
       
   549 	void ConstructL ();
       
   550 	virtual TVerdict RunTestL ();
       
   551 	//void Cleanup();
       
   552 
       
   553 private:	
       
   554 	CTestMUdpServer*	iTestServer;	
       
   555 	Messages::TNodeId 	iClientId;
       
   556 	RTimer				iTimer;
       
   557 	TState				iState;
       
   558 	};
       
   559 
       
   560 
       
   561 //----------------------------------------------------------------------------------------------------------------------------------
       
   562 
       
   563 
       
   564 
       
   565 
       
   566 _LIT8 ( KInvalidRes11, "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=900\r\nEXT: \r\nLOCATION:http://10.192.196.204:54042/\r\nContent-Length: 0\r\n\r\n");
       
   567 
       
   568 
       
   569 NONSHARABLE_CLASS(CUdpClientTestUPnP10) : public CUdpClientTestBase,
       
   570 										public Messages::ASimpleNodeIdBase,
       
   571 										public MTestServerObserver
       
   572 	{
       
   573 public:
       
   574 	static CUdpClientTestUPnP10* NewL ( CProxyProvd* aProvd );
       
   575 
       
   576 	//MTestServerObserver
       
   577 	void OnTestServerEventL ( TInt aError );
       
   578 
       
   579 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   580 	
       
   581 private:
       
   582 	enum TState
       
   583 		{
       
   584 		ECreateTestServer = 0,
       
   585 		ECreateTestClient,
       
   586 		ESendRequestData,
       
   587 		EFailed,
       
   588 		ECleanup,
       
   589 		};
       
   590 		
       
   591 	CUdpClientTestUPnP10 ( CProxyProvd* aProvd );
       
   592 	~CUdpClientTestUPnP10();
       
   593 	void ConstructL ();
       
   594 	virtual TVerdict RunTestL ();
       
   595 	//void Cleanup();
       
   596 
       
   597 private:	
       
   598 	CTestMUdpServer*	iTestServer;	
       
   599 	Messages::TNodeId 	iClientId;
       
   600 	RTimer				iTimer;
       
   601 	TState				iState;
       
   602 	};
       
   603 
       
   604 _LIT8 ( KInvalidRes12, "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=900\r\nEXT: \r\nLOCATION:http://10.192.196.204:54042/\r\nST: testcase1\r\nContent-Length: 0\r\n\r\n");
       
   605 
       
   606 
       
   607 NONSHARABLE_CLASS(CUdpClientTestUPnP11) : public CUdpClientTestBase,
       
   608 										public Messages::ASimpleNodeIdBase,
       
   609 										public MTestServerObserver
       
   610 	{
       
   611 public:
       
   612 	static CUdpClientTestUPnP11* NewL ( CProxyProvd* aProvd );
       
   613 
       
   614 	//MTestServerObserver
       
   615 	void OnTestServerEventL ( TInt aError );
       
   616 
       
   617 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   618 	
       
   619 private:
       
   620 	enum TState
       
   621 		{
       
   622 		ECreateTestServer = 0,
       
   623 		ECreateTestClient,
       
   624 		ESendRequestData,
       
   625 		EFailed,
       
   626 		ECleanup,
       
   627 		};
       
   628 		
       
   629 	CUdpClientTestUPnP11 ( CProxyProvd* aProvd );
       
   630 	~CUdpClientTestUPnP11();
       
   631 	void ConstructL ();
       
   632 	virtual TVerdict RunTestL ();
       
   633 	//void Cleanup();
       
   634 
       
   635 private:	
       
   636 	CTestMUdpServer*	iTestServer;	
       
   637 	Messages::TNodeId 	iClientId;
       
   638 	RTimer				iTimer;
       
   639 	TState				iState;
       
   640 	};
       
   641 
       
   642 
       
   643 //----------------------------------------------------------------------------------------------------------------------------------
       
   644 _LIT8 ( KInvalidRes13, "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=900\r\nEXT: \r\nLOCATION:http://10.192.196.204:54042/\r\nST: testcase1\r\nContent-Length: 0\r\n\r\n");
       
   645 
       
   646 
       
   647 NONSHARABLE_CLASS(CUdpClientTestUPnP12) : public CUdpClientTestBase,
       
   648 										public MSocketHandlerObserver,
       
   649 										public Messages::ASimpleNodeIdBase,
       
   650 										public MTestServerObserver
       
   651 	{
       
   652 public:
       
   653 	static CUdpClientTestUPnP12* NewL ( CProxyProvd* aProvd );
       
   654 
       
   655 	//MTestServerObserver
       
   656 	void OnTestServerEventL ( TInt aError );
       
   657 
       
   658 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
   659 	
       
   660 	// From MSocketHandlerObserver
       
   661 	virtual void OpenComplete ( RInternalSocket& aSocket );
       
   662 	inline virtual void ConnectComplete ();
       
   663 	inline virtual void AcceptComplete ( RInternalSocket&  );
       
   664 	inline virtual void SendComplete ( TInt  );
       
   665 	inline virtual void SendToComplete ( TInt  );
       
   666 	inline virtual void RecvComplete ( RMBufChain&  );
       
   667 	inline virtual void RecvFromComplete ( RMBufChain& , const TSockAddr&  );
       
   668 	inline virtual void Error ( TOperation , TInt   );
       
   669 
       
   670 private:
       
   671 	enum TState
       
   672 		{
       
   673 		ECreateTestServer = 0,
       
   674 		ECreateTestClient,
       
   675 		EOpenTestSocket,
       
   676 		ESendRequestData,
       
   677 		EFailed,
       
   678 		ECleanup,
       
   679 		};
       
   680 		
       
   681 	CUdpClientTestUPnP12 ( CProxyProvd* aProvd );
       
   682 	~CUdpClientTestUPnP12();
       
   683 	void ConstructL ();
       
   684 	virtual TVerdict RunTestL ();
       
   685 	//void Cleanup();
       
   686 
       
   687 private:	
       
   688 	CTestMUdpServer*	iTestServer;	
       
   689 	Messages::TNodeId 	iClientId;
       
   690 	RTimer				iTimer;
       
   691 	TState				iState;
       
   692 	
       
   693 	RPointerArray <RInternalSocket>			iSocketArray;
       
   694 	RSocketHandler			iSocketHandler;
       
   695 	CSocketOpener* 			iSocketOpener;
       
   696 	TUint 					iPort;
       
   697 	};
       
   698 
       
   699 void CUdpClientTestUPnP12::ConnectComplete ()
       
   700 	{
       
   701 	
       
   702 	}
       
   703 void CUdpClientTestUPnP12::AcceptComplete ( RInternalSocket&  )
       
   704 	{
       
   705 	
       
   706 	}
       
   707 void CUdpClientTestUPnP12::SendComplete ( TInt  )
       
   708 	{
       
   709 	
       
   710 	}
       
   711 void CUdpClientTestUPnP12::SendToComplete ( TInt  )
       
   712 	{
       
   713 	
       
   714 	}
       
   715 void CUdpClientTestUPnP12::RecvComplete ( RMBufChain&  )
       
   716 	{
       
   717 	
       
   718 	}
       
   719 void CUdpClientTestUPnP12::RecvFromComplete ( RMBufChain& , const TSockAddr&  )
       
   720 	{
       
   721 	
       
   722 	}
       
   723 void CUdpClientTestUPnP12::Error ( TOperation , TInt   )
       
   724 	{
       
   725 	
       
   726 	}
       
   727 
       
   728 
       
   729 #endif //PUDPCLIENTTESTS_H
       
   730 
       
   731 
       
   732