lbstest/lbstestproduct/common/src/ctlbsserver.cpp
changeset 0 9cfd9a3ee49c
child 57 3267d9ea3e98
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2006-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 // @file CT_LbsServer.cpp
       
    15 // This is the class implementation for the LBS  Test Server
       
    16 // 
       
    17 //
       
    18 
       
    19 // User includes
       
    20 #include "ctlbsserver.h"
       
    21 
       
    22 // System includes
       
    23 #include <e32std.h>
       
    24 #include <rsshared.h>
       
    25 
       
    26 // Header files of LBS  API Test Steps
       
    27 #include "ctlbsstepinstallscheduler.h"
       
    28 #include "ctlbsstepcreateverifymoduledata.h"
       
    29 #include "ctlbsstepcreateverifyposinfos.h"
       
    30 #include "ctlbsstepverifyposinfos.h"
       
    31 #include "ctlbsstepverifyroughposinfos.h"
       
    32 #include "ctlbsstepverifymodinfo.h"
       
    33 #include "ctlbsstepverifyloginfo.h"
       
    34 #include "ctlbsstepverifymodstatus.h"
       
    35 #include "ctlbsstepsetautonomousmode.h"
       
    36 #include "ctlbsstepsetprivhandler.h"
       
    37 #include "ctlbsstepresetdefaultadmin.h"
       
    38 #include "ctlbsstepstartlbs.h"
       
    39 #include "ctlbsstepstoplbs.h"
       
    40 #include "ctlbsstepcreateverifymodinfo.h"
       
    41 #include "ctlbsstepclearlog.h"
       
    42 #include "ctlbsstepconfighybridmodule.h"
       
    43 #include "ctlbsstepsetupstandaloneprivacymode.h"
       
    44 #include "ctlbsstepsetupstandaloneprivacyandsimplectlr.h"
       
    45 #include "ctlbsstepsetupstandaloneprivacywithnoctlr.h"
       
    46 #include "ctlbsstepsetupsppmprivacymode.h"
       
    47 #include "ctlbsstepsetbehaviourmodeoriginal.h"
       
    48 #include "ctlbsstepsetptamode.h"
       
    49 #include "ctlbsstepsetatamode.h"
       
    50 #include "ctlbsstepsetptbmode.h"
       
    51 #include "ctlbsstepsetuppsy.h"
       
    52 #include "ctlbsstepconfignpppsy.h"
       
    53 #include "ctlbsstepconfigsuplpsy.h"
       
    54 
       
    55 CT_LbsServer::~CT_LbsServer()
       
    56 	{
       
    57 	delete iSharedData;
       
    58 	delete iScheduler;
       
    59 	}
       
    60 	
       
    61 	
       
    62 /**
       
    63   Function : CT_LbsServer
       
    64   Description : Constructor
       
    65   @internalTechnology
       
    66   @param :
       
    67   @return : N/A
       
    68   @precondition : none
       
    69   @postcondition : none
       
    70 */
       
    71 CT_LbsServer::CT_LbsServer()
       
    72 	{
       
    73 	}
       
    74 
       
    75 /**
       
    76   Function : ConstructL
       
    77   Description : 
       
    78   @internalTechnology
       
    79   @param :
       
    80   @return : N/A
       
    81   @precondition : none
       
    82   @postcondition : none
       
    83 */
       
    84 void CT_LbsServer::ConstructL(const TDesC& aName)
       
    85 	{
       
    86 	CTestServer::ConstructL(aName);
       
    87 
       
    88 	iScheduler = new (ELeave) CActiveScheduler();
       
    89 
       
    90 	// check what this does, do we need it...	
       
    91 	Logger().ShareAuto();	// enable the log system for all test threads via iParent.Logger()
       
    92 	}
       
    93 
       
    94 	
       
    95 /**
       
    96   Function : CreateTestStep
       
    97   Description : Creates a test step based on the step name read from the script file
       
    98   @internalTechnology
       
    99   @param : aStepName   The step name which needs to be created
       
   100   @return : Created object of type CTestStep
       
   101   @precondition : none
       
   102   @postcondition : none
       
   103 */
       
   104 CTestStep* CT_LbsServer::CreateTestStep(const TDesC& aStepName)
       
   105 	{
       
   106 	// NULL if insufficient memory. This suits the API.
       
   107 
       
   108 	// Common test steps, used by many different test cases.
       
   109 	if (aStepName == KLbsStep_InstallScheduler)
       
   110 		{
       
   111 		return CT_LbsStep_InstallScheduler::New(*this);
       
   112 		}
       
   113 
       
   114 	if (aStepName == KLbsStep_CreateVerifyModuleData)
       
   115 		{
       
   116 		return CT_LbsStep_CreateVerifyModuleData::New(*this);
       
   117 		}
       
   118 
       
   119 	if (aStepName == KLbsStep_CreateVerifyPosInfos)
       
   120 		{
       
   121 		return CT_LbsStep_CreateVerifyPosInfos::New(*this);
       
   122 		}
       
   123 
       
   124 	if (aStepName == KLbsStep_CreateVerifyModInfo)
       
   125 		{
       
   126 		return CT_LbsStep_CreateVerifyModInfo::New(*this);
       
   127 		}
       
   128 	
       
   129 	if (aStepName == KLbsStep_VerifyPosInfos)
       
   130 		{
       
   131 		return CT_LbsStep_VerifyPosInfos::New(*this);
       
   132 		}
       
   133 
       
   134 	if (aStepName == KLbsStep_VerifyRoughPosInfos)
       
   135 		{
       
   136 		return CT_LbsStep_VerifyRoughPosInfos::New(*this);
       
   137 		}
       
   138 
       
   139 	if(aStepName == KLbsStep_VerifyModInfo)	
       
   140 		{
       
   141 		return CT_LbsStep_VerifyModInfo::New(*this);
       
   142 		}
       
   143 
       
   144 	if (aStepName == KLbsStep_VerifyLogInfo)
       
   145 		{
       
   146 		return CT_LbsStep_VerifyLogInfo::New(*this);
       
   147 		}
       
   148 		
       
   149 	if (aStepName == KLbsStep_VerifyModuleStatus)
       
   150 		{
       
   151 		return CT_LbsStep_VerifyModStatus::New(*this);
       
   152 		}										
       
   153   		
       
   154   	if (aStepName == KLbsStep_StartLbs)
       
   155   		{
       
   156   		return CT_LbsStep_StartLbs::New(*this);
       
   157   		}
       
   158   		
       
   159   	if (aStepName == KLbsStep_StopLbs)
       
   160   		{
       
   161   		return CT_LbsStep_StopLbs::New(*this);
       
   162   		}						
       
   163 		
       
   164 	if (aStepName == KLbsStep_SetAutonomousMode)
       
   165 		{
       
   166 		return CT_LbsStep_SetAutonomousMode::New(*this);
       
   167 		}
       
   168 		
       
   169 	if (aStepName == KLbsStep_SetPrivacyHandler)
       
   170 		{
       
   171 		return CT_LbsStep_SetPrivacyHandler::New(*this);
       
   172 		}		
       
   173 		
       
   174 	if (aStepName == KLbsStep_ResetDefaultAdmin)
       
   175 		{
       
   176 		return CT_LbsStep_ResetDefaultAdmin::New(*this);
       
   177 		}		
       
   178 		
       
   179 	if (aStepName == KLbsStep_ClearLog)
       
   180 		{
       
   181 		return CT_LbsStep_ClearLog::New(*this);
       
   182 		}
       
   183 	
       
   184 	if (aStepName == KLbsStep_SetBehaviourModeOriginal)
       
   185 		{
       
   186 		return CT_LbsStep_SetBehaviourModeOriginal::New(*this);
       
   187 		}		
       
   188     
       
   189 	if (aStepName == KLbsStep_SetPTAMode)
       
   190 		{
       
   191 		return CT_LbsStep_SetPTAMode::New(*this);
       
   192 		}		
       
   193     
       
   194     if (aStepName == KLbsStep_ConfigHybridModule)
       
   195     	{
       
   196     	return CT_LbsStep_ConfigHybridModule::New(*this);
       
   197     	}
       
   198       
       
   199     if (aStepName == KLbsStep_SetupStandalonePrivacyMode)
       
   200     	{
       
   201     	return CT_LbsStep_SetupStandalonePrivacyMode::New(*this);
       
   202     	}
       
   203       
       
   204     if (aStepName == KLbsStep_SetupStandalonePrivacyAndSimpleCtlr)
       
   205     	{
       
   206     	return CT_LbsStep_SetupStandalonePrivacyAndSimpleCtlr::New(*this);
       
   207     	}
       
   208       
       
   209     if (aStepName == KLbsStep_SetupStandalonePrivacyWithNoCtlr)
       
   210     	{
       
   211     	return CT_LbsStep_SetupStandalonePrivacyWithNoCtlr::New(*this);
       
   212     	}
       
   213     
       
   214     if (aStepName == KLbsStep_SetupSPPMPrivacyMode)
       
   215     	{
       
   216     	return CT_LbsStep_SetupSPPMPrivacyMode::New(*this);
       
   217     	}
       
   218     
       
   219    	if (aStepName == KLbsStep_SetATAMode)
       
   220 		{
       
   221 		return CT_LbsStep_SetATAMode::New(*this);
       
   222 		}	
       
   223    	
       
   224    	if (aStepName == KLbsStep_SetPTBMode)
       
   225 		{
       
   226 		return CT_LbsStep_SetPTBMode::New(*this);
       
   227 		}   	
       
   228       
       
   229    	if (aStepName == KLbsStep_SetUpPsy)
       
   230 		{
       
   231 		return CT_LbsStep_SetUpPsy::New(*this);
       
   232 		} 
       
   233 
       
   234     if (aStepName == KLbsStep_ConfigNppPsy)
       
   235         {
       
   236         return CT_LbsStep_ConfigNppPsy::New(*this);
       
   237         }
       
   238 
       
   239     if (aStepName == KLbsStep_ConfigSuplPsy)
       
   240         {
       
   241         return CT_LbsStep_ConfigSuplPsy::New(*this);
       
   242         }
       
   243     
       
   244 	return NULL;
       
   245 	}