networkprotocolmodules/suplprotocolmodule/SuplProtocol/test/src/plugin2Step.cpp
changeset 36 b47902b73a93
parent 0 9cfd9a3ee49c
equal deleted inserted replaced
35:a2efdd544abf 36:b47902b73a93
       
     1 // Copyright (c) 2005-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 // Example CTestStep derived implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file plugin2Step.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "plugin2Step.h"
       
    23 #include "te_suplprotocolsuitedefs.h"
       
    24 #include "lbssystemcontroller.h"
       
    25 #include "lbssuplpushprops.h"
       
    26 
       
    27 Cplugin2Step::~Cplugin2Step()
       
    28 	{
       
    29 	}
       
    30 
       
    31 Cplugin2Step::Cplugin2Step()
       
    32 	{
       
    33 	SetTestStepName(Kplugin2Step);
       
    34 	}
       
    35 
       
    36 /** Perform pre test actions
       
    37 @return TVerdict test result code
       
    38 */
       
    39 TVerdict Cplugin2Step::doTestStepPreambleL()
       
    40 	{
       
    41 	// Call base class method for pre test actions	
       
    42 	CTe_suplprotocolSuiteStepBase::doTestStepPreambleL();
       
    43 
       
    44 	LbsSuplPushProps::InitializeL();
       
    45 
       
    46 	return TestStepResult();
       
    47 	}
       
    48 
       
    49 
       
    50 /** Perform CPluginStep2 test step.
       
    51 This test verifies that the Test Protocol Module can be loaded via ECOM
       
    52 using the LBS Network Protocol SPI base class to instantiate the plug-in.
       
    53 
       
    54 @return TVerdict test result code
       
    55 */
       
    56 TVerdict Cplugin2Step::doTestStepL()
       
    57 	{
       
    58 	TLbsNetProtocolModuleParams params(*iGatewayObserver);
       
    59 	// Load the Test Protocol Module
       
    60 	INFO_PRINTF1(_L("\t About to load Test Protocol Module plug-in via ECOM"));
       
    61 	CLbsNetworkProtocolBase* protModule = NULL;
       
    62 	
       
    63 	TRAPD (error, protModule = CLbsNetworkProtocolBase::NewL(
       
    64 										TUid::Uid(KPluginUid),
       
    65 										params) ) ;
       
    66 										
       
    67 	// Confirm that the plug-in has been loaded
       
    68 	if (!protModule || error)
       
    69 		{
       
    70 		INFO_PRINTF1(_L("\t Test Protocol Module plug-in NOT loaded"));
       
    71 		SetTestStepResult(EFail);
       
    72 		}
       
    73 	else
       
    74 		{
       
    75 		INFO_PRINTF1(_L("\t Test Protocol Module plug-in loaded"));
       
    76 		SetTestStepResult(EPass);
       
    77 		delete protModule;
       
    78 		}
       
    79 
       
    80 	// Close ECom Session
       
    81 	REComSession::FinalClose();
       
    82 		
       
    83 	return TestStepResult();
       
    84 	
       
    85 	}
       
    86 
       
    87 
       
    88 /**
       
    89  * @return - TVerdict code
       
    90  * Override of base class virtual
       
    91  */
       
    92 TVerdict Cplugin2Step::doTestStepPostambleL()
       
    93 	{
       
    94 	// Call base class method for post test actions	
       
    95 	CTe_suplprotocolSuiteStepBase::doTestStepPostambleL();
       
    96 	
       
    97 	return TestStepResult();
       
    98 
       
    99 	}