networkprotocolmodules/suplprotocolmodule/SuplProtocol/test/src/plugin1Step.cpp
changeset 0 9cfd9a3ee49c
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 // Example CTestStep derived implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file plugin1Step.cpp
       
    20 */
       
    21 #include "plugin1Step.h"
       
    22 #include "te_suplprotocolsuitedefs.h"
       
    23 
       
    24 const TUid KLbsNetworkProtocolInterfaceUid = {0x10281D4A};
       
    25 
       
    26 /** Destructor
       
    27 */
       
    28 Cplugin1Step::~Cplugin1Step()
       
    29 	{
       
    30 	}
       
    31 
       
    32 
       
    33 /** Constructor
       
    34 */
       
    35 Cplugin1Step::Cplugin1Step()
       
    36 	{
       
    37 	SetTestStepName(Kplugin1Step);
       
    38 	}
       
    39 
       
    40 
       
    41 /** Perform pre test actions
       
    42 @return TVerdict test result code
       
    43 */
       
    44 TVerdict Cplugin1Step::doTestStepPreambleL()
       
    45 	{
       
    46 	// Call base class method for pre test actions	
       
    47 	CTe_suplprotocolSuiteStepBase::doTestStepPreambleL();
       
    48 
       
    49 	return TestStepResult();
       
    50 	}
       
    51 
       
    52 
       
    53 /** Perform Cplugin1Step test step.
       
    54 This test verifies that the Test Protocol Module is shown in the ECOM
       
    55 list of plug-ins that implement the LBS Network Protocol SPI.
       
    56 
       
    57 @return TVerdict test result code
       
    58 */
       
    59 TVerdict Cplugin1Step::doTestStepL()
       
    60 	{
       
    61 	// List plugin implementations
       
    62 	RImplInfoPtrArray pluginArray;
       
    63 	REComSession::ListImplementationsL( KLbsNetworkProtocolInterfaceUid,
       
    64 										pluginArray );
       
    65 
       
    66 	// Confirm that at least one plug-in exists
       
    67 	INFO_PRINTF2(_L("\t Number of plugins listed = %d"), pluginArray.Count());
       
    68 	if (pluginArray.Count() <= 0)
       
    69 		{
       
    70 		SetTestStepResult(EFail);
       
    71 		}
       
    72 	else
       
    73 		{
       
    74 		// Confirm that one of the plug-ins is the Test Protocol Module
       
    75 		TInt loop;
       
    76 		TBool pluginFound(EFalse);
       
    77 		for (loop = 0; (loop < pluginArray.Count()) && !pluginFound; ++loop)
       
    78 			{
       
    79 			CImplementationInformation* pluginImp = pluginArray[loop];
       
    80 			if (pluginImp->ImplementationUid() == TUid::Uid(KPluginUid))
       
    81 				{
       
    82 				pluginFound = ETrue;
       
    83 				INFO_PRINTF1(_L("\t Test protocol module plug-in UID found"));
       
    84 				}
       
    85 			}
       
    86 		SetTestStepResult(pluginFound ? EPass : EFail);
       
    87 
       
    88 		// Clear up array
       
    89 		for (loop = pluginArray.Count(); loop > 0; loop--)
       
    90 			{
       
    91 			delete pluginArray[loop - 1];
       
    92 			}
       
    93 		}
       
    94 
       
    95 	// Clear up array
       
    96 	pluginArray.Close();
       
    97 
       
    98 	// FinalClose for ECom
       
    99 	REComSession::FinalClose();
       
   100 	
       
   101 	return TestStepResult();
       
   102 	}
       
   103 
       
   104 
       
   105 
       
   106 /** Perform post test actions
       
   107 @return TVerdict test result code
       
   108 */
       
   109 TVerdict Cplugin1Step::doTestStepPostambleL()
       
   110 	{
       
   111 	// Call base class method for post test actions	
       
   112 	CTe_suplprotocolSuiteStepBase::doTestStepPostambleL();
       
   113 	
       
   114 	return TestStepResult();
       
   115 	}