// Copyright (c) 2007-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:
//

//! @File
//! @SYMTestSuiteName LBS-HybridMOLR-UEAssistedMOLR-GpsOk
//! @SYMScriptTestEnvironment TestExecute using hybrid_ueassisted_molr_gpsok.script


LOAD_SUITE LbsHybridMOLRTestServer -SharedData

PRINT Run LbsHybridMOLRTestServer


// Before we start LBS, select the test A-GPS integration module to use.
// Make sure the default profile is used, rather than one from the c drive
PREFIX RUN_UTILS
	DeleteFile c:\private\10282253\lbs\lbsprofile.ini
	MkDir c:\private\10282253\
	MkDir c:\private\10282253\lbs\
	MkDir c:\private\10282253\lbs\locmods\
//	CopyFile c:\testdata\configs\xtestmodule.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini
        CopyFile c:\testdata\configs\ctagpsnpetestmoduledatasource.ini  c:\private\10282253\lbs\locmods\agpsintegmodule.ini
	CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt
REMOVE_PREFIX

// Reset admin (reset will give us the EGpsPreferTerminalBased).
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_ResetDefaultAdmin

// Use hybrid protocol module
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_SetupProtocolStub

// Use hybrid protocol module
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_SetupRoamSelfLocate

RUN_TEST_STEP 030 LbsHybridMOLRTestServer LbsStep_StartLbs

START_TESTCASE                LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0001
//! @SYMTestCaseID              LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0001
//! @SYMTestCaseDesc            Client generates MOLR request 
//!				GPS Module generates an accurate position in UE Assisted State 
//!				Note: The position generated by the GPS Module is of greater accuracy than the Ref Position 
//!				See: lbshybridmolr/documentation/MOLR.htm#Hybrid_LBS_UE-Assisted_MO-LR_Accurate
//! @SYMTestPriority            Critical
//! @SYMTestActions             See test step Sequence inline comments
//! @SYMTestExpectedResults     Sequence as per specified by FSM and UML Seq diagram is Followed
//! @SYMTestType                CIT
//! @SYMCreationDate            28/8/2008
//! @SYMAuthor                  alans
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_SetUpPsy c:\testdata\configs\lbs_molr.ini LBS-MOLR
// Configure Hybrid AGps module options
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsStep_ConfigHybridModule c:\testdata\configs\lbs_molr.ini UEAssistedMOLRGpsOk
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsHybridUEAssistedMOLRGPSOk
END_TESTCASE                  LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0001


/////////////////////////////////////////////////////////////////////////
// It should not be necessary to restart Lbs in between tests. 
// However do this for now so the next test step does not fail

RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_StopLbs

RUN_TEST_STEP 030 LbsHybridMOLRTestServer LbsStep_StartLbs

START_TESTCASE                LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0002
//! @SYMTestCaseID              LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0002
//! @SYMTestCaseDesc            Client generates MOLR request 
//!				GPS Module generates an accurate position in UE Assisted State 
//!				Note: The position generated by the GPS Module is of greater accuracy than the Ref Position 
//!				See: lbshybridmolr/documentation/MOLR.htm#Hybrid_LBS_UE-Assisted_MO-LR_Accurate
//! @SYMTestPriority            Critical
//! @SYMTestActions             See test step Sequence inline comments
//! @SYMTestExpectedResults     Sequence as per specified by FSM and UML Seq diagram is Followed
//! @SYMTestType                CIT
//! @SYMCreationDate            28/8/2008
//! @SYMAuthor                  alans
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_SetUpPsy c:\testdata\configs\lbs_molr.ini LBS-MOLR
// Configure Hybrid AGps module options
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsStep_ConfigHybridModule c:\testdata\configs\lbs_molr.ini INC103714
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsHybridUEAssistedMOLRGPSOk
END_TESTCASE                  LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0002

/////////////////////////////////////////////////////////////////////////
// It should not be necessary to restart Lbs in between tests. 
// However do this for now so the next test step does not fail

RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_StopLbs

RUN_TEST_STEP 030 LbsHybridMOLRTestServer LbsStep_StartLbs

START_TESTCASE                LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0003
//! @SYMTestCaseID              LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0003
//! @SYMTestCaseDesc            Client generates a self locate MOLR request and
//!                             then cancels it. A single cancel should be sent out to the protocol module.
//!                             This test checks that one and  only one cancel arrives at the prtocol module.
//!                             If the cancel on the request bus to the AGPS manager is overwritten
//!                             by a status message then the test will fail. Thus this test
//!                             validates code in the locations server that prevents the cancel
//!                             being overwritten. It also validates code in the agps manager
//!                             that prevents a second cancel being sent to the protocol module
//!                             when it shouldn't after the loc server has sent two cancels back to back
//!                             INC121701: [v9.4] No Cancel to AGPSmodule at the bottom of the sequence of Hybrid Self-Locate
//! @SYMTestPriority            Critical
//! @SYMTestActions             See test step Sequence inline comments
//! @SYMTestExpectedResults     A cancel sent to protocol module
//! @SYMTestType                CIT
//! @SYMCreationDate            28/8/2008
//! @SYMAuthor                  alans
RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_SetUpPsy c:\testdata\configs\lbs_molr.ini LBS-MOLR
// Configure Hybrid AGps module options
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsStep_ConfigHybridModule c:\testdata\configs\lbs_molr.ini UEAssistedMOLRCancel
RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsHybridUEAssistedMOLRGPSOk c:\testdata\configs\lbs_molr.ini UEAssistedMOLRCancel
END_TESTCASE                  LBS-HybridMOLR-UEAssistedMOLR-GpsOk-0003


RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_StopLbs

RUN_UTILS DeleteFile c:\private\10282253\lbs\locmods\agpsintegmodule.ini

