diff -r 000000000000 -r 9cfd9a3ee49c networkprotocolmodules/suplprotocolmodule/SuplProtocol/test/src/molr31Step.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/SuplProtocol/test/src/molr31Step.cpp Tue Feb 02 01:50:39 2010 +0200 @@ -0,0 +1,154 @@ +// 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: +// Example CTestStep derived implementation +// +// + +/** + @file molr31Step.cpp + @internalTechnology +*/ +#include "molr31Step.h" +#include "Te_suplprotocolSuiteDefs.h" + +Cmolr31Step::~Cmolr31Step() + { + } + +Cmolr31Step::Cmolr31Step() + { + SetTestStepName(Kmolr31Step); + } + +/** + * @return - TVerdict code + * Override of base class virtual + */ +TVerdict Cmolr31Step::doTestStepPreambleL() + + { + + // Call base class method for pre test actions + CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); + + TLbsNetProtocolModuleParams param(*iGatewayObserver); + iModule = CSuplGatewayInterface::NewL(reinterpret_cast(¶m)); + + return TestStepResult(); + } + +/** Perform CMoLrStep1 test step. +This test verifies that the SUPL Protocol Module correctly handles +an Cell-Based MO-LR Self Locate sequence . + +@return TVerdict test result code +*/ +TVerdict Cmolr31Step::doTestStepL() + { + + INFO_PRINTF1(_L("\t********************************************************************")); + INFO_PRINTF1(_L("\tMOLR, Cell Based - connection terminated by server after SUPL END")); + INFO_PRINTF1(_L("\t********************************************************************")); + INFO_PRINTF1(_L("- START -")); + + // Initiate MO-LR + INFO_PRINTF1(_L("\tLBS -> RequestNetworkLocation")); + TLbsNetSessionId sessionId1(TUid::Uid(0x12345678), 0x1111); + TLbsNetPosRequestOptions options1; + options1.SetNewClientConnected(ETrue); + TLbsNetPosRequestQuality quality1; + options1.SetRequestQuality(quality1); + iModule->RequestNetworkLocation(sessionId1, options1); + + // Check Connection Manager receives a request for connecting + if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); + + // Simulate the connection is up (inject that event) + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); + iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); + + // Check Connection Manager receives a request to send a SUPL START + if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); + + // Inject a SUPL END (with position) + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END <- NET")); + CSuplMessageBase* suplEnd = BuildSuplEndL(ETrue); + iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplEnd); + + // Fake the connection going down after the SLP closes it. + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connection Error <- NET")); + iNetworkObserver->InjectConnectionErrorIndication(iNetworkObserver->SessionId(), MSuplConnectionManagerObserver::EConnectionLost); + + // Check gateway receives Location Update + INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate()")); + if (EFail == CheckGatewayCallbackL( + CSuplGatewayObserver::EProcessLocationUpdate)) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + + // Check gateway receives a session complete indication + if (EFail == CheckGatewayCallbackL( + CSuplGatewayObserver::EProcessSessionComplete)) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); + + // Check Connection Manager receives a disconnection request + if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); + + // Check if more observer activity takes place + if (iGatewayObserver->IsMoreObserverActivity() || + iNetworkObserver->IsMoreObserverActivity()) + { + SetTestStepResult(EFail); + return TestStepResult(); + } + INFO_PRINTF1(_L("- END -")); + + SetTestStepResult(EPass); + return TestStepResult(); + } + + +/** + * @return - TVerdict code + * Override of base class virtual + */ +TVerdict Cmolr31Step::doTestStepPostambleL() + { + delete iModule; + + // Call base class method for post test actions + CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); + return TestStepResult(); + }