imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/imconnectionprovider_testBlocks.cpp
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  imconnectionprovider_testBlocks.cpp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES] - do not remove
       
    21 
       
    22 #include "imconnectionprovider_test.h"
       
    23 #include <e32std.h>
       
    24 #include <e32svr.h>
       
    25 #include <StifParser.h>
       
    26 #include <StifTestInterface.h>
       
    27 #include <e32def.h>
       
    28 #include <spdefinitions.h>
       
    29 #include <ximperrors.hrh>
       
    30 #include "cchserviceobserver.h"
       
    31 
       
    32 extern TBool setpassword ;
       
    33 // EXTERNAL DATA STRUCTURES
       
    34 //extern  ?external_data;
       
    35 
       
    36 // EXTERNAL FUNCTION PROTOTYPES  
       
    37 //extern ?external_function( ?arg_type,?arg_type );
       
    38 
       
    39 // CONSTANTS
       
    40 //const ?type ?constant_var = ?constant;
       
    41 
       
    42 // MACROS
       
    43 //#define ?macro ?macro_def
       
    44 
       
    45 // LOCAL CONSTANTS AND MACROS
       
    46 //const ?type ?constant_var = ?constant;
       
    47 //#define ?macro_name ?macro_def
       
    48 
       
    49 // MODULE DATA STRUCTURES
       
    50 //enum ?declaration
       
    51 //typedef ?declaration
       
    52 
       
    53 // LOCAL FUNCTION PROTOTYPES
       
    54 //?type ?function_name( ?arg_type, ?arg_type );
       
    55 
       
    56 // FORWARD DECLARATIONS
       
    57 //class ?FORWARD_CLASSNAME;
       
    58 
       
    59 // ============================= LOCAL FUNCTIONS ===============================
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // ?function_name ?description.
       
    63 // ?description
       
    64 // Returns: ?value_1: ?description
       
    65 //          ?value_n: ?description_line1
       
    66 //                    ?description_line2
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 /*
       
    70 ?type ?function_name(
       
    71     ?arg_type arg,  // ?description
       
    72     ?arg_type arg)  // ?description
       
    73     {
       
    74 
       
    75     ?code  // ?comment
       
    76 
       
    77     // ?comment
       
    78     ?code
       
    79     }
       
    80 */
       
    81 
       
    82 // ============================ MEMBER FUNCTIONS ===============================
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // Cimconnectionprovider_test::Delete
       
    86 // Delete here all resources allocated and opened from test methods. 
       
    87 // Called from destructor. 
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 void Cimconnectionprovider_test::Delete() 
       
    91     {
       
    92 
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // Cimconnectionprovider_test::RunMethodL
       
    97 // Run specified method. Contains also table of test mothods and their names.
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 TInt Cimconnectionprovider_test::RunMethodL( 
       
   101     CStifItemParser& aItem ) 
       
   102     {
       
   103 
       
   104     static TStifFunctionInfo const KFunctions[] =
       
   105         {  
       
   106         // Copy this line for every implemented function.
       
   107         // First string is the function name used in TestScripter script file.
       
   108         // Second is the actual implementation member function. 
       
   109         ENTRY( "T_EnableServiceL", 					Cimconnectionprovider_test::T_EnableServiceL ),
       
   110         ENTRY( "T_DisableServiceL", 				Cimconnectionprovider_test::T_DisableServiceL ),
       
   111         ENTRY( "T_SetIMDisabledL", 					Cimconnectionprovider_test::T_SetIMDisabledL),
       
   112         ENTRY( "T_FindRequestId",                   Cimconnectionprovider_test::T_FindRequestId),
       
   113         ENTRY( "T_RemoveRequestId", 				Cimconnectionprovider_test::T_RemoveRequestId),
       
   114 		ENTRY( "T_UnBindL", 						Cimconnectionprovider_test::T_UnBindL),
       
   115 		ENTRY( "T_BindL", 							Cimconnectionprovider_test::T_BindL),
       
   116 		ENTRY( "T_IsReserved", 						Cimconnectionprovider_test::T_IsReserved),
       
   117 		ENTRY( "T_SetConnectionParameter", 			Cimconnectionprovider_test::T_SetConnectionParameter),
       
   118 		ENTRY( "T_GetConnectionParameter", 		    Cimconnectionprovider_test::T_GetConnectionParameter),
       
   119 		ENTRY( "T_ValidateServiceL",               Cimconnectionprovider_test::T_ValidateServiceL),
       
   120 		ENTRY( "T_ValidateSubService",             Cimconnectionprovider_test::T_ValidateSubService),
       
   121 		ENTRY( "T_GetServiceNameL", Cimconnectionprovider_test::T_GetServiceNameL),
       
   122 		ENTRY( "T_ConvertXIMPErrToCChErr", Cimconnectionprovider_test::T_ConvertXIMPErrToCChErr),
       
   123 		ENTRY( "T_GetSPSettingsIntPropertyL", Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL),
       
   124 		ENTRY( "T_GetServiceNetworkInfo_passwordExistL", Cimconnectionprovider_test::T_GetServiceNetworkInfo_passwordExistL),
       
   125 		ENTRY( "T_GetServiceNetworkInfo_emptypasswordL", Cimconnectionprovider_test::T_GetServiceNetworkInfo_emptypasswordL),
       
   126         };
       
   127 
       
   128 
       
   129     const TInt count = sizeof( KFunctions ) / 
       
   130                         sizeof( TStifFunctionInfo );
       
   131 
       
   132     return RunInternalL( KFunctions, count, aItem );
       
   133 
       
   134     }
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // Cimconnectionprovider_test::NewL
       
   138 // Example test method function.
       
   139 // (other items were commented in a header).
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 CIcpServiceManager* Cimconnectionprovider_test::NewL( MCchServiceObserver* aServiceObserver )
       
   143 	{
       
   144 	//MCchServiceObserver& aServiceObserver = NULL;
       
   145     CIcpServiceManager* self = CIcpServiceManager::NewL( *this );
       
   146     return self;
       
   147 	}
       
   148 
       
   149 
       
   150 void Cimconnectionprovider_test::ServiceStateChanged(
       
   151                     const TServiceSelection aServiceSelection,
       
   152                     TCCHSubserviceState aState, 
       
   153                     TInt aError )
       
   154 {
       
   155 	
       
   156 }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // Cimconnectionprovider_test::T_EnableServiceL
       
   160 // Example test method function.
       
   161 // (other items were commented in a header).
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 TInt Cimconnectionprovider_test::T_EnableServiceL( CStifItemParser& aItem )
       
   165     {
       
   166     CIcpServiceManager *icpManager = NewL(NULL);
       
   167   	CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   168    	if(icpManager->iPresenceCtx)
       
   169 	   	{
       
   170 		delete icpManager->iPresenceCtx;
       
   171 	   	}
       
   172 	if(icpManager->iPresClient)
       
   173 		{
       
   174 		delete icpManager->iPresClient;
       
   175 		}
       
   176 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   177 	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   178 	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   179     icpManager->EnableServiceL(1,ECCHIMSub);
       
   180     delete icpManager;
       
   181     return KErrNone;
       
   182     
       
   183     }
       
   184 
       
   185 
       
   186 
       
   187 // -----------------------------------------------------------------------------
       
   188 // Cimconnectionprovider_test::T_DisableServiceL
       
   189 // T_DisableServiceL test method function.
       
   190 // (other items were commented in a header).
       
   191 // -----------------------------------------------------------------------------
       
   192 //
       
   193 TInt Cimconnectionprovider_test::T_DisableServiceL( CStifItemParser& aItem )
       
   194     {
       
   195     CIcpServiceManager *icpManager = NewL(NULL);
       
   196  //   TCCHSubserviceType type = TCCHSubserviceType::ECCHIMSub;
       
   197     icpManager->DisableServiceL(1,ECCHIMSub);
       
   198        	if(icpManager->iPresenceCtx)
       
   199 	   	{
       
   200 		delete icpManager->iPresenceCtx;
       
   201 	   	}
       
   202 	if(icpManager->iPresClient)
       
   203 		{
       
   204 		delete icpManager->iPresClient;
       
   205 		}
       
   206 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   207 	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   208 	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   209     delete icpManager;
       
   210     return KErrNone;
       
   211    
       
   212     }
       
   213 
       
   214 
       
   215 	
       
   216 
       
   217 	
       
   218 
       
   219 	
       
   220 // -----------------------------------------------------------------------------
       
   221 // Cimconnectionprovider_test::T_SetIMDisabledL
       
   222 // (other items were commented in a header).
       
   223 // -----------------------------------------------------------------------------
       
   224 TInt Cimconnectionprovider_test::T_SetIMDisabledL( CStifItemParser& aItem )
       
   225 	{
       
   226 	CIcpServiceManager *icpManager = NewL(NULL);
       
   227 	icpManager->SetIMDisabledL(0);
       
   228 	delete icpManager;
       
   229 	return KErrNone;
       
   230 	}
       
   231 
       
   232 
       
   233 
       
   234 	
       
   235 	
       
   236 // -----------------------------------------------------------------------------
       
   237 // Cimconnectionprovider_test::T_RemoveRequestId
       
   238 // (other items were commented in a header).
       
   239 // -----------------------------------------------------------------------------
       
   240 TInt Cimconnectionprovider_test::T_RemoveRequestId( CStifItemParser& aItem )
       
   241 	{
       
   242 	CIcpServiceManager *icpManager = NewL(NULL);
       
   243 	
       
   244 	if(icpManager->iPresClient)
       
   245 		{
       
   246 		delete icpManager->iPresClient;
       
   247 		}
       
   248 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   249 
       
   250 
       
   251    	if(icpManager->iPresenceCtx)
       
   252    	{
       
   253 	delete icpManager->iPresenceCtx;
       
   254    	}	
       
   255    	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   256    	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   257    
       
   258     TXIMPRequestId reqId ;
       
   259 	
       
   260 	
       
   261 	icpManager->RemoveRequestId(reqId);
       
   262 	
       
   263 	delete icpManager;
       
   264 	return KErrNone;
       
   265 	}
       
   266 
       
   267 // -----------------------------------------------------------------------------
       
   268 // Cimconnectionprovider_test::T_FindRequestId
       
   269 // (other items were commented in a header).
       
   270 // -----------------------------------------------------------------------------
       
   271 TInt Cimconnectionprovider_test::T_FindRequestId( CStifItemParser& aItem )
       
   272 	{
       
   273 	CIcpServiceManager *icpManager = NewL(NULL);
       
   274 	
       
   275 	if(icpManager->iPresClient)
       
   276 		{
       
   277 		delete icpManager->iPresClient;
       
   278 		}
       
   279 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   280 
       
   281 
       
   282    	if(icpManager->iPresenceCtx)
       
   283    	{
       
   284 	delete icpManager->iPresenceCtx;
       
   285    	}	
       
   286    	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   287    	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   288    	
       
   289 	
       
   290     TXIMPRequestId reqId; 
       
   291 	icpManager->FindRequestId(reqId);
       
   292 	
       
   293 	delete icpManager;
       
   294 	return KErrNone;
       
   295 	}
       
   296 	
       
   297 // -----------------------------------------------------------------------------
       
   298 // Cimconnectionprovider_test::T_UnBindL
       
   299 // (other items were commented in a header).
       
   300 // -----------------------------------------------------------------------------
       
   301 TInt Cimconnectionprovider_test::T_UnBindL( CStifItemParser& aItem )
       
   302 	{
       
   303 	CIcpServiceManager *icpManager = NewL(NULL);
       
   304 	
       
   305 	if(icpManager->iPresClient)
       
   306 		{
       
   307 		delete icpManager->iPresClient;
       
   308 		}
       
   309 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   310 
       
   311 
       
   312    	if(icpManager->iPresenceCtx)
       
   313    	{
       
   314 	delete icpManager->iPresenceCtx;
       
   315    	}	
       
   316    	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   317    	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   318    
       
   319    	
       
   320    	icpManager->UnBindL();
       
   321 	delete icpManager;
       
   322 	return KErrNone;
       
   323 	}
       
   324 	
       
   325 // -----------------------------------------------------------------------------
       
   326 // Cimconnectionprovider_test::T_BindL
       
   327 // (other items were commented in a header).
       
   328 // -----------------------------------------------------------------------------
       
   329 TInt Cimconnectionprovider_test::T_BindL( CStifItemParser& aItem )
       
   330 	{
       
   331 	CIcpServiceManager *icpManager = NewL(NULL);
       
   332 	
       
   333 	if(icpManager->iPresClient)
       
   334 		{
       
   335 		delete icpManager->iPresClient;
       
   336 		}
       
   337 	icpManager->iPresClient = MXIMPClientStub::NewClientL();
       
   338 
       
   339 
       
   340    	if(icpManager->iPresenceCtx)
       
   341    	{
       
   342 	delete icpManager->iPresenceCtx;
       
   343    	}	
       
   344    	icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC();
       
   345    	CleanupStack::Pop( icpManager->iPresenceCtx );
       
   346    	
       
   347 	
       
   348    	CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   349    	icpManager->BindL(1);
       
   350 	delete icpManager;
       
   351 	return KErrNone;	
       
   352 	}
       
   353 	
       
   354 // -----------------------------------------------------------------------------
       
   355 // Cimconnectionprovider_test::T_IsReserved
       
   356 // (other items were commented in a header).
       
   357 // -----------------------------------------------------------------------------
       
   358 TInt Cimconnectionprovider_test::T_IsReserved( CStifItemParser& aItem )
       
   359 	{
       
   360 	CIcpServiceManager *icpManager = NewL(NULL);
       
   361 	CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   362 	icpManager->IsReserved(1,ECCHIMSub);
       
   363 	delete icpManager;
       
   364 	return KErrNone;
       
   365 	}
       
   366 	
       
   367 // -----------------------------------------------------------------------------
       
   368 // Cimconnectionprovider_test::T_SetConnectionParameter
       
   369 // (other items were commented in a header).
       
   370 // -----------------------------------------------------------------------------
       
   371 TInt Cimconnectionprovider_test::T_SetConnectionParameter( CStifItemParser& aItem )
       
   372 	{
       
   373 	CIcpServiceManager *icpManager = NewL(NULL);
       
   374 	CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   375 	icpManager->SetConnectionParameter(1,ECCHIMSub,ECchUsername,1/*KServreName*/);
       
   376 	icpManager->SetConnectionParameter(1,ECCHIMSub,ECchPassword,1/*KServreName*/);
       
   377 	icpManager->SetConnectionParameter(1,ECCHIMSub,ECchIapId,0);
       
   378 	icpManager->SetConnectionParameter(1,ECCHIMSub,ECchSnapId,0);
       
   379 	delete icpManager;
       
   380 	return KErrNone;
       
   381 	}
       
   382 
       
   383 	
       
   384 
       
   385 // -----------------------------------------------------------------------------
       
   386 // Cimconnectionprovider_test::T_HandlePresenceNotificationL
       
   387 // (other items were commented in a header).
       
   388 // -----------------------------------------------------------------------------
       
   389 TInt Cimconnectionprovider_test::T_GetConnectionParameter( CStifItemParser& aItem )
       
   390 	{
       
   391 	TInt dunny;
       
   392 	CIcpServiceManager *icpManager = NewL(NULL);
       
   393 	CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   394 	icpManager->GetConnectionParameter(1,ECCHIMSub,ECchIapId,dunny);
       
   395 	icpManager->GetConnectionParameter(1,ECCHIMSub,ECchSnapId,dunny);
       
   396 	icpManager->GetConnectionParameter(1,ECCHIMSub,ECchSnapLocked,dunny);
       
   397 	icpManager->GetConnectionParameter(1,ECCHIMSub,ECchPasswordSet,dunny);
       
   398 	delete icpManager;
       
   399 	return KErrNone;
       
   400 	}
       
   401 // -----------------------------------------------------------------------------
       
   402 // Cimconnectionprovider_test::T_ValidateServiceL
       
   403 // (other items were commented in a header).
       
   404 // -----------------------------------------------------------------------------
       
   405 TInt Cimconnectionprovider_test::T_ValidateServiceL( CStifItemParser& aItem )
       
   406     {
       
   407     CIcpServiceManager *icpManager = NewL(NULL);
       
   408     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   409     icpManager->ValidateServiceL(1);
       
   410     return KErrNone;
       
   411     }
       
   412  
       
   413 // -----------------------------------------------------------------------------
       
   414 // Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL
       
   415 // (other items were commented in a header).
       
   416 // -----------------------------------------------------------------------------
       
   417 TInt Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL( CStifItemParser& aItem )
       
   418     {
       
   419     CIcpServiceManager *icpManager = NewL(NULL);
       
   420     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   421     icpManager->GetSPSettingsIntPropertyL(1,EServiceName);
       
   422     return KErrNone;
       
   423     }
       
   424 
       
   425 
       
   426 TInt Cimconnectionprovider_test::T_ValidateSubService( CStifItemParser& aItem )
       
   427     {
       
   428     CIcpServiceManager *icpManager = NewL(NULL);
       
   429     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   430     icpManager->ValidateSubService(ECCHUnknown);
       
   431     icpManager->ValidateSubService(ECCHPresenceSub);
       
   432     icpManager->ValidateSubService(ECCHIMSub);
       
   433     return KErrNone;
       
   434     }
       
   435 
       
   436 TInt Cimconnectionprovider_test::T_GetServiceNameL( CStifItemParser& aItem )
       
   437     {
       
   438     CIcpServiceManager *icpManager = NewL(NULL);
       
   439     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   440     HBufC* serviceName = HBufC::NewLC( 100 );
       
   441     TPtr serviceNamePtr( serviceName->Des() );
       
   442     icpManager->GetServiceNameL(1,serviceNamePtr );
       
   443     //icpManager->GetServiceNameL()
       
   444     TInt ret = KErrNotFound;
       
   445     if( serviceNamePtr.Length() )
       
   446         {
       
   447         ret = KErrNone;
       
   448         }
       
   449     CleanupStack::PopAndDestroy(); // serviceName
       
   450     return ret;
       
   451     }
       
   452 
       
   453 TInt Cimconnectionprovider_test::T_GetServiceNetworkInfo_passwordExistL( CStifItemParser& aItem )
       
   454     {
       
   455     CIcpServiceManager *icpManager = NewL(NULL);
       
   456     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   457     TCCHSubserviceType aSubServiceType;
       
   458     TUint32 aSnapId = 0; 
       
   459     TUint32 aIapId =0;
       
   460     TBool aSnapLocked = EFalse;
       
   461     TBool aPasswordSet; 
       
   462     setpassword = ETrue;   //password is set
       
   463     
       
   464     icpManager->GetServiceNetworkInfoL(1,ECCHUnknown,aSnapId,aIapId,aSnapLocked,aPasswordSet);
       
   465     if(aPasswordSet)
       
   466         {
       
   467         return KErrNone;
       
   468         }
       
   469     else
       
   470         {
       
   471         return KErrNotFound;
       
   472         }
       
   473     }
       
   474 
       
   475 TInt Cimconnectionprovider_test::T_GetServiceNetworkInfo_emptypasswordL( CStifItemParser& aItem )
       
   476     {
       
   477     CIcpServiceManager *icpManager = NewL(NULL);
       
   478     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   479     TCCHSubserviceType aSubServiceType;
       
   480     TUint32 aSnapId = 0; 
       
   481     TUint32 aIapId =0;
       
   482     TBool aSnapLocked = EFalse;
       
   483     TBool aPasswordSet; 
       
   484     setpassword = EFalse;   //password is empty
       
   485     
       
   486     icpManager->GetServiceNetworkInfoL(1,ECCHUnknown,aSnapId,aIapId,aSnapLocked,aPasswordSet);
       
   487     if(aPasswordSet)
       
   488         {
       
   489         return KErrNotFound; //test case failed
       
   490         }
       
   491     else
       
   492         {
       
   493         return KErrNone;   //test case passed
       
   494          
       
   495         }
       
   496     }
       
   497 TInt Cimconnectionprovider_test::T_ConvertXIMPErrToCChErr( CStifItemParser& aItem )
       
   498     {
       
   499     CIcpServiceManager *icpManager = NewL(NULL);
       
   500     CreateSpEntryL( 1, EPropertyPCSPluginId, 10 );
       
   501     icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceGeneralError);
       
   502     icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceShutdown);
       
   503     icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceRequestTypeNotSupported);
       
   504     icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceAuthenticationFailed);
       
   505     return KErrNone;
       
   506     }
       
   507 	
       
   508 	
       
   509 void Cimconnectionprovider_test::CreateSpEntryL( TInt aServiceId,
       
   510                                             TServicePropertyName aName,
       
   511                                             TInt aValue )
       
   512     {
       
   513     CSPSettings* settings = CSPSettings::NewL();
       
   514     
       
   515     CSPProperty* property = CSPProperty::NewL();
       
   516     CleanupStack::PushL( property );
       
   517     property->SetName( aName );
       
   518     property->SetValue( aValue );
       
   519 
       
   520     CSPEntry* entry = CSPEntry::NewL();
       
   521     CleanupStack::PushL( entry );
       
   522     entry->SetServiceId( aServiceId );
       
   523     entry->SetServiceName(KServiceName() );
       
   524 
       
   525     entry->AddPropertyL( *property );
       
   526 
       
   527     CSPEntry* testEntry = CSPEntry::NewLC();
       
   528     TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry );
       
   529     if( result == KErrNone )
       
   530         {
       
   531         settings->UpdateEntryL( *entry );
       
   532         }
       
   533     else
       
   534         {
       
   535         settings->AddEntryL( *entry );
       
   536         }
       
   537     CleanupStack::PopAndDestroy( 3 );
       
   538     }    
       
   539     
       
   540 // -----------------------------------------------------------------------------
       
   541 // Cimconnectionprovider_test::?member_function
       
   542 // ?implementation_description
       
   543 // (other items were commented in a header).
       
   544 // -----------------------------------------------------------------------------
       
   545 //
       
   546 /*
       
   547 TInt Cimconnectionprovider_test::?member_function(
       
   548    CItemParser& aItem )
       
   549    {
       
   550 
       
   551    ?code
       
   552 
       
   553    }
       
   554 */
       
   555 
       
   556 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   557 // None
       
   558 
       
   559 //  [End of File] - Do not remove