wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteServer.cpp
branchRCL_3
changeset 18 50bae5c5c85f
equal deleted inserted replaced
17:3f227a47ad75 18:50bae5c5c85f
       
     1 // Copyright (c) 2002-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 // WAP stack test suite server
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 // Include your own server header file and step header file(s) here
       
    24 #include "WapStackSuiteServer.h"
       
    25 
       
    26 #include "WapBoundWDPSteps.h"
       
    27 #include "WapBoundCLPushSteps.h"
       
    28 #include "WapBoundWSPSteps.h"
       
    29 #include "WapFullySpecCLPushSteps.h"
       
    30 #include "WapFullySpecWDPSteps.h"
       
    31 #include "WapFullySpecWSPSteps.h"
       
    32 #include <ecom/ecom.h>
       
    33 
       
    34 _LIT(KServerName,"WapStackSuite");
       
    35 CWapStackSuite* CWapStackSuite::NewL()
       
    36 /**
       
    37  * @return - Instance of the test server
       
    38  * Same code for Secure and non-secure variants
       
    39  * Called inside the MainL() function to create and start the
       
    40  * CTestServer derived server.
       
    41  */
       
    42 	{
       
    43 	CWapStackSuite * server = new (ELeave) CWapStackSuite();
       
    44 	CleanupStack::PushL(server);
       
    45 	// CServer base class call
       
    46 	server->StartL(KServerName);
       
    47 	CleanupStack::Pop(server);
       
    48 	return server;
       
    49 	}
       
    50 
       
    51 
       
    52 
       
    53 LOCAL_C void MainL()
       
    54 	{
       
    55 #if (defined __DATA_CAGING__)
       
    56 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    57 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    58 #endif
       
    59 	CActiveScheduler* sched=NULL;
       
    60 	sched=new(ELeave) CActiveScheduler;
       
    61 	CActiveScheduler::Install(sched);
       
    62 	CWapStackSuite* server = NULL;
       
    63 	// Create the CTestServer derived server
       
    64 	TRAPD(err,server = CWapStackSuite::NewL());
       
    65 	if(!err)
       
    66 		{
       
    67 		// Sync with the client and enter the active scheduler
       
    68 		RProcess::Rendezvous(KErrNone);
       
    69 		sched->Start();
       
    70 		}
       
    71 	delete server;
       
    72 	delete sched;
       
    73 	}
       
    74 
       
    75 
       
    76 
       
    77 GLDEF_C TInt E32Main()
       
    78 /**
       
    79  * @return - Standard Epoc error code on process exit
       
    80  * Secure variant only
       
    81  * Process entry point. Called by client using RProcess API
       
    82  */
       
    83 	{
       
    84 	__UHEAP_MARK;
       
    85 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    86 	if(cleanup == NULL)
       
    87 		{
       
    88 		return KErrNoMemory;
       
    89 		}
       
    90 	TRAPD(err,MainL());
       
    91 	delete cleanup;
       
    92 	__UHEAP_MARKEND;
       
    93 	return err;
       
    94     }
       
    95 
       
    96 CTestStep* CWapStackSuite::CreateTestStep(const TDesC& aStepName)
       
    97 /**
       
    98  * @return - A CTestStep derived instance
       
    99  * Secure and non-secure variants
       
   100  * Implementation of CTestServer pure virtual
       
   101  */
       
   102 	{
       
   103 	CTestStep* testStep = NULL;
       
   104 	// Creating your own test steps here
       
   105 	//*************************************
       
   106 	// BOUND connection tests
       
   107 	//*************************************
       
   108 
       
   109 	// Bound WDP steps [1 - 9]
       
   110 	if(aStepName == KBoundWDPStep_1) 
       
   111 		testStep = new CBoundWDPStep_1();
       
   112 	else if(aStepName == KBoundWDPStep_2) 
       
   113 		testStep = new CBoundWDPStep_2();
       
   114 	else if(aStepName == KBoundWDPStep_3) 
       
   115 		testStep = new CBoundWDPStep_3();
       
   116 	else if(aStepName == KBoundWDPStep_4) 
       
   117 		testStep = new CBoundWDPStep_4();
       
   118 	else if(aStepName == KBoundWDPStep_5) 
       
   119 		testStep = new CBoundWDPStep_5();
       
   120 	else if(aStepName == KBoundWDPStep_6) 
       
   121 		testStep = new CBoundWDPStep_6();
       
   122 	else if(aStepName == KBoundWDPStep_7) 
       
   123 		testStep = new CBoundWDPStep_7();
       
   124 	else if(aStepName == KBoundWDPStep_8) 
       
   125 		testStep = new CBoundWDPStep_8();
       
   126 	else if(aStepName == KBoundWDPStep_9) 
       
   127 		testStep = new CBoundWDPStep_9();
       
   128 	else if(aStepName == KBoundWDPStep_OutOfMemory) 
       
   129 		testStep = new CBoundWDPStep_OutOfMemory();
       
   130 
       
   131 	// Bound Push tests [1 - 9]
       
   132 	else if(aStepName == KBoundCLPushStep_1) 
       
   133 		testStep = new CBoundCLPushStep_1();
       
   134 	else if(aStepName == KBoundCLPushStep_2) 
       
   135 		testStep = new CBoundCLPushStep_2();
       
   136 	else if(aStepName == KBoundCLPushStep_3) 
       
   137 		testStep = new CBoundCLPushStep_3();
       
   138 	else if(aStepName == KBoundCLPushStep_4) 
       
   139 		testStep = new CBoundCLPushStep_4();
       
   140 	else if(aStepName == KBoundCLPushStep_5) 
       
   141 		testStep = new CBoundCLPushStep_5();
       
   142 	else if(aStepName == KBoundCLPushStep_6) 
       
   143 		testStep = new CBoundCLPushStep_6();
       
   144 	else if(aStepName == KBoundCLPushStep_7) 
       
   145 		testStep = new CBoundCLPushStep_7();
       
   146 	else if(aStepName == KBoundCLPushStep_8) 
       
   147 		testStep = new CBoundCLPushStep_8();
       
   148 	else if(aStepName == KBoundCLPushStep_9) 
       
   149 		testStep = new CBoundCLPushStep_9();
       
   150 	
       
   151 	// Bound WSP tests [1 - 9]
       
   152 	else if(aStepName == KBoundWSPStep_1) 
       
   153 		testStep = new CBoundWSPStep_1();
       
   154 	else if(aStepName == KBoundWSPStep_2) 
       
   155 		testStep = new CBoundWSPStep_2();
       
   156 	else if(aStepName == KBoundWSPStep_3) 
       
   157 		testStep = new CBoundWSPStep_3();
       
   158 	else if(aStepName == KBoundWSPStep_4) 
       
   159 		testStep = new CBoundWSPStep_4();
       
   160 	else if(aStepName == KBoundWSPStep_5) 
       
   161 		testStep = new CBoundWSPStep_5();
       
   162 	else if(aStepName == KBoundWSPStep_6) 
       
   163 		testStep = new CBoundWSPStep_6();
       
   164 	else if(aStepName == KBoundWSPStep_7) 
       
   165 		testStep = new CBoundWSPStep_7();
       
   166 	else if(aStepName == KBoundWSPStep_8) 
       
   167 		testStep = new CBoundWSPStep_8();
       
   168 	else if(aStepName == KBoundWSPStep_9) 
       
   169 		testStep = new CBoundWSPStep_9();
       
   170 
       
   171 	//*************************************
       
   172 	// FULLY SPECIFIED connection tests
       
   173 	//*************************************
       
   174 
       
   175 	// Fully spec. WDP [1 - 9
       
   176 	else if(aStepName == KFullySpecWDPStep_1) 
       
   177 		testStep = new CFullySpecWDPStep_1();
       
   178 	else if(aStepName == KFullySpecWDPStep_2) 
       
   179 		testStep = new CFullySpecWDPStep_2();
       
   180 	else if(aStepName == KFullySpecWDPStep_3) 
       
   181 		testStep = new CFullySpecWDPStep_3();
       
   182 	else if(aStepName == KFullySpecWDPStep_4) 
       
   183 		testStep = new CFullySpecWDPStep_4();
       
   184 	else if(aStepName == KFullySpecWDPStep_5) 
       
   185 		testStep = new CFullySpecWDPStep_5();
       
   186 	else if(aStepName == KFullySpecWDPStep_6) 
       
   187 		testStep = new CFullySpecWDPStep_6();
       
   188 	else if(aStepName == KFullySpecWDPStep_7) 
       
   189 		testStep = new CFullySpecWDPStep_7();
       
   190 	else if(aStepName == KFullySpecWDPStep_8) 
       
   191 		testStep = new CFullySpecWDPStep_8();
       
   192 	else if(aStepName == KFullySpecWDPStep_9) 
       
   193 		testStep = new CFullySpecWDPStep_9();
       
   194 	
       
   195 	// Fully spec. Push [1 - 9]
       
   196 	else if(aStepName == KFullySpecCLPushStep_1) 
       
   197 		testStep = new CFullySpecCLPushStep_1();
       
   198 	else if(aStepName == KFullySpecCLPushStep_2) 
       
   199 		testStep = new CFullySpecCLPushStep_2();
       
   200 	else if(aStepName == KFullySpecCLPushStep_3) 
       
   201 		testStep = new CFullySpecCLPushStep_3();
       
   202 	else if(aStepName == KFullySpecCLPushStep_4) 
       
   203 		testStep = new CFullySpecCLPushStep_4();
       
   204 	else if(aStepName == KFullySpecCLPushStep_5) 
       
   205 		testStep = new CFullySpecCLPushStep_5();
       
   206 	else if(aStepName == KFullySpecCLPushStep_6) 
       
   207 		testStep = new CFullySpecCLPushStep_6();
       
   208 	else if(aStepName == KFullySpecCLPushStep_7) 
       
   209 		testStep = new CFullySpecCLPushStep_7();
       
   210 	else if(aStepName == KFullySpecCLPushStep_8) 
       
   211 		testStep = new CFullySpecCLPushStep_8();
       
   212 	else if(aStepName == KFullySpecCLPushStep_9) 
       
   213 		testStep = new CFullySpecCLPushStep_9();
       
   214 
       
   215 	// Fully spec. WSP [1 - 9]
       
   216 	else if(aStepName == KFullySpecWSPStep_1) 
       
   217 		testStep = new CFullySpecWSPStep_1();
       
   218 	else if(aStepName == KFullySpecWSPStep_2) 
       
   219 		testStep = new CFullySpecWSPStep_2();
       
   220 	else if(aStepName == KFullySpecWSPStep_3) 
       
   221 		testStep = new CFullySpecWSPStep_3();
       
   222 	else if(aStepName == KFullySpecWSPStep_4) 
       
   223 		testStep = new CFullySpecWSPStep_4();
       
   224 	else if(aStepName == KFullySpecWSPStep_5) 
       
   225 		testStep = new CFullySpecWSPStep_5();
       
   226 	else if(aStepName == KFullySpecWSPStep_6) 
       
   227 		testStep = new CFullySpecWSPStep_6();
       
   228 	else if(aStepName == KFullySpecWSPStep_7)
       
   229 		testStep = new CFullySpecWSPStep_7();
       
   230 	else if(aStepName == KFullySpecWSPStep_8) 
       
   231 		testStep = new CFullySpecWSPStep_8();
       
   232 	else if(aStepName == KFullySpecWSPStep_9) 
       
   233 		testStep = new CFullySpecWSPStep_9();
       
   234 
       
   235 	return testStep;
       
   236 	}