//! @File
//! @SYMTestSuiteName	lbsclientcellbasednpud_real.script
//! @SYMScriptTestEnvironment

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

LOAD_SUITE LbsClientTestServer -SharedData
// Re-select the profile ini
RUN_UTILS DeleteFile c:\private\10282253\lbs\lbsprofile.ini

PRINT Run LbsClientTestServer
PRINT

//Before we start LBS, select the network reg status txt file to use.
RUN_UTILS CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt
PREFIX RUN_UTILS
MkDir c:\private\10282253\
MkDir c:\private\10282253\lbs\
MkDir c:\private\10282253\lbs\locmods\
CopyFile z:\testdata\configs\sirfdatasource.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini
REMOVE_PREFIX

RUN_TEST_STEP 010 LbsClientTestServer LbsStep_ResetDefaultAdmin 
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_StartLbs


START_TESTCASE LBS-Client-CellBasedNPUDReal-0001

//!@SYMTestCaseID			LBS-Client-CellBasedNPUDReal-0001
//!@SYMTestCaseDesc			Request a cell-based location
//!
//!@SYMTestActions			Open a sub-session using RPositioner::Open() and specifying the network module�s module id
//!					Request Location Update.
//!					Wait for location request to complete.
//!					Verify that the location request is logged with appropriate details.                                                                                                                                                                 
//!
//!@SYMTestExpectedResults		Reference (cell-based) location retrieved and details logged
//!
//!@SYMPREQ				PREQ786
//!@SYMPREQ				PREQ89
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented

RUN_TEST_STEP 010 LbsClientTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_SetUpPsy c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-CLIENT-CELLBASEDNPUD
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_CreateVerifyPosInfos  c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased
RUN_TEST_STEP 120 LbsClientTestServer LbsClientStep_CellBasedNotifyPosUpdate c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased-0001
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyPosInfos
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Client-CellBasedNPUDReal-0001


START_TESTCASE LBS-Client-CellBasedNPUDReal-0002

//!@SYMTestCaseID			LBS-Client-CellBasedNPUDReal-0002
//!@SYMTestCaseDesc			Request a cell-based location and cancel before it completes
//!
//!@SYMTestActions			
//!					Open a sub-session using RPositioner::Open() and specifying the network module�s module id
//!					Request Location Update.
//!					Cancel the update (should return KErrNone if cancel successfully sent to server, or KErrNotFound if too late)
//!					Wait for location request to complete.
//!
//!@SYMTestExpectedResults		Request completes with KErrCancel (if cancel was successful) or KErrNone (if too late)
//!					Request is logged with appropriate details.                                                                                                                                                                 
//!
//!@SYMPREQ				PREQ786
//!@SYMPREQ				PREQ89
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			2
//!@SYMTestStatus			Implemented

RUN_TEST_STEP 010 LbsClientTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_SetUpPsy c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-CLIENT-CELLBASEDNPUD
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_CreateVerifyPosInfos	c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased
RUN_TEST_STEP 120 LbsClientTestServer LbsClientStep_CellBasedNotifyPosUpdate c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased-0002
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Client-CellBasedNPUDReal-0002


START_TESTCASE LBS-Client-CellBasedNPUDReal-0003

//!@SYMTestCaseID			LBS-Client-CellBasedNPUDReal-0003
//!@SYMTestCaseDesc			Request a cell-based location, when network unavailable
//!
//!@SYMTestActions			Open a sub-session using RPositioner::Open() and specifying the network module�s module id
//!					Make network unavailable (tell NetSim to return error)
//!					Request Location Update.
//!					Wait for location request to complete.
//!					Verify that the location request is logged with appropriate details.                                                                                                                                                                 

//!
//!@SYMTestExpectedResults		Request should complete with appropriate error code 
//!
//!@SYMPREQ				PREQ786
//!@SYMPREQ				PREQ89
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented

RUN_TEST_STEP 010 LbsClientTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_SetUpPsy c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-CLIENT-CELLBASEDNPUD
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_CreateVerifyPosInfos	c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased
RUN_TEST_STEP 120 LbsClientTestServer LbsClientStep_CellBasedNotifyPosUpdate c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased-0003
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Client-CellBasedNPUDReal-0003


START_TESTCASE LBS-Client-CellBasedNPUDReal-0004

//!@SYMTestCaseID			LBS-Client-CellBasedNPUDReal-0004
//!@SYMTestCaseDesc			Multiple sequential Location Update requests using Network
//!
//!@SYMTestActions		1. Request Location Update from Network
//!					2. Wait for request to complete
//!					3. Verify that request completed successfully
//!					4. Repeat above a number of times (read from config)
//!					5. Verify that location infos are as expected.
//!					6. Verify that the location requests are logged?
//!
//!@SYMTestExpectedResults		All Requests complete successfully
//!
//!@SYMPREQ					PREQ786
//!@SYMREQ 					REQ786.02
//!@SYMREQ 					REQ786.07 
//!@SYMPREQ					PREQ89
//!@SYMREQ					REQ 89.03
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented

RUN_TEST_STEP 010 LbsClientTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_SetUpPsy c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-CLIENT-CELLBASEDNPUD
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_CreateVerifyPosInfos	c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased-0004
RUN_TEST_STEP 120 LbsClientTestServer LbsClientStep_CellBasedNotifyPosUpdate 	c:\testdata\configs\LbsClientCellbasedNPUD_real.ini LBS-NotifyPosUpdate-CellBased-0004
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyPosInfos
RUN_TEST_STEP 010 LbsClientTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Client-CellBasedNPUDReal-0004

PRINT Stop LBS
RUN_TEST_STEP 020 LbsClientTestServer LbsStep_StopLbs

// Delete network registration status text file
RUN_UTILS DeleteFile c:\config.txt


