commsfwtools/preparedefaultcommsdatabase/te_commsdat/src/commsdatDatabaseOperationsTests.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     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 // CCommsdat40Step
       
    15 // CCommsdat41Step
       
    16 // CCommsdat42Step
       
    17 // CCommsdat43Step
       
    18 // CCommsdat44Step
       
    19 // CCommsdat45Step
       
    20 // CCommsdat46Step
       
    21 // CCommsdat47Step
       
    22 // CCommsdat48Step
       
    23 // CCommsdat49Step
       
    24 // CCommsdat50Step
       
    25 // CCommsdat51Step
       
    26 // CCommsdat52Step
       
    27 // CCommsdat53Step
       
    28 // CCommsdat54Step
       
    29 // CCommsdat55Step
       
    30 // CCommsdat56Step
       
    31 // CCommsdat57Step
       
    32 // CCommsdat58Step
       
    33 // CCommsdat59Step
       
    34 // CCommsdat60Step
       
    35 // CCommsdat61Step
       
    36 // CCommsdat62Step
       
    37 // CCommsdat63Step
       
    38 // CCommsdat64Step
       
    39 // CCommsdat65Step
       
    40 // CCommsdat66Step
       
    41 // CCommsdat67Step
       
    42 // CCommsdat68Step
       
    43 // CCommsdat70Step
       
    44 // CCommsdat71Step
       
    45 // CCommsdat72Step
       
    46 // CCommsdat73Step
       
    47 // 
       
    48 //
       
    49 
       
    50 /**
       
    51  @file commsdatDatabaseOperationsTests.cpp
       
    52 */
       
    53 
       
    54 #include "commsdatDatabaseOperationsTests.h"
       
    55 #include "Te_commsdatSuiteDefs.h"
       
    56 #include <e32test.h>
       
    57 #include <e32base.h>
       
    58 #include <d32comm.h>
       
    59 #include <commsdattypesv1_1_partner.h>
       
    60 #include <commsdattypeinfov1_1_internal.h>
       
    61 
       
    62 CCommsdat40Step::CCommsdat40Step()
       
    63 /**
       
    64  * Constructor
       
    65  */
       
    66 	{
       
    67 	SetTestStepName(KCommsdat40Step);
       
    68 	}
       
    69 
       
    70 TVerdict CCommsdat40Step::doTestStepL()
       
    71 /**
       
    72  * @return - TVerdict code
       
    73  * Setting field values and storing a new record
       
    74  */
       
    75 	{
       
    76     SetTestStepResult(EFail);	
       
    77 	INFO_PRINTF1(_L("Setting and getting field values - CCommsdat40Step::doTestStepL()"));
       
    78 	
       
    79 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    80  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
    81 #else
       
    82  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
    83 #endif
       
    84 	CleanupStack::PushL(cmdbSession);	 
       
    85 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
    86 	CleanupStack::PushL(iapRecord);
       
    87 
       
    88 	iapRecord->SetRecordId(KCDNewRecordRequest);
       
    89 	TPtrC aValue(_L("TestName"));
       
    90 
       
    91     iapRecord->iRecordName.SetMaxLengthL(aValue.Length());
       
    92     iapRecord->iRecordName = aValue;
       
    93 
       
    94     TPtrC bPtr(static_cast<const TDesC&>(iapRecord->iRecordName));
       
    95     INFO_PRINTF2(_L("Set iRecordName to %S"), &bPtr);
       
    96 
       
    97 	iapRecord->iNetworkWeighting = 10;
       
    98 
       
    99     TInt i = iapRecord->iNetworkWeighting;
       
   100 	INFO_PRINTF2(_L("Set iNetworkWeighting to %d"), i);
       
   101 	
       
   102 	cmdbSession->OpenTransactionL();
       
   103 	TRAPD(storeErr, iapRecord->StoreL(*cmdbSession));
       
   104 	cmdbSession->CommitTransactionL();
       
   105 	
       
   106 	if(storeErr == KErrNone)
       
   107 		{
       
   108 		SetTestStepResult(EPass);	
       
   109 		}
       
   110 	CleanupStack::PopAndDestroy(iapRecord);
       
   111     CleanupStack::PopAndDestroy(cmdbSession);
       
   112     
       
   113 	return TestStepResult();
       
   114 	}
       
   115 
       
   116 //----------------------------------------------------------------------------------------------------------------
       
   117 CCommsdat41Step::CCommsdat41Step()
       
   118 /**
       
   119  * Constructor
       
   120  */
       
   121 	{
       
   122 	SetTestStepName(KCommsdat41Step);
       
   123 	}
       
   124 
       
   125 TVerdict CCommsdat41Step::doTestStepL()
       
   126 /**
       
   127  * @return - TVerdict code
       
   128  * Finding a record; record should be inserted with CED te_commsdat_iap_table1
       
   129  */
       
   130 	{
       
   131     SetTestStepResult(EFail);	
       
   132 	INFO_PRINTF1(_L("CCommsdat41Step::doTestStepL() in the file commsdat41Step.cpp"));
       
   133 	
       
   134 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   135  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   136 #else
       
   137  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   138 #endif
       
   139 	CleanupStack::PushL(cmdbSession);
       
   140 	 
       
   141 	CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   142 	CleanupStack::PushL(iapRecord);
       
   143 
       
   144 	iapRecord->iNetworkWeighting = 10;
       
   145     TBool found(EFalse);
       
   146 	found = iapRecord->FindL(*cmdbSession);
       
   147     if (found)
       
   148     	{
       
   149         SetTestStepResult(EPass);	
       
   150     	}
       
   151 
       
   152     INFO_PRINTF2(_L("FindL returned %d, should be 1"), found);
       
   153     INFO_PRINTF2(_L("test result is %d"), TestStepResult());
       
   154     
       
   155     CleanupStack::PopAndDestroy(iapRecord);
       
   156     CleanupStack::PopAndDestroy(cmdbSession);
       
   157 	return TestStepResult();
       
   158 	}
       
   159 //----------------------------------------------------------------------------------------------------------------
       
   160 CCommsdat42Step::CCommsdat42Step()
       
   161 /**
       
   162  * Constructor
       
   163  */
       
   164 	{
       
   165 	SetTestStepName(KCommsdat42Step);
       
   166 	}
       
   167 
       
   168 
       
   169 TVerdict CCommsdat42Step::doTestStepL()
       
   170 /**
       
   171  * @return - TVerdict code
       
   172  * Storing and finding record
       
   173  */
       
   174 	{
       
   175     SetTestStepResult(EFail);	
       
   176 	INFO_PRINTF1(_L("Storing and finding a record - CCommsdat42Step::doTestStepL() in the file commsdat42Step.cpp"));
       
   177 	
       
   178 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   179  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   180 #else
       
   181  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   182 #endif
       
   183 	CleanupStack::PushL(cmdbSession);  
       
   184 
       
   185 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
   186 	CleanupStack::PushL(iapRecord);
       
   187 
       
   188 	iapRecord->SetRecordId(KCDNewRecordRequest);
       
   189     
       
   190     iapRecord->iRecordName.SetMaxLengthL(20);
       
   191     iapRecord->iRecordName = _L("TestNameTemplate");
       
   192 	iapRecord->iNetworkWeighting = 17;
       
   193     
       
   194 
       
   195 	iapRecord->StoreL(*cmdbSession);
       
   196     	
       
   197     iapRecord->iNetworkWeighting = 17;
       
   198 
       
   199     TBool found(EFalse);
       
   200     found = iapRecord->FindL(*cmdbSession); // this one should succeed
       
   201 
       
   202     INFO_PRINTF2(_L("Find returned %b, should be 1"), found);
       
   203 
       
   204 	iapRecord->iNetworkWeighting = 13;
       
   205 	
       
   206     found = iapRecord->FindL(*cmdbSession); // this one should fail
       
   207     INFO_PRINTF2(_L("Find returned %b, should be 0"), found);
       
   208 
       
   209     TRAPD(storeErr, iapRecord->StoreL(*cmdbSession));
       
   210     INFO_PRINTF2(_L("Store returned %d, should be -11"), storeErr); // this one should fail 
       
   211 
       
   212 
       
   213     CMDBRecordSet<CCDIAPRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDIAPRecord>(KCDTIdIAPRecord);
       
   214     iapRecord->iNetworkWeighting = 17;
       
   215 	CleanupStack::Pop(iapRecord);
       
   216    	recordSet->iRecords.Append(iapRecord);
       
   217 	found = recordSet->FindL(*cmdbSession);
       
   218     INFO_PRINTF2(_L("RecordSet FindL returned %b, should be 1"), found);
       
   219     
       
   220 	delete recordSet;
       
   221 	CleanupStack::PopAndDestroy(cmdbSession);
       
   222     if(found )
       
   223         {
       
   224         SetTestStepResult(EPass);	
       
   225 	    }
       
   226 
       
   227     return TestStepResult();
       
   228 	}
       
   229 
       
   230 
       
   231 //----------------------------------------------------------------------------------------------------------------
       
   232 
       
   233 CCommsdat43Step::CCommsdat43Step()
       
   234 /**
       
   235  * Constructor
       
   236  */
       
   237 	{
       
   238 	SetTestStepName(KCommsdat43Step);                                                                                           
       
   239 	}
       
   240 
       
   241 
       
   242 TVerdict CCommsdat43Step::doTestStepL()
       
   243 /**
       
   244  * @return - TVerdict code
       
   245  * Test FindL, StoreL, LoadL for records
       
   246  */
       
   247 	{
       
   248     SetTestStepResult(EFail);	
       
   249 	INFO_PRINTF1(_L("CCommsdat43Step::doTestStepL() in the file commsdat43Step.cpp"));
       
   250     
       
   251     
       
   252 	CMDBSession *cmdbSession = NULL;
       
   253 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   254  	cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   255 #else
       
   256  	cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   257 #endif
       
   258 	CleanupStack::PushL(cmdbSession);
       
   259 		
       
   260 	cmdbSession->OpenTransactionL();
       
   261 		
       
   262 	CCDIAPRecord *record = NULL;
       
   263 	record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   264 	CleanupStack::PushL(record);
       
   265 		
       
   266     record->SetRecordId(1);		
       
   267 	record->iRecordTag = 13;
       
   268 	
       
   269 	TBool found(0);
       
   270 	found = record->FindL(*cmdbSession);
       
   271 	
       
   272 	if(!found)
       
   273 		{
       
   274 		INFO_PRINTF2(_L("FindL found no record at id %08x"), record->ElementId());
       
   275 		record->StoreL(*cmdbSession);
       
   276 		
       
   277 		cmdbSession->CommitTransactionL();
       
   278 		}
       
   279 			
       
   280 	cmdbSession->Close();
       
   281 	CleanupStack::PopAndDestroy(record);
       
   282 	CleanupStack::PopAndDestroy(cmdbSession);
       
   283 	
       
   284 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   285  	cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   286 #else
       
   287  	cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   288 #endif
       
   289 	CleanupStack::PushL(cmdbSession);
       
   290 			
       
   291 	cmdbSession->OpenTransactionL();
       
   292 	
       
   293 	record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   294 	CleanupStack::PushL(record);
       
   295 	record->iRecordTag = 13;
       
   296 	found = record->FindL(*cmdbSession);
       
   297 	if(found)
       
   298 		{
       
   299 		SetTestStepResult(EPass);
       
   300 		}
       
   301 		
       
   302 	CleanupStack::PopAndDestroy(record);
       
   303 	cmdbSession->Close();
       
   304 	CleanupStack::PopAndDestroy(cmdbSession);
       
   305 	
       
   306 	return TestStepResult();
       
   307 	}
       
   308 //----------------------------------------------------------------------------------------------------------------
       
   309 CCommsdat44Step::CCommsdat44Step()
       
   310 /**
       
   311  * Constructor
       
   312  */
       
   313 	{
       
   314 	SetTestStepName(KCommsdat44Step);                                                                                           
       
   315 	}
       
   316 
       
   317 TVerdict CCommsdat44Step::doTestStepL()
       
   318 /**
       
   319  * @return - TVerdict code
       
   320  * Test find, load, modify and store on individual fields of a record; record should be inserted with CED te_commsdat_iap_table1
       
   321  */
       
   322 	{
       
   323     SetTestStepResult(EFail);	
       
   324 	INFO_PRINTF1(_L("I am in CCommsdat44Step::doTestStepL() and trying to test load, find, store, and modify"));
       
   325 	
       
   326 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   327  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   328 #else
       
   329  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   330 #endif
       
   331 	CleanupStack::PushL(cmdbSession);
       
   332 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
   333 	CleanupStack::PushL(iapRecord);
       
   334 	
       
   335 	TPtrC recordName(_L("TestName"));
       
   336 	iapRecord->iRecordName.SetMaxLengthL(recordName.Length());
       
   337 	iapRecord->iRecordName = recordName; 
       
   338 	TBool found(EFalse);
       
   339 	found = iapRecord->iRecordName.FindL(*cmdbSession);
       
   340 	INFO_PRINTF2(_L("FindL for iap record name field returns %d - should be 1"), found);
       
   341     if(found)
       
   342 		{
       
   343 		// Now a test for loading a field that is not part of a record
       
   344         CMDBField<TDesC>* aField = new(ELeave) CMDBField<TDesC>(iapRecord->iRecordName.ElementId());
       
   345         CleanupStack::PushL(aField);
       
   346 
       
   347         TRAPD(loadErr, aField->LoadL(*cmdbSession));
       
   348 		INFO_PRINTF2(_L("LoadL for descriptor field returns %d - should be 0"), loadErr);
       
   349         
       
   350         if(loadErr == KErrNone)
       
   351 			{
       
   352             // Now test for modifying a field
       
   353        		TPtrC recordName2(_L("TestName2"));
       
   354 			iapRecord->iRecordName.SetMaxLengthL(recordName2.Length());
       
   355 			iapRecord->iRecordName = recordName2;
       
   356 			TRAPD(modifyErr, iapRecord->iRecordName.ModifyL(*cmdbSession));
       
   357 		    INFO_PRINTF2(_L("ModifyL for iap record returns %d - should be 0"), modifyErr);
       
   358         	if(modifyErr == KErrNone)
       
   359 				{
       
   360 				CCDIAPRecord *newIapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
   361 				CleanupStack::PushL(newIapRecord);
       
   362 				
       
   363 				newIapRecord->SetRecordId(KCDNewRecordRequest);
       
   364                 TRAPD(storeErr, newIapRecord->StoreL(*cmdbSession));
       
   365                 INFO_PRINTF3(_L("StoreL for newIapRecord returns %d - should be 0.  Record id is %08x"), storeErr, newIapRecord->ElementId());
       
   366 				
       
   367 				TPtrC recordNameNew(_L("TestNameNew"));
       
   368 				newIapRecord->iRecordName.SetMaxLengthL(recordNameNew.Length());
       
   369 				newIapRecord->iRecordName = recordNameNew;
       
   370 				TRAP(storeErr, newIapRecord->iRecordName.StoreL(*cmdbSession));
       
   371                 INFO_PRINTF3(_L("StoreL for field in new IAP record returns %d - should be 0.  Record id is %08x"), storeErr, newIapRecord->ElementId());
       
   372 				if(storeErr == KErrNone)
       
   373 					{
       
   374 					SetTestStepResult(EPass);
       
   375 					}
       
   376 				
       
   377 				CleanupStack::PopAndDestroy(newIapRecord);
       
   378 				}
       
   379 			}
       
   380         CleanupStack::PopAndDestroy(aField);
       
   381 		}
       
   382 
       
   383 	CleanupStack::PopAndDestroy(iapRecord);
       
   384 	CleanupStack::PopAndDestroy(cmdbSession);
       
   385 	return TestStepResult(); 
       
   386 	}
       
   387 //----------------------------------------------------------------------------------------------------------------
       
   388 CCommsdat45Step::CCommsdat45Step()
       
   389 /**
       
   390  * Constructor
       
   391  */
       
   392 	{
       
   393 	SetTestStepName(KCommsdat45Step);
       
   394 	}
       
   395 
       
   396 TVerdict CCommsdat45Step::doTestStepL()
       
   397 /**
       
   398  * @return - TVerdict code
       
   399  * Test find with more than one initialized fields 
       
   400  */
       
   401 	{
       
   402     SetTestStepResult(EFail);	
       
   403 	INFO_PRINTF1(_L("Testing find with multiple fields - CCommsdat45Step::doTestStepL()"));
       
   404 	
       
   405 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   406  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   407 #else
       
   408  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   409 #endif
       
   410 	CleanupStack::PushL(cmdbSession);
       
   411 	
       
   412 	CCDDefaultWCDMARecord *defaultWCDMARecord1 = (CCDDefaultWCDMARecord*)CCDRecordBase::RecordFactoryL(KCDTIdDefaultWCDMARecord); 
       
   413 	CleanupStack::PushL(defaultWCDMARecord1);
       
   414 	
       
   415 	defaultWCDMARecord1->iUsage = 35;
       
   416 	TPtrC apn3(_L("APN3"));
       
   417 	defaultWCDMARecord1->iAPN.SetMaxLengthL(apn3.Length());
       
   418 	defaultWCDMARecord1->iAPN = apn3;
       
   419 	defaultWCDMARecord1->iPdpType = 252;
       
   420 	
       
   421 	CMDBRecordSet<CCDDefaultWCDMARecord>* recordSet1 = new(ELeave) CMDBRecordSet<CCDDefaultWCDMARecord>(KCDTIdDefaultWCDMARecord);
       
   422 	CleanupStack::PushL(recordSet1);	
       
   423 	recordSet1->iRecords.Append(defaultWCDMARecord1);
       
   424 	TBool res(0);
       
   425 	TRAPD(findErr1, res = recordSet1->FindL(*cmdbSession));
       
   426 	INFO_PRINTF2(_L("FindL for record set returns %b"), res);
       
   427 
       
   428 	CCDDefaultWCDMARecord *defaultWCDMARecord2 = (CCDDefaultWCDMARecord*)CCDRecordBase::RecordFactoryL(KCDTIdDefaultWCDMARecord); 
       
   429 	CleanupStack::PushL(defaultWCDMARecord2);
       
   430 	
       
   431 	defaultWCDMARecord2->iUsage = 35;
       
   432 	TPtrC apn(_L("APN"));
       
   433 	defaultWCDMARecord2->iAPN.SetMaxLengthL(apn.Length());
       
   434 	defaultWCDMARecord2->iAPN = apn;
       
   435 		
       
   436 	CMDBRecordSet<CCDDefaultWCDMARecord>* recordSet2 = new(ELeave) CMDBRecordSet<CCDDefaultWCDMARecord>(KCDTIdDefaultWCDMARecord);
       
   437 	CleanupStack::PushL(recordSet2);	
       
   438 	recordSet2->iRecords.Append(defaultWCDMARecord2);
       
   439 	TRAPD(findErr2, res = recordSet2->FindL(*cmdbSession));
       
   440 	
       
   441 	CCDDefaultWCDMARecord *defaultWCDMARecord3 = (CCDDefaultWCDMARecord*)CCDRecordBase::RecordFactoryL(KCDTIdDefaultWCDMARecord); 
       
   442 	CleanupStack::PushL(defaultWCDMARecord3);
       
   443 	
       
   444 	defaultWCDMARecord3->iUsage = 35;
       
   445 			
       
   446 	CMDBRecordSet<CCDDefaultWCDMARecord>* recordSet3 = new(ELeave) CMDBRecordSet<CCDDefaultWCDMARecord>(KCDTIdDefaultWCDMARecord);
       
   447 	CleanupStack::PushL(recordSet3);	
       
   448 	recordSet3->iRecords.Append(defaultWCDMARecord3);
       
   449 	res = recordSet3->FindL(*cmdbSession);
       
   450 	
       
   451 	if(findErr1 == KErrNone && findErr2 == KErrNone && findErr2 == KErrNone)
       
   452 		{
       
   453 		if(recordSet1->iRecords.Count() == 1 && recordSet2->iRecords.Count() == 2 && recordSet3->iRecords.Count() == 3)
       
   454 			{
       
   455 			SetTestStepResult(EPass);
       
   456 			}
       
   457 		}
       
   458 	
       
   459 	CleanupStack::PopAndDestroy(recordSet3);	
       
   460 	CleanupStack::Pop(defaultWCDMARecord3);	
       
   461 	CleanupStack::PopAndDestroy(recordSet2);	
       
   462 	CleanupStack::Pop(defaultWCDMARecord2);	
       
   463 	CleanupStack::PopAndDestroy(recordSet1);	
       
   464 	CleanupStack::Pop(defaultWCDMARecord1);	
       
   465 	CleanupStack::PopAndDestroy(cmdbSession);
       
   466     return TestStepResult();
       
   467 	}
       
   468 //----------------------------------------------------------------------------------------------------------------
       
   469 CCommsdat46Step::CCommsdat46Step()
       
   470 /**
       
   471  * Constructor
       
   472  */
       
   473 	{
       
   474 	SetTestStepName(KCommsdat46Step);                                                                                           
       
   475 	}
       
   476 
       
   477 
       
   478 TVerdict CCommsdat46Step::doTestStepL()
       
   479 /**
       
   480  * @return - TVerdict code
       
   481  * Test Load on record set; should return KErrNotFound
       
   482  */
       
   483 	{
       
   484     SetTestStepResult(EFail);	
       
   485 	INFO_PRINTF1(_L("Load within transaction - CCommsdat46Step::doTestStepL() in the file commsdat46Step.cpp"));
       
   486 
       
   487 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   488  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   489 #else
       
   490  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   491 #endif
       
   492 	CleanupStack::PushL(cmdbSession); 
       
   493 
       
   494 	cmdbSession->OpenTransactionL();
       
   495 		
       
   496 	CMDBRecordSet<CCDDialOutISPRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDDialOutISPRecord>(KCDTIdDialOutISPRecord);
       
   497 	
       
   498 	TRAPD(loadErr, recordSet->LoadL(*cmdbSession));
       
   499 		
       
   500 	if ( loadErr == KErrNotFound )
       
   501        	{
       
   502         SetTestStepResult(EPass);	
       
   503         }
       
   504 
       
   505 	delete recordSet;
       
   506 	cmdbSession->Close();
       
   507 		
       
   508 	CleanupStack::PopAndDestroy(cmdbSession);
       
   509 		
       
   510 	return TestStepResult();
       
   511 	}
       
   512 //----------------------------------------------------------------------------------------------------------------
       
   513 CCommsdat47Step::CCommsdat47Step()
       
   514 /**
       
   515  * Constructor
       
   516  */
       
   517 	{
       
   518 	SetTestStepName(KCommsdat47Step);                                                                                           
       
   519 	}
       
   520 
       
   521 
       
   522 TVerdict CCommsdat47Step::doTestStepL()
       
   523 /**
       
   524  * @return - TVerdict code
       
   525  * Store a RecordSet within a transaction
       
   526  */
       
   527 	{
       
   528     SetTestStepResult(EFail);	
       
   529 	INFO_PRINTF1(_L("Store RecordSet within transaction - CCommsdat47Step::doTestStepL() in the file commsdat47Step.cpp"));
       
   530 
       
   531 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   532  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   533 #else
       
   534  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   535 #endif
       
   536 	CleanupStack::PushL(cmdbSession);  
       
   537 
       
   538 	cmdbSession->OpenTransactionL();
       
   539 	
       
   540  	CMDBRecordSet<CCDDialOutISPRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDDialOutISPRecord>(KCDTIdDialOutISPRecord);
       
   541 	CCDDialOutISPRecord *record1 = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord );
       
   542 	CCDDialOutISPRecord *record2 = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord );
       
   543 	CCDDialOutISPRecord *record3 = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord );
       
   544 	
       
   545 	record1->SetRecordId(KCDNewRecordRequest);
       
   546 	record1->iV42MaxLength = 101; //an arbitrary value
       
   547 	record2->SetRecordId(KCDNewRecordRequest);
       
   548 	record2->iV42MaxLength = 102; //an arbitrary value
       
   549 	record3->SetRecordId(KCDNewRecordRequest);
       
   550 	record3->iV42MaxLength = 103; //an arbitrary value
       
   551 	
       
   552 	recordSet->iRecords.Append(record1);
       
   553 	recordSet->iRecords.Append(record2);
       
   554 	recordSet->iRecords.Append(record3);
       
   555 
       
   556     TRAPD(storeErr, recordSet->StoreL(*cmdbSession));
       
   557     INFO_PRINTF2(_L("Store 3 DialOutISP records in a set returned %d.  Should be 0"), storeErr);
       
   558 
       
   559 	TRAPD(commitErr, cmdbSession->CommitTransactionL());		
       
   560     INFO_PRINTF2(_L("CommitTransactionL (storing DialOutISP) returned %d.  Should be 0"), commitErr);
       
   561 
       
   562 	delete recordSet;
       
   563 	cmdbSession->Close();
       
   564 	CleanupStack::PopAndDestroy(cmdbSession);
       
   565 	
       
   566 	if(storeErr == KErrNone  &&  commitErr == KErrNone)
       
   567 		{
       
   568     	SetTestStepResult(EPass);	
       
   569 		}
       
   570 	return TestStepResult();
       
   571 	}
       
   572 //----------------------------------------------------------------------------------------------------------------
       
   573 CCommsdat48Step::CCommsdat48Step()
       
   574 /**
       
   575  * Constructor
       
   576  */
       
   577 	{
       
   578 	SetTestStepName(KCommsdat48Step);                                                                                           
       
   579 	}
       
   580 
       
   581 TVerdict CCommsdat48Step::doTestStepL()
       
   582 /**
       
   583  * @return - TVerdict code
       
   584  * Load and Modify in transaction on a recordset;records should be inserted with CED te_commsdat_dialoutisp_table1
       
   585  */
       
   586 	{
       
   587     SetTestStepResult(EFail);	
       
   588 	INFO_PRINTF1(_L("Load and Modify in transaction - CCommsdat48Step::doTestStepL() in the file commsdat48Step.cpp"));
       
   589 
       
   590 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   591  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   592 #else
       
   593  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   594 #endif
       
   595 	CleanupStack::PushL(cmdbSession); 
       
   596 
       
   597 	TRAPD(openErr, cmdbSession->OpenTransactionL());
       
   598 	if(openErr == KErrNone)
       
   599 		{
       
   600 		
       
   601 		CMDBRecordSet<CCDDialOutISPRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDDialOutISPRecord>(KCDTIdDialOutISPRecord);
       
   602 		TRAPD(err,recordSet->LoadL(*cmdbSession));
       
   603 	
       
   604     	INFO_PRINTF2(_L("Load DialOutISP returned %d.  Should be 0"), err);
       
   605 
       
   606     	INFO_PRINTF2(_L("Load DialOutISP returned %d records.  should be 3"), recordSet->iRecords.Count());
       
   607 
       
   608     	if (err == KErrNone && recordSet->iRecords.Count() == 3)
       
   609         	{
       
   610         	CCDDialOutISPRecord* dialoutptr = static_cast<CCDDialOutISPRecord *>(recordSet->iRecords[0]);
       
   611         	dialoutptr->iV42MaxLength = 201;
       
   612 
       
   613         	dialoutptr = static_cast<CCDDialOutISPRecord *>(recordSet->iRecords[1]);
       
   614         	dialoutptr->iV42MaxLength = 202;
       
   615 
       
   616         	dialoutptr = static_cast<CCDDialOutISPRecord *>(recordSet->iRecords[2]);
       
   617         	dialoutptr->iV42MaxLength = 203;
       
   618 	    
       
   619         	INFO_PRINTF1(_L("Modifying record"));
       
   620 
       
   621 	    	TRAPD(modifyErr, recordSet->ModifyL(*cmdbSession));
       
   622 		    
       
   623 		    if(modifyErr == KErrNone)
       
   624 		    	{
       
   625         		INFO_PRINTF1(_L("Committing Transaction..."));
       
   626 				TRAPD(commitErr, cmdbSession->CommitTransactionL());		
       
   627 	    		if(commitErr == KErrNone)
       
   628 	    			{
       
   629 	    			SetTestStepResult(EPass);	
       
   630 	    			}
       
   631 		    	}
       
   632 		    else
       
   633 		    	{
       
   634 		    	INFO_PRINTF1(_L("Rolling transaction back"));
       
   635 				cmdbSession->RollbackTransactionL();	
       
   636 		    	}
       
   637         	}
       
   638 		delete recordSet;
       
   639 		}
       
   640 	
       
   641 	cmdbSession->Close();
       
   642 	CleanupStack::PopAndDestroy(cmdbSession);
       
   643 	return TestStepResult();
       
   644 	}
       
   645 //----------------------------------------------------------------------------------------------------------------
       
   646 CCommsdat49Step::CCommsdat49Step()
       
   647 /**
       
   648  * Constructor
       
   649  */
       
   650 	{
       
   651 	SetTestStepName(KCommsdat49Step);                                                                                           
       
   652 	}
       
   653 
       
   654 
       
   655 TVerdict CCommsdat49Step::doTestStepL()
       
   656 /**
       
   657  * @return - TVerdict code
       
   658  * ModifyL on record set;records should be inserted with CED te_commsdat_dialoutisp_table1
       
   659  */
       
   660 	{
       
   661     SetTestStepResult(EFail);	
       
   662 	INFO_PRINTF1(_L("CCommsdat49Step::doTestStepL() in the file commsdat49Step.cpp"));
       
   663 
       
   664 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   665  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   666 #else
       
   667  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   668 #endif
       
   669     CleanupStack::PushL(cmdbSession); 
       
   670 
       
   671 	cmdbSession->OpenTransactionL();
       
   672 	
       
   673 	CMDBRecordSet<CCDDialOutISPRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDDialOutISPRecord>(KCDTIdDialOutISPRecord);
       
   674 	recordSet->LoadL(*cmdbSession);
       
   675     
       
   676 	recordSet->SetMaxLengthL(KCDMaxFieldNameLength);
       
   677 	*recordSet = _S("DummyTableType");
       
   678 	
       
   679 	TRAPD(modifyErr, recordSet->ModifyL(*cmdbSession));
       
   680     INFO_PRINTF2(_L("ModifyL recordSet result = %d.  Should be 0."), modifyErr);
       
   681 		
       
   682 	cmdbSession->CommitTransactionL();		
       
   683 	
       
   684 	delete recordSet;
       
   685 	CleanupStack::PopAndDestroy(cmdbSession);
       
   686 	
       
   687 	if(modifyErr == KErrNone)
       
   688 		{
       
   689 		SetTestStepResult(EPass);		
       
   690 		}
       
   691     
       
   692 	return TestStepResult(); 
       
   693 	}
       
   694 
       
   695 //----------------------------------------------------------------------------------------------------------------
       
   696 CCommsdat50Step::CCommsdat50Step()
       
   697 /**
       
   698  * Constructor
       
   699  */
       
   700 	{
       
   701 	SetTestStepName(KCommsdat50Step);                                                                                           
       
   702 	}
       
   703 
       
   704 TVerdict CCommsdat50Step::doTestStepL()
       
   705 /**
       
   706  * @return - TVerdict code
       
   707  * Set attributes and store them
       
   708  */
       
   709 	{
       
   710     SetTestStepResult(EFail);	
       
   711 	INFO_PRINTF1(_L("I am in CCommsdat50Step::doTestStepL() and trying to set attributes and store them"));
       
   712 
       
   713 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   714  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   715 #else
       
   716  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   717 #endif
       
   718 	CleanupStack::PushL(cmdbSession);  
       
   719 		
       
   720 	CCDVirtualBearerRecord *vbRecord = (CCDVirtualBearerRecord*)CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord);
       
   721 
       
   722 	CleanupStack::PushL(vbRecord);
       
   723 	
       
   724     vbRecord->SetRecordId(KCDNewRecordRequest);
       
   725 
       
   726     TPtrC fileName(_L("TempFile"));
       
   727     vbRecord->iVirtualBearerNifName.SetMaxLengthL(fileName.Length());
       
   728     vbRecord->iVirtualBearerNifName = fileName;
       
   729 	vbRecord->SetAttributes(ECDPrivate);
       
   730 	if(vbRecord->IsSetAttribute(ECDPrivate))
       
   731         {
       
   732         INFO_PRINTF1(_L("Attributes are set properly"));
       
   733 
       
   734         cmdbSession->SetAttributeMask(ECDPrivate);
       
   735 
       
   736 	    TRAPD(storeErr, vbRecord->StoreL(*cmdbSession));
       
   737         INFO_PRINTF2(_L("vbRecord StoreL result was %d.  Should be 0"), storeErr);
       
   738         
       
   739 	    TUint32 id = vbRecord->iVirtualBearerNifName.ElementId();
       
   740 	    
       
   741         INFO_PRINTF3(_L("Element id of iAgentFileName is %08x, should be %08x"), id & KCDMaskHideRes, KCDTIdAgentFileName | ECDPrivate | (id & KCDMaskShowRecordId));
       
   742 
       
   743         if (storeErr == KErrNone  &&  
       
   744             (id & KCDMaskShowAttributes) == (ECDPrivate) )
       
   745             SetTestStepResult(EPass);
       
   746 	    }
       
   747     else
       
   748 		INFO_PRINTF1(_L("Attributes set wrongly"));
       
   749 	
       
   750 	CleanupStack::PopAndDestroy(vbRecord);
       
   751 	CleanupStack::PopAndDestroy(cmdbSession);
       
   752 		
       
   753     return TestStepResult(); 
       
   754 	}
       
   755 //----------------------------------------------------------------------------------------------------------------
       
   756 CCommsdat51Step::CCommsdat51Step()
       
   757 /**
       
   758  * Constructor
       
   759  */
       
   760 	{
       
   761 	SetTestStepName(KCommsdat51Step);                                                                                           
       
   762 	}
       
   763 
       
   764 TVerdict CCommsdat51Step::doTestStepPreambleL()
       
   765 	{
       
   766     SetTestStepResult(EFail);	
       
   767 
       
   768 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   769  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   770 #else
       
   771  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   772 #endif
       
   773 	CleanupStack::PushL(cmdbSession);  
       
   774 		
       
   775 	CCDVirtualBearerRecord *vbRecord = (CCDVirtualBearerRecord*)CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord);
       
   776 
       
   777 	CleanupStack::PushL(vbRecord);
       
   778 	
       
   779     vbRecord->SetRecordId(KCDNewRecordRequest);
       
   780 
       
   781     TPtrC fileName(_L("TempFile"));
       
   782     vbRecord->iVirtualBearerNifName.SetMaxLengthL(fileName.Length());
       
   783     vbRecord->iVirtualBearerNifName = fileName;
       
   784 	vbRecord->SetAttributes(ECDPrivate);
       
   785 
       
   786     cmdbSession->SetAttributeMask(ECDPrivate);
       
   787 
       
   788 	TRAPD(storeErr, vbRecord->StoreL(*cmdbSession));
       
   789     
       
   790     if (storeErr == KErrNone)
       
   791     	{
       
   792     	SetTestStepResult(EPass);
       
   793 	    }
       
   794     
       
   795 	CleanupStack::PopAndDestroy(vbRecord);
       
   796 	CleanupStack::PopAndDestroy(cmdbSession);
       
   797 		
       
   798     return TestStepResult(); 
       
   799 	}
       
   800 
       
   801 
       
   802 TVerdict CCommsdat51Step::doTestStepL()
       
   803 /**
       
   804  * @return - TVerdict code
       
   805  * Modify attributes of a record
       
   806  */
       
   807 	{
       
   808     SetTestStepResult(EFail);	
       
   809 	INFO_PRINTF1(_L("I am in CCommsdat51Step::doTestStepL() and trying to modify attributes"));
       
   810 
       
   811 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   812  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   813 #else
       
   814  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   815 #endif
       
   816 	CleanupStack::PushL(cmdbSession); 
       
   817 	
       
   818 	CCDVirtualBearerRecord *vbRecord = (CCDVirtualBearerRecord*)CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord);
       
   819 	CleanupStack::PushL(vbRecord); 
       
   820 
       
   821     vbRecord->SetRecordId(1);
       
   822 
       
   823     cmdbSession->SetAttributeMask(ECDPrivate);
       
   824 
       
   825 	TRAPD(loadErr, vbRecord->LoadL(*cmdbSession));
       
   826     INFO_PRINTF2(_L("LoadL vbRecord result was %d.  Should be 0."), loadErr);
       
   827     
       
   828     if (loadErr == KErrNone)
       
   829         {
       
   830 	    TUint32 id = vbRecord->iVirtualBearerNifName.ElementId();
       
   831 	    INFO_PRINTF2(_L("Element id of iAgentFileName is %08x"), id);
       
   832 
       
   833 	    vbRecord->SetAttributes(ECDHidden);
       
   834         cmdbSession->SetAttributeMask(ECDHidden);
       
   835 
       
   836         TMDBElementId testId = vbRecord->iVirtualBearerNifName.ElementId();
       
   837 
       
   838         TRAPD(modifyErr, vbRecord->ModifyL(*cmdbSession));
       
   839         INFO_PRINTF2(_L("ModifyL vbRecord result was %d.  Should be 0."), modifyErr);
       
   840  
       
   841         if( modifyErr == KErrNone)
       
   842             {
       
   843 	        id = vbRecord->iVirtualBearerNifName.ElementId();
       
   844             INFO_PRINTF3(_L("Element id of iAgentFileName is %08x.  Should be %08x"), id, testId | ECDHidden);
       
   845         
       
   846             if (((testId | ECDHidden) & KCDMaskHideRes) == (id & KCDMaskHideRes) )
       
   847 	            SetTestStepResult(EPass);	
       
   848             }
       
   849         }
       
   850 	
       
   851 	CleanupStack::PopAndDestroy(vbRecord);
       
   852 	cmdbSession->Close();
       
   853 	CleanupStack::PopAndDestroy(cmdbSession);
       
   854     
       
   855 	return TestStepResult(); 
       
   856 	}
       
   857 
       
   858 //----------------------------------------------------------------------------------------------------------------
       
   859 CCommsdat52Step::CCommsdat52Step()
       
   860 /**
       
   861  * Constructor
       
   862  */
       
   863 	{
       
   864 	SetTestStepName(KCommsdat52Step);                                                                                           
       
   865 	}
       
   866 
       
   867 TVerdict CCommsdat52Step::doTestStepPreambleL()
       
   868 	{
       
   869     SetTestStepResult(EFail);	
       
   870 
       
   871 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   872  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   873 #else
       
   874  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   875 #endif
       
   876 	CleanupStack::PushL(cmdbSession);  
       
   877 		
       
   878 	CCDVirtualBearerRecord *vbRecord = (CCDVirtualBearerRecord*)CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord);
       
   879 
       
   880 	CleanupStack::PushL(vbRecord);
       
   881 	
       
   882     vbRecord->SetRecordId(KCDNewRecordRequest);
       
   883 
       
   884     TPtrC fileName(_L("TempFile"));
       
   885     vbRecord->iVirtualBearerNifName.SetMaxLengthL(fileName.Length());
       
   886     vbRecord->iVirtualBearerNifName = fileName;
       
   887 	vbRecord->SetAttributes(ECDPrivate | ECDHidden);
       
   888 
       
   889     cmdbSession->SetAttributeMask(ECDPrivate | ECDHidden);
       
   890 
       
   891 	TRAPD(storeErr, vbRecord->StoreL(*cmdbSession));
       
   892     
       
   893     if (storeErr == KErrNone)
       
   894     	{
       
   895     	SetTestStepResult(EPass);
       
   896 	    }
       
   897     
       
   898 	CleanupStack::PopAndDestroy(vbRecord);
       
   899 	CleanupStack::PopAndDestroy(cmdbSession);
       
   900 		
       
   901     return TestStepResult(); 
       
   902 	}
       
   903 
       
   904 
       
   905 TVerdict CCommsdat52Step::doTestStepL()
       
   906 /**
       
   907  * @return - TVerdict code
       
   908  * Reach a field by name and modify a descriptor value in db
       
   909  */
       
   910 	{
       
   911     SetTestStepResult(EFail);	
       
   912 	INFO_PRINTF1(_L("I am in CCommsdat52Step::doTestStepL() and trying to reach a field by name and modify value in db"));
       
   913 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   914  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   915 #else
       
   916  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   917 #endif
       
   918 	CleanupStack::PushL(cmdbSession); 
       
   919 
       
   920 	CCDVirtualBearerRecord *vbRecord = (CCDVirtualBearerRecord*)CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord);
       
   921 	CleanupStack::PushL(vbRecord);
       
   922     
       
   923     cmdbSession->SetAttributeMask(ECDHidden | ECDPrivate);
       
   924 
       
   925     vbRecord->SetRecordId(1);
       
   926   
       
   927     TRAPD(loadErr, vbRecord->LoadL(*cmdbSession));
       
   928 	
       
   929     INFO_PRINTF2(_L("vbRecord LoadL result was %d.  Should be 0"), loadErr);
       
   930   
       
   931     CMDBField<TDesC> *afn = NULL;
       
   932 	TInt temp(0);
       
   933 	TRAPD(getFieldErr, afn = static_cast<CMDBField<TDesC> *>(vbRecord->GetFieldByNameL(_L("IfName"), temp)));
       
   934     TPtrC tempPtr(*afn);
       
   935     INFO_PRINTF3(_L("vbRecord GetFieldByName result was %d.  Should be 0.  Value is %S"), getFieldErr, &tempPtr);
       
   936 
       
   937     if(getFieldErr == KErrNone)
       
   938 		{
       
   939 		TPtrC  agentFriendlyName(_L("temp friendly name"));
       
   940         afn->SetMaxLengthL(agentFriendlyName.Length());
       
   941 		*afn = agentFriendlyName;
       
   942 		TRAPD(modifyErr,vbRecord->ModifyL(*cmdbSession));
       
   943 	    INFO_PRINTF2(_L("vbRecord ModifyL result was %d.  Should be 0"), modifyErr);
       
   944 
       
   945         if(modifyErr == KErrNone)
       
   946 			{
       
   947 			SetTestStepResult(EPass);
       
   948 			}
       
   949 		}
       
   950 		
       
   951 	TPtrC displayName(vbRecord->iVirtualBearerNifName);
       
   952 	INFO_PRINTF2(_L("Agent name is %S"), &displayName);
       
   953 	
       
   954 	CleanupStack::PopAndDestroy(vbRecord);
       
   955 	CleanupStack::PopAndDestroy(cmdbSession);
       
   956 	return TestStepResult(); 	
       
   957 	}
       
   958 //----------------------------------------------------------------------------------------------------------------
       
   959 CCommsdat53Step::CCommsdat53Step()
       
   960 /**
       
   961  * Constructor
       
   962  */
       
   963 	{
       
   964 	SetTestStepName(KCommsdat53Step);                                                                                           
       
   965 	}
       
   966 
       
   967 TVerdict CCommsdat53Step::doTestStepL()
       
   968 /**
       
   969  * @return - TVerdict code
       
   970  * Check ModifyL with multiple changing fields; record should be inserted with CED te_commsdat_lanservice_table1
       
   971  */
       
   972 	{
       
   973     SetTestStepResult(EFail);	
       
   974 	INFO_PRINTF1(_L("I am in CCommsdat53Step::doTestStepL() and trying to insert a LAN Service Record."));
       
   975 
       
   976 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   977  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   978 #else
       
   979  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   980 #endif
       
   981 	CleanupStack::PushL(cmdbSession); 
       
   982 	
       
   983 	CCDLANServiceRecord *lanRecord = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
   984 	CleanupStack::PushL(lanRecord);
       
   985 
       
   986     lanRecord->SetRecordId(1);
       
   987 
       
   988 	lanRecord->LoadL(*cmdbSession);
       
   989       		
       
   990     TPtrC displayIpAddr(lanRecord->iIpAddr);
       
   991 	INFO_PRINTF2(_L("lanRecord ipAddr is %S"), &displayIpAddr);	
       
   992 	
       
   993     TPtrC ipGateway(_L("444.444.444.444"));
       
   994 	lanRecord->iIpGateway.SetMaxLengthL(ipGateway.Length());
       
   995 	lanRecord->iIpGateway = ipGateway;
       
   996 
       
   997     TPtrC ipAddr(_L("555.555.555.555"));
       
   998 	lanRecord->iIpAddr.SetMaxLengthL(ipAddr.Length());
       
   999 	lanRecord->iIpAddr = ipAddr;
       
  1000 	
       
  1001 	TRAPD(modifyErr, lanRecord->ModifyL(*cmdbSession));
       
  1002     INFO_PRINTF2(_L("lanRecord ModifyL result was %d.  Should be 0"), modifyErr);
       
  1003  	
       
  1004 	TPtrC displayIpAddr2(lanRecord->iIpAddr);
       
  1005 	INFO_PRINTF2(_L("lanRecord ipAddr is %S"), &displayIpAddr2);	
       
  1006 	
       
  1007 	CleanupStack::PopAndDestroy(lanRecord);
       
  1008 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1009 		
       
  1010 	if(modifyErr == KErrNone)
       
  1011 		{
       
  1012 		SetTestStepResult(EPass);	
       
  1013 		}
       
  1014     	
       
  1015 
       
  1016     return TestStepResult(); 
       
  1017 	}
       
  1018 //----------------------------------------------------------------------------------------------------------------
       
  1019 CCommsdat54Step::CCommsdat54Step()
       
  1020 /**
       
  1021  * Constructor
       
  1022  */
       
  1023 	{
       
  1024 	SetTestStepName(KCommsdat54Step);                                                                                           
       
  1025 	}
       
  1026 
       
  1027 TVerdict CCommsdat54Step::doTestStepL()
       
  1028 /**
       
  1029  * @return - TVerdict code
       
  1030  * Check RefreshL; record should be inserted with CED te_commsdat_lanservice_table2
       
  1031  */
       
  1032 	{
       
  1033     SetTestStepResult(EFail);	
       
  1034 	INFO_PRINTF1(_L("I am in CCommsdat54Step::doTestStepL() and trying to check ModifyL"));
       
  1035 	
       
  1036 	CCDLANServiceRecord *lanRecord1 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1037 	CleanupStack::PushL(lanRecord1);
       
  1038     lanRecord1->SetRecordId(1);
       
  1039 
       
  1040 	CCDLANServiceRecord *lanRecord2 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1041 	CleanupStack::PushL(lanRecord2);
       
  1042 	lanRecord2->SetRecordId(1); // same record id as lanRecord1
       
  1043 
       
  1044 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1045  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1046 #else
       
  1047  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1048 #endif
       
  1049 	CleanupStack::PushL(cmdbSession); 
       
  1050 	
       
  1051 	lanRecord1->LoadL(*cmdbSession);
       
  1052 	lanRecord2->LoadL(*cmdbSession);
       
  1053 	
       
  1054 	
       
  1055     TPtrC displayIpAddr(lanRecord2->iIpAddr);
       
  1056 	INFO_PRINTF2(_L("LANRecord2 has %S as ip addr"),&displayIpAddr);	
       
  1057 	
       
  1058 	TPtrC displayIpGateway(lanRecord2->iIpGateway);
       
  1059 	INFO_PRINTF2(_L("LANRecord2 has %S as ip gateway"),&displayIpGateway);	
       
  1060 	
       
  1061 	TPtrC newIpGateway(_L("888.888.888.888"));
       
  1062 	TPtrC newIpAddr(_L("999.999.999.999"));
       
  1063     	
       
  1064     lanRecord1->iIpGateway = newIpGateway;
       
  1065 	lanRecord2->iIpAddr = newIpAddr;
       
  1066 		
       
  1067     lanRecord1->ModifyL(*cmdbSession);
       
  1068 	lanRecord2->RefreshL(*cmdbSession);
       
  1069 		
       
  1070 	
       
  1071 	TPtrC newDisplayIpAddr(lanRecord2->iIpAddr);
       
  1072 	INFO_PRINTF3(_L("LANRecord2 now has %S as ip addr. Should be %S"),&newDisplayIpAddr, &newIpAddr);	
       
  1073 	
       
  1074 	TPtrC newDisplayIpGateway(lanRecord2->iIpGateway);
       
  1075 	INFO_PRINTF3(_L("LANRecord2 now has %S as ip gateway.  Should be %S"),&newDisplayIpGateway, &newIpGateway);
       
  1076 	
       
  1077 	TBool intermediateResult = (newDisplayIpAddr == newIpAddr &&  newDisplayIpGateway == newIpGateway);
       
  1078 	
       
  1079 	CleanupStack::PopAndDestroy(cmdbSession) ;
       
  1080 	
       
  1081 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1082  	cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1083 #else
       
  1084  	cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1085 #endif
       
  1086 	CleanupStack::PushL(cmdbSession); 
       
  1087 	
       
  1088     CCDLANServiceRecord *lanRecord3 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1089 	CleanupStack::PushL(lanRecord3);
       
  1090     lanRecord3->SetRecordId(1);
       
  1091 			
       
  1092     TRAPD(loadErr, lanRecord3->LoadL(*cmdbSession));	
       
  1093 			
       
  1094 	if(loadErr == KErrNone)
       
  1095 		{
       
  1096 		TPtrC newestDisplayIpAddr(lanRecord3->iIpAddr);
       
  1097 		INFO_PRINTF2(_L("Latest IpAddr is %S"), &newestDisplayIpAddr);	
       
  1098 	
       
  1099 		TPtrC oldIpAddr(_L("555.555.555.555"));
       
  1100 		INFO_PRINTF2(_L("Original IpAddr value was %S"), &oldIpAddr);
       
  1101 	
       
  1102         TPtrC newestDisplayIpGateway(lanRecord3->iIpGateway);
       
  1103 		INFO_PRINTF2(_L("Latest IpGateway value is %S"), &newestDisplayIpGateway);		
       
  1104 				
       
  1105 		if(intermediateResult && 
       
  1106            newestDisplayIpAddr == oldIpAddr && 
       
  1107            newestDisplayIpGateway == newIpGateway)
       
  1108 			{
       
  1109 			SetTestStepResult(EPass);
       
  1110 			}
       
  1111 		}
       
  1112    	
       
  1113    	CleanupStack::PopAndDestroy(lanRecord3);
       
  1114     CleanupStack::PopAndDestroy(cmdbSession);
       
  1115 	CleanupStack::PopAndDestroy(lanRecord2);
       
  1116 	CleanupStack::PopAndDestroy(lanRecord1);
       
  1117 	
       
  1118 	return TestStepResult(); 
       
  1119 	}
       
  1120 //----------------------------------------------------------------------------------------------------------------
       
  1121 CCommsdat55Step::CCommsdat55Step()
       
  1122 /**
       
  1123  * Constructor
       
  1124  */
       
  1125 	{
       
  1126 	SetTestStepName(KCommsdat55Step);                                                                                           
       
  1127 	}
       
  1128 
       
  1129 TVerdict CCommsdat55Step::doTestStepL()
       
  1130 /**
       
  1131  * @return - TVerdict code
       
  1132  * Test deleting; record should be inserted with CED te_commsdat_lanservice_table3
       
  1133  */
       
  1134 	{
       
  1135     SetTestStepResult(EFail);	
       
  1136 	INFO_PRINTF1(_L("I am in CCommsdat55Step::doTestStepL() and trying to test SetAttributeMask"));
       
  1137 
       
  1138 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1139  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1140 #else
       
  1141  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1142 #endif
       
  1143 	CleanupStack::PushL(cmdbSession); 
       
  1144 	CMDBRecordSet<CCDLANServiceRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDLANServiceRecord>(KCDTIdLANServiceRecord);
       
  1145 	
       
  1146 	TRAPD(loadErr, recordSet->LoadL(*cmdbSession));
       
  1147     INFO_PRINTF3(_L("lanService recordSet LoadL result was %d.  Should be 0.  returned %d records"), loadErr, recordSet->iRecords.Count());
       
  1148 	
       
  1149 	if(loadErr == KErrNone)
       
  1150 		{
       
  1151 		if(recordSet->iRecords.Count() > 0)
       
  1152 			{
       
  1153 			TRAPD(openErr, cmdbSession->OpenTransactionL());
       
  1154             INFO_PRINTF2(_L("lanRecord OpenTransactionL result was %d.  Should be 0"), openErr);
       
  1155 				
       
  1156 			if(openErr == KErrNone)
       
  1157 				{
       
  1158 				TRAPD(deleteErr, recordSet->DeleteL(*cmdbSession));
       
  1159                 INFO_PRINTF2(_L("lanRecord DeleteL result was %d.  Should be 0"), deleteErr);
       
  1160 
       
  1161 				TRAPD(commitErr, cmdbSession->CommitTransactionL());
       
  1162                 INFO_PRINTF2(_L("lanRecord CommitTransactionL result was %d.  Should be 0"), commitErr);
       
  1163 				}
       
  1164 			}
       
  1165 
       
  1166         CCDLANServiceRecord *lanRecord1 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1167 		CleanupStack::PushL(lanRecord1);
       
  1168         lanRecord1->SetRecordId(KCDNewRecordRequest);
       
  1169 
       
  1170 		CCDLANServiceRecord *lanRecord2 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1171 		CleanupStack::PushL(lanRecord2);
       
  1172 		lanRecord2->SetRecordId(KCDNewRecordRequest);
       
  1173 
       
  1174 		TPtrC newIpAddr1(_L("111.111.111.111"));
       
  1175 		TPtrC newIpAddr2(_L("222.222.222.222"));
       
  1176 		
       
  1177         lanRecord1->iIpAddr.SetMaxLengthL(newIpAddr1.Length());				
       
  1178         lanRecord1->iIpAddr = newIpAddr1;
       
  1179 	 
       
  1180         lanRecord2->iIpAddr.SetMaxLengthL(newIpAddr2.Length());				
       
  1181 		lanRecord2->iIpAddr = newIpAddr2;
       
  1182 		lanRecord2->SetAttributes(ECDHidden);
       
  1183 		
       
  1184 		TRAPD(openErr, cmdbSession->OpenTransactionL());
       
  1185 		INFO_PRINTF2(_L("lanRecords OpenTransactionL result was %d.  Should be 0"), openErr);
       
  1186         if(openErr == KErrNone)	
       
  1187 			{
       
  1188 	        CMDBRecordSet<CCDLANServiceRecord>* nestedRecordSet = new(ELeave) CMDBRecordSet<CCDLANServiceRecord>(KCDTIdLANServiceRecord);
       
  1189 
       
  1190             TRAPD(storeErr1, lanRecord1->StoreL(*cmdbSession));
       
  1191     		INFO_PRINTF2(_L("lanRecord1 StoreL result was %d.  Should be 0"), storeErr1);
       
  1192 
       
  1193             cmdbSession->SetAttributeMask(ECDHidden);
       
  1194 
       
  1195 	        TRAPD(storeErr2, lanRecord2->StoreL(*cmdbSession));
       
  1196             INFO_PRINTF2(_L("lanRecord2 StoreL result was %d.  Should be 0"), storeErr2);
       
  1197 			
       
  1198             TRAPD(commitErr, cmdbSession->CommitTransactionL());
       
  1199             INFO_PRINTF2(_L("lanRecords CommitTransactionL result was %d.  Should be 0"), commitErr);
       
  1200 
       
  1201             if(storeErr1 == KErrNone && storeErr2 == KErrNone && commitErr == KErrNone)
       
  1202 				{
       
  1203 				SetTestStepResult(EPass);		
       
  1204 				}
       
  1205 			delete nestedRecordSet;
       
  1206 			}
       
  1207 		CleanupStack::PopAndDestroy(lanRecord2);
       
  1208 		CleanupStack::PopAndDestroy(lanRecord1);
       
  1209 		}
       
  1210 	delete recordSet;
       
  1211 	
       
  1212 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1213 		
       
  1214 	return TestStepResult(); 
       
  1215 	}
       
  1216 //----------------------------------------------------------------------------------------------------------------
       
  1217 CCommsdat56Step::CCommsdat56Step()
       
  1218 /**
       
  1219  * Constructor
       
  1220  */
       
  1221 	{
       
  1222 	SetTestStepName(KCommsdat56Step);                                                                                           
       
  1223 	}
       
  1224 
       
  1225 TVerdict CCommsdat56Step::doTestStepPreambleL()
       
  1226 	{
       
  1227     SetTestStepResult(EFail);	
       
  1228 
       
  1229 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1230  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1231 #else
       
  1232  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1233 #endif
       
  1234 	CleanupStack::PushL(cmdbSession); 
       
  1235 
       
  1236     CCDLANServiceRecord *lanRecord1 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1237 	CleanupStack::PushL(lanRecord1);
       
  1238     lanRecord1->SetRecordId(KCDNewRecordRequest);
       
  1239 
       
  1240 	CCDLANServiceRecord *lanRecord2 = (CCDLANServiceRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord);
       
  1241 	CleanupStack::PushL(lanRecord2);
       
  1242 	lanRecord2->SetRecordId(KCDNewRecordRequest);
       
  1243 
       
  1244 	TPtrC newIpAddr1(_L("111.111.111.111"));
       
  1245 	TPtrC newIpAddr2(_L("222.222.222.222"));
       
  1246 		
       
  1247     lanRecord1->iIpAddr.SetMaxLengthL(newIpAddr1.Length());				
       
  1248     lanRecord1->iIpAddr = newIpAddr1;
       
  1249 	 
       
  1250     lanRecord2->iIpAddr.SetMaxLengthL(newIpAddr2.Length());				
       
  1251 	lanRecord2->iIpAddr = newIpAddr2;
       
  1252 	lanRecord2->SetAttributes(ECDHidden);
       
  1253 		
       
  1254 	cmdbSession->OpenTransactionL();
       
  1255 	
       
  1256     lanRecord1->StoreL(*cmdbSession);
       
  1257    		
       
  1258     cmdbSession->SetAttributeMask(ECDHidden);
       
  1259 
       
  1260     lanRecord2->StoreL(*cmdbSession);
       
  1261         			
       
  1262     cmdbSession->CommitTransactionL();
       
  1263         
       
  1264 	CleanupStack::PopAndDestroy(lanRecord2);
       
  1265 	CleanupStack::PopAndDestroy(lanRecord1);
       
  1266 	
       
  1267 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1268 		
       
  1269 	SetTestStepResult(EPass);		
       
  1270 	return TestStepResult(); 
       
  1271 	}
       
  1272 
       
  1273 
       
  1274 TVerdict CCommsdat56Step::doTestStepL()
       
  1275 /**
       
  1276  * @return - TVerdict code
       
  1277  * Test finding records with attributes
       
  1278  */
       
  1279 	{
       
  1280     SetTestStepResult(EFail);	
       
  1281 	INFO_PRINTF1(_L("I am in CCommsdat56Step::doTestStepL() and trying to test SetAttributeMask"));
       
  1282 
       
  1283 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1284  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1285 #else
       
  1286  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1287 #endif
       
  1288 	CleanupStack::PushL(cmdbSession); 
       
  1289 	
       
  1290     CCDLANServiceRecord *lanRecord1 = static_cast<CCDLANServiceRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord));
       
  1291 	CleanupStack::PushL(lanRecord1);
       
  1292 	CCDLANServiceRecord *lanRecord2 = static_cast<CCDLANServiceRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord));
       
  1293 	CleanupStack::PushL(lanRecord2);
       
  1294 	CCDLANServiceRecord *lanRecord3 = static_cast<CCDLANServiceRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord));
       
  1295 	CleanupStack::PushL(lanRecord3);
       
  1296 	CCDLANServiceRecord *lanRecord4 = static_cast<CCDLANServiceRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord));
       
  1297 	CleanupStack::PushL(lanRecord4);
       
  1298 	
       
  1299    	TPtrC newIpAddr1(_L("111.111.111.111"));
       
  1300 
       
  1301     TBool found1(EFalse);
       
  1302     lanRecord1->iIpAddr.SetMaxLengthL(newIpAddr1.Length());				
       
  1303 	lanRecord1->iIpAddr = newIpAddr1;
       
  1304 	found1 = lanRecord1->FindL(*cmdbSession);
       
  1305     if(found1)
       
  1306     	{
       
  1307     	INFO_PRINTF2(_L("Success.  Found non-hidden record without hidden mask.  ElementId %08x"), lanRecord1->ElementId());
       
  1308     	}
       
  1309 	 
       
  1310 	TPtrC newIpAddr2(_L("222.222.222.222"));
       
  1311 
       
  1312     TBool found2(EFalse);
       
  1313     lanRecord2->iIpAddr.SetMaxLengthL(newIpAddr2.Length());				
       
  1314 	lanRecord2->iIpAddr = newIpAddr2;
       
  1315 	found2 = lanRecord2->FindL(*cmdbSession);
       
  1316     if(!found2)
       
  1317     	{
       
  1318     	INFO_PRINTF1(_L("Success.  Could not find hidden record without hidden mask."));
       
  1319     	}
       
  1320 	else
       
  1321 		{
       
  1322 		INFO_PRINTF3(_L("Result of searching hidden record without mask %b, for element %08x"), found2, lanRecord2->ElementId());
       
  1323 		if(lanRecord2->IsSetAttribute(ECDHidden))
       
  1324 			{
       
  1325 			INFO_PRINTF1(_L("Hidden attribute set though"));	
       
  1326 			}
       
  1327 		}
       
  1328 
       
  1329 	cmdbSession->SetAttributeMask(ECDHidden);
       
  1330 
       
  1331     TBool found3(EFalse);
       
  1332     lanRecord3->iIpAddr.SetMaxLengthL(newIpAddr1.Length());				
       
  1333 	lanRecord3->iIpAddr = newIpAddr1;
       
  1334 	found3 = lanRecord3->FindL(*cmdbSession);
       
  1335 	if(found3)
       
  1336 		{
       
  1337 		INFO_PRINTF2(_L("Success.  Found non-hidden record with hidden mask set.  ElementId %08x"), lanRecord3->ElementId());
       
  1338 		}
       
  1339     else
       
  1340     	{
       
  1341     	INFO_PRINTF1(_L("Failure.  Did not find non-hidden record with hidden mask set."));
       
  1342     	}
       
  1343         
       
  1344     TBool found4(EFalse);
       
  1345     lanRecord4->iIpAddr.SetMaxLengthL(newIpAddr2.Length());				
       
  1346 	lanRecord4->iIpAddr = newIpAddr2;
       
  1347 	found4 = lanRecord4->FindL(*cmdbSession);
       
  1348 	if(found4)
       
  1349 		{
       
  1350 		INFO_PRINTF2(_L("Success.  Found hidden record with hidden mask set.  ElementId %08x"), lanRecord4->ElementId());
       
  1351 		}
       
  1352     
       
  1353         
       
  1354 	CleanupStack::PopAndDestroy(lanRecord4);
       
  1355 	CleanupStack::PopAndDestroy(lanRecord3);
       
  1356 	CleanupStack::PopAndDestroy(lanRecord2);
       
  1357 	CleanupStack::PopAndDestroy(lanRecord1);
       
  1358 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1359 		
       
  1360 	if(found1   &&
       
  1361 	   !found2  &&
       
  1362 	   found3   &&
       
  1363 	   found4 )
       
  1364 		{
       
  1365 		SetTestStepResult(EPass);
       
  1366 		}
       
  1367 		
       
  1368 	return TestStepResult(); 
       
  1369 	}
       
  1370 //----------------------------------------------------------------------------------------------------------------
       
  1371 CCommsdat57Step::CCommsdat57Step()
       
  1372 /**
       
  1373  * Constructor
       
  1374  */
       
  1375 	{
       
  1376 	SetTestStepName(KCommsdat57Step);                                                                                           
       
  1377 	}
       
  1378 
       
  1379 
       
  1380 TVerdict CCommsdat57Step::doTestStepL()
       
  1381 /**
       
  1382  * @return - TVerdict code
       
  1383  * test LoadL with record set; record should be added with CED te_commsdat_modembearer_table1
       
  1384  */
       
  1385 	{
       
  1386     SetTestStepResult(EFail);	
       
  1387 	INFO_PRINTF1(_L("I am in CCommsdat57Step::doTestStepL() and trying to test RecordSet LoadL"));
       
  1388 
       
  1389 	CMDBRecordSet<CCDModemBearerRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1390 	
       
  1391 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1392  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1393 #else
       
  1394  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1395 #endif
       
  1396 	CleanupStack::PushL(cmdbSession);
       
  1397 	
       
  1398 	TRAPD(recordSetLoadErr,recordSet->LoadL(*cmdbSession));
       
  1399 	INFO_PRINTF2(_L("LoadL for record set returns %d"), recordSetLoadErr);
       
  1400 	INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1401 	
       
  1402 	for(TUint i = 0; i< recordSet->iRecords.Count(); i++)
       
  1403 		{
       
  1404 		INFO_PRINTF2(_L("Record number %d"), i);
       
  1405 		TPtrC displayRecordName((static_cast<CCDModemBearerRecord *>(recordSet->iRecords[i]))->iRecordName);
       
  1406 		INFO_PRINTF2(_L("Record name %S"), &displayRecordName);
       
  1407 		}
       
  1408 	
       
  1409 	if(recordSet->iRecords.Count() > 0)
       
  1410 		{
       
  1411 		SetTestStepResult(EPass);
       
  1412 		}
       
  1413 
       
  1414 	delete recordSet;
       
  1415 	
       
  1416 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1417 	
       
  1418 	return TestStepResult(); 
       
  1419 	}
       
  1420 //----------------------------------------------------------------------------------------------------------------
       
  1421 CCommsdat58Step::CCommsdat58Step()
       
  1422 /**
       
  1423  * Constructor
       
  1424  */
       
  1425 	{
       
  1426 	SetTestStepName(KCommsdat58Step);                                                                                           
       
  1427 	}
       
  1428 
       
  1429 TVerdict CCommsdat58Step::doTestStepL()
       
  1430 /**
       
  1431  * @return - TVerdict code
       
  1432  * test FindL for record set with a search criteria; record should be added with CED te_commsdat_modembearer_table1
       
  1433  */
       
  1434 	{
       
  1435     SetTestStepResult(EFail);	
       
  1436 	INFO_PRINTF1(_L("I am in CCommsdat58Step::doTestStepL() and trying to test RecordSet FindL"));
       
  1437 
       
  1438 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1439  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1440 #else
       
  1441  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1442 #endif
       
  1443 	CleanupStack::PushL(cmdbSession);
       
  1444 	
       
  1445 	CMDBRecordSet<CCDModemBearerRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1446 	CleanupStack::PushL(recordSet);	
       
  1447 	CCDModemBearerRecord *record = static_cast<CCDModemBearerRecord *>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
       
  1448 	CleanupStack::PushL(record);
       
  1449 	record->iDataBits = EData8;
       
  1450 	
       
  1451 	recordSet->iRecords.Append(record);
       
  1452 	
       
  1453     TBool found(0);
       
  1454 	found = recordSet->FindL(*cmdbSession);
       
  1455 	INFO_PRINTF2(_L("FindL for record set returns %d.  Should be 1"), found);
       
  1456 	INFO_PRINTF2(_L("Number of records %d."), recordSet->iRecords.Count());
       
  1457 	
       
  1458 	for(TUint i = 0; i< recordSet->iRecords.Count(); i++)
       
  1459 		{
       
  1460 		INFO_PRINTF2(_L("Record number %d"), i);
       
  1461 		TPtrC displayRecordName(static_cast<CCDModemBearerRecord *>(recordSet->iRecords[i])->iRecordName);
       
  1462 		INFO_PRINTF2(_L("Record name %S"), &displayRecordName);
       
  1463 		}
       
  1464 	
       
  1465 	if(found && recordSet->iRecords.Count() > 0)
       
  1466 		{
       
  1467 		SetTestStepResult(EPass);
       
  1468 		}
       
  1469 	
       
  1470 	recordSet->iRecords.Close();
       
  1471 	CleanupStack::PopAndDestroy(record);
       
  1472 	CleanupStack::PopAndDestroy(recordSet);	
       
  1473 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1474 	
       
  1475 	return TestStepResult(); 
       
  1476 
       
  1477 	}
       
  1478 //----------------------------------------------------------------------------------------------------------------
       
  1479 CCommsdat59Step::CCommsdat59Step()
       
  1480 /**
       
  1481  * Constructor
       
  1482  */
       
  1483 	{
       
  1484 	SetTestStepName(KCommsdat59Step);                                                                                           
       
  1485 	}
       
  1486 
       
  1487 TVerdict CCommsdat59Step::doTestStepL()
       
  1488 /**
       
  1489  * @return - TVerdict code
       
  1490  * test ModifyL for record set; record should be added with CED te_commsdat_modembearer_table2
       
  1491  */
       
  1492 	{
       
  1493     SetTestStepResult(EFail);	
       
  1494 	INFO_PRINTF1(_L("I am in CCommsdat59Step::doTestStepL() and trying to test RecordSet ModifyL"));
       
  1495 
       
  1496 	CMDBRecordSet<CCDModemBearerRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1497 	
       
  1498 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1499  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1500 #else
       
  1501  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1502 #endif
       
  1503 	CleanupStack::PushL(cmdbSession);
       
  1504 	
       
  1505 	TRAPD(recordSetLoadErr,recordSet->LoadL(*cmdbSession));
       
  1506 	INFO_PRINTF2(_L("LoadL for record set returns %d"), recordSetLoadErr);
       
  1507 	INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1508 
       
  1509     TInt modifyErr(KErrNotFound);
       
  1510 
       
  1511     if (recordSet->iRecords.Count() == 6)
       
  1512         {
       
  1513     	_LIT(KName1, "NAME 1");
       
  1514 		
       
  1515         CCDModemBearerRecord *record1 = static_cast<CCDModemBearerRecord *>(recordSet->iRecords[0]);
       
  1516 	    record1->iRecordName.SetMaxLengthL(KName1().Length());
       
  1517 	    record1->iRecordName = KName1;
       
  1518 	
       
  1519     	_LIT(KName5, "NAME 5");
       
  1520 
       
  1521 	    CCDModemBearerRecord *record5 = static_cast<CCDModemBearerRecord *>(recordSet->iRecords[4]);
       
  1522 	    record5->iRecordName.SetMaxLengthL(KName5().Length());
       
  1523 	    record5->iRecordName = KName5;
       
  1524 
       
  1525 	
       
  1526 	    for(TUint i = 0; i< recordSet->iRecords.Count(); i++)
       
  1527 		    {
       
  1528 		    INFO_PRINTF2(_L("Record 	 %d"), i);
       
  1529 		    TPtrC displayRecordName((static_cast<CCDModemBearerRecord *>(recordSet->iRecords[i]))->iRecordName);
       
  1530 		    INFO_PRINTF2(_L("Record name %S"), &displayRecordName);
       
  1531 		    }
       
  1532 	
       
  1533     	TRAP(modifyErr, recordSet->ModifyL(*cmdbSession));
       
  1534         INFO_PRINTF2(_L("ModifyL for recordSet returned %d"), modifyErr);
       
  1535 	    }
       
  1536 
       
  1537 	delete recordSet;
       
  1538     CleanupStack::PopAndDestroy(cmdbSession);
       
  1539 	
       
  1540 	if(modifyErr == KErrNone)
       
  1541 		{
       
  1542 		SetTestStepResult(EPass);
       
  1543 		}
       
  1544 	return TestStepResult(); 
       
  1545 	}
       
  1546 //----------------------------------------------------------------------------------------------------------------
       
  1547 CCommsdat60Step::CCommsdat60Step()
       
  1548 /**
       
  1549  * Constructor
       
  1550  */
       
  1551 	{
       
  1552 	SetTestStepName(KCommsdat60Step);                                                                                           
       
  1553 	}
       
  1554 
       
  1555 TVerdict CCommsdat60Step::doTestStepL()
       
  1556 /**
       
  1557  * @return - TVerdict code
       
  1558  * test RefreshL on record set; record should be added with CED te_commsdat_modembearer_table2 
       
  1559  */
       
  1560 	{
       
  1561     SetTestStepResult(EFail);	
       
  1562 	INFO_PRINTF1(_L("I am in CCommsdat60Step::doTestStepL() and trying to test RecordSet RefreshL"));
       
  1563 	
       
  1564 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1565  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1566 #else
       
  1567  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1568 #endif
       
  1569 	CleanupStack::PushL(cmdbSession);
       
  1570 	
       
  1571 	CMDBRecordSet<CCDModemBearerRecord>* recordSet1 = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1572 	CleanupStack::PushL(recordSet1);	
       
  1573 	recordSet1->LoadL(*cmdbSession);
       
  1574 	
       
  1575 	if (recordSet1->iRecords.Count() > 2)
       
  1576         {
       
  1577         INFO_PRINTF2(_L("Number of records %d"), recordSet1->iRecords.Count());
       
  1578 	
       
  1579 	    CMDBRecordSet<CCDModemBearerRecord>* recordSet2 = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1580 		CleanupStack::PushL(recordSet2);	
       
  1581 	    recordSet2->LoadL(*cmdbSession);
       
  1582 	
       
  1583         INFO_PRINTF2(_L("Number of records %d"), recordSet2->iRecords.Count());
       
  1584 	        
       
  1585 	    TPtrC name1(_L("NAME 1"));
       
  1586 
       
  1587 	    static_cast<CCDModemBearerRecord *>(recordSet1->iRecords[1])->iRecordName = name1;
       
  1588 	        
       
  1589 	    TPtrC name2(_L("NAME 2"));
       
  1590 	    CCDModemBearerRecord *record2 = static_cast<CCDModemBearerRecord *>(recordSet2->iRecords[2]);
       
  1591 	    record2->iRecordName = name2;
       
  1592 		        
       
  1593 	    recordSet1->ModifyL(*cmdbSession);
       
  1594 	    recordSet2->RefreshL(*cmdbSession);
       
  1595 	    
       
  1596 		TPtrC testName1(static_cast<CCDModemBearerRecord *>(recordSet2->iRecords[1])->iRecordName);
       
  1597 		TPtrC testName2(static_cast<CCDModemBearerRecord *>(recordSet2->iRecords[2])->iRecordName);
       
  1598 		if(testName1 == name1 && testName2 == name2)
       
  1599 			{
       
  1600 			SetTestStepResult(EPass);	
       
  1601 			}
       
  1602 		CleanupStack::PopAndDestroy(recordSet2);	
       
  1603         }    
       
  1604 	CleanupStack::PopAndDestroy(recordSet1);	
       
  1605 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1606 	
       
  1607 	return TestStepResult(); 
       
  1608 	}
       
  1609 //----------------------------------------------------------------------------------------------------------------
       
  1610 CCommsdat61Step::CCommsdat61Step()
       
  1611 /**
       
  1612  * Constructor
       
  1613  */
       
  1614 	{
       
  1615 	SetTestStepName(KCommsdat61Step);                                                                                           
       
  1616 	}
       
  1617 
       
  1618 TVerdict CCommsdat61Step::doTestStepL()
       
  1619 /**
       
  1620  * @return - TVerdict code
       
  1621  * test DeleteL for record set; record should be added with CED te_commsdat_modembearer_table2
       
  1622  */
       
  1623 	{
       
  1624     SetTestStepResult(EFail);	
       
  1625 	INFO_PRINTF1(_L("I am in CCommsdat61Step::doTestStepL() and trying to test RecordSet DeleteL"));
       
  1626 	
       
  1627 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1628  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1629 #else
       
  1630  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1631 #endif
       
  1632 	CleanupStack::PushL(cmdbSession);
       
  1633 	
       
  1634 	CMDBRecordSet<CCDModemBearerRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1635 	CleanupStack::PushL(recordSet);	
       
  1636 	TRAPD(recordSetLoadErr,recordSet->LoadL(*cmdbSession));
       
  1637 	INFO_PRINTF2(_L("LoadL for record set returns %d"), recordSetLoadErr);
       
  1638 	if (recordSetLoadErr == KErrNone && recordSet->iRecords.Count() > 1)
       
  1639         {
       
  1640         INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1641 	
       
  1642 	    TUint32 recordTag = static_cast<CCDModemBearerRecord *>(recordSet->iRecords[1])->iRecordTag;
       
  1643 	    
       
  1644 	    cmdbSession->OpenTransactionL();
       
  1645 	    static_cast<CCDModemBearerRecord *>(recordSet->iRecords[1])->DeleteL(*cmdbSession);
       
  1646 	    cmdbSession->CommitTransactionL();
       
  1647 			    
       
  1648 	    CCDModemBearerRecord *record = static_cast<CCDModemBearerRecord *>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
       
  1649 		CleanupStack::PushL(record);
       
  1650 		    
       
  1651 		record->iRecordTag = recordTag;
       
  1652 		TBool res(EFalse);
       
  1653 		res = record->FindL(*cmdbSession);
       
  1654 		if(!res)
       
  1655 		    {
       
  1656 		    SetTestStepResult(EPass);	
       
  1657 		    }
       
  1658 		 
       
  1659 		 CleanupStack::PopAndDestroy(record);
       
  1660         }
       
  1661     
       
  1662 	CleanupStack::PopAndDestroy(recordSet);	
       
  1663 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1664 	
       
  1665 	return TestStepResult(); 
       
  1666 	}
       
  1667 //----------------------------------------------------------------------------------------------------------------
       
  1668 CCommsdat62Step::CCommsdat62Step()
       
  1669 /**
       
  1670  * Constructor
       
  1671  */
       
  1672 	{
       
  1673 	SetTestStepName(KCommsdat62Step);                                                                                           
       
  1674 	}
       
  1675 
       
  1676 TVerdict CCommsdat62Step::doTestStepL()
       
  1677 /**
       
  1678  * @return - TVerdict code
       
  1679  * test DeleteL for record set; record should be added with CED te_commsdat_modembearer_table2
       
  1680  */
       
  1681 	{
       
  1682     SetTestStepResult(EFail);	
       
  1683 	INFO_PRINTF1(_L("I am in CCommsdat62Step::doTestStepL() and trying to test RecordSet DeleteL"));
       
  1684 	
       
  1685 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1686  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1687 #else
       
  1688  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1689 #endif
       
  1690 	CleanupStack::PushL(cmdbSession);
       
  1691 	
       
  1692 	CMDBRecordSet<CCDModemBearerRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1693 	recordSet->LoadL(*cmdbSession);
       
  1694 	INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1695 	
       
  1696 	cmdbSession->OpenTransactionL();
       
  1697 	recordSet->DeleteL(*cmdbSession);
       
  1698 	cmdbSession->CommitTransactionL();
       
  1699 			
       
  1700 	CMDBRecordSet<CCDModemBearerRecord>* recordSetTest = new(ELeave) CMDBRecordSet<CCDModemBearerRecord>(KCDTIdModemBearerRecord);	
       
  1701 	TRAPD(recordSetTestLoadErr,recordSetTest->LoadL(*cmdbSession));
       
  1702 		 
       
  1703 	if(recordSetTestLoadErr == KErrNotFound)
       
  1704 		{
       
  1705 		INFO_PRINTF1(_L("Records Deleted correctly"));	
       
  1706 		SetTestStepResult(EPass);
       
  1707 		}
       
  1708 	else
       
  1709 		{
       
  1710 		INFO_PRINTF2(_L("Err in record deletion %d"), recordSetTestLoadErr);	
       
  1711 		}	
       
  1712 	delete recordSetTest;
       
  1713 		
       
  1714 	delete recordSet;
       
  1715 	
       
  1716 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1717 	
       
  1718 	return TestStepResult(); 
       
  1719 	}
       
  1720 //----------------------------------------------------------------------------------------------------------------
       
  1721 CCommsdat63Step::CCommsdat63Step()
       
  1722 /**
       
  1723  * Constructor
       
  1724  */
       
  1725 	{
       
  1726 	SetTestStepName(KCommsdat63Step);                                                                                           
       
  1727 	}
       
  1728 
       
  1729 TVerdict CCommsdat63Step::doTestStepL()
       
  1730 /**
       
  1731  * @return - TVerdict code
       
  1732  * test record set attributes
       
  1733  */
       
  1734 	{
       
  1735     SetTestStepResult(EFail);	
       
  1736 	INFO_PRINTF1(_L("I am in CCommsdat63Step::doTestStepL() and trying to test RecordSet SetAttributes"));
       
  1737 	
       
  1738 	CMDBRecordSet<CCDLocationRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDLocationRecord>(KCDTIdLocationRecord);	
       
  1739 	CleanupStack::PushL(recordSet);	
       
  1740 
       
  1741 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1742  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1743 #else
       
  1744  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1745 #endif
       
  1746 	CleanupStack::PushL(cmdbSession);
       
  1747 	
       
  1748 	TRAPD(recordSetLoadErr,recordSet->LoadL(*cmdbSession));
       
  1749 	INFO_PRINTF2(_L("LoadL for record set returns %d"), recordSetLoadErr);
       
  1750 	INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1751 	
       
  1752 	recordSet->SetAttributes(ECDNoWriteButDelete);
       
  1753 
       
  1754     cmdbSession->SetAttributeMask(ECDNoWriteButDelete);
       
  1755 	TRAPD(modifyErr, recordSet->ModifyL(*cmdbSession));
       
  1756 	INFO_PRINTF2(_L("ModifyL for record set returns %d"), modifyErr);
       
  1757 	
       
  1758 	if(modifyErr == KErrNone)
       
  1759 		{
       
  1760 		CleanupStack::PopAndDestroy(cmdbSession);
       
  1761 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1762 		CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1763 #else
       
  1764 		CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1765 #endif
       
  1766 		CleanupStack::PushL(cmdbSession);
       
  1767 		
       
  1768 		CCDLocationRecord *record = static_cast<CCDLocationRecord *>(CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord));
       
  1769 		CleanupStack::PushL(record);
       
  1770         record->SetRecordId(22);
       
  1771 		
       
  1772 		TRAPD(loadErr, record->LoadL(*cmdbSession));
       
  1773     	INFO_PRINTF4(_L("LoadL for record %08x returns %d.  IsSetAttribute(ECDNoWriteButDelete) returns %d"), record->ElementId(), loadErr, record->IsSetAttribute(ECDNoWriteButDelete));
       
  1774 		if(loadErr == KErrNone && record->IsSetAttribute(ECDNoWriteButDelete))
       
  1775 			{
       
  1776 			SetTestStepResult(EPass);	
       
  1777 			}
       
  1778 		CleanupStack::PopAndDestroy(record);
       
  1779 		}
       
  1780 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1781 	CleanupStack::PopAndDestroy(recordSet);	
       
  1782 	
       
  1783 	return TestStepResult(); 
       
  1784 	}
       
  1785 
       
  1786 //----------------------------------------------------------------------------------------------------------------
       
  1787 CCommsdat64Step::CCommsdat64Step()
       
  1788 /**
       
  1789  * Constructor
       
  1790  */
       
  1791 	{
       
  1792 	SetTestStepName(KCommsdat64Step);                                                                                           
       
  1793 	}
       
  1794 
       
  1795 TVerdict CCommsdat64Step::doTestStepL()
       
  1796 /**
       
  1797  * @return - TVerdict code
       
  1798  * Test record set attributes
       
  1799  */
       
  1800 	{
       
  1801     SetTestStepResult(EFail);	
       
  1802 	INFO_PRINTF1(_L("I am in CCommsdat64Step::doTestStepL() and trying to test RecordSet SetAttributes"));
       
  1803 	
       
  1804 	CMDBRecordSet<CCDLocationRecord>* recordSet = new(ELeave) CMDBRecordSet<CCDLocationRecord>(KCDTIdLocationRecord);	
       
  1805 	CleanupStack::PushL(recordSet);	
       
  1806 
       
  1807 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1808  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1809 #else
       
  1810  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1811 #endif
       
  1812 	CleanupStack::PushL(cmdbSession);
       
  1813 	
       
  1814 	TRAPD(recordSetLoadErr,recordSet->LoadL(*cmdbSession));
       
  1815 	INFO_PRINTF2(_L("LoadL for record set returns %d"), recordSetLoadErr);
       
  1816 	INFO_PRINTF2(_L("Number of records %d"), recordSet->iRecords.Count());
       
  1817 	
       
  1818     if (recordSet->iRecords.Count() > 0)
       
  1819         {
       
  1820 	    recordSet->iRecords[0]->SetAttributes(ECDNoWriteButDelete);
       
  1821 	    cmdbSession->SetAttributeMask(ECDNoWriteButDelete);
       
  1822 
       
  1823         TRAPD(modifyErr, recordSet->iRecords[0]->ModifyL(*cmdbSession));
       
  1824         TMDBElementId idWithAttr = recordSet->iRecords[0]->ElementId();
       
  1825 	    INFO_PRINTF3(_L("modify attributes record set err is %d for ElementId %08x"), modifyErr, recordSet->iRecords[0]->ElementId());
       
  1826 	    
       
  1827 	    if(modifyErr == KErrNone)
       
  1828 		    {
       
  1829 		    CleanupStack::PopAndDestroy(cmdbSession);
       
  1830 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1831 		    CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1832 #else
       
  1833 		    CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1834 #endif
       
  1835 		    CleanupStack::PushL(cmdbSession);
       
  1836 		    
       
  1837 		    CMDBRecordSet<CCDLocationRecord>* recordSetTest = new(ELeave) CMDBRecordSet<CCDLocationRecord>(KCDTIdLocationRecord);	
       
  1838 			CleanupStack::PushL(recordSetTest);	
       
  1839 		    TRAPD(loadTestErr, recordSetTest->LoadL(*cmdbSession));
       
  1840 		    INFO_PRINTF4(_L("load record set err is %d.  ElementId is %08x.  Should be %08x"), loadTestErr, recordSetTest->iRecords[0]->ElementId(), idWithAttr);
       
  1841 		    
       
  1842 		    if(loadTestErr == KErrNone && recordSetTest->iRecords[0]->IsSetAttribute(ECDNoWriteButDelete))
       
  1843 			    {
       
  1844 			    SetTestStepResult(EPass);	
       
  1845 			    }
       
  1846 			CleanupStack::PopAndDestroy(recordSetTest);	
       
  1847 		    }
       
  1848         }	    
       
  1849 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1850 	CleanupStack::PopAndDestroy(recordSet);	
       
  1851 	
       
  1852 	return TestStepResult(); 
       
  1853 	}
       
  1854 //----------------------------------------------------------------------------------------------------------------
       
  1855 CCommsdat65Step::CCommsdat65Step()
       
  1856 /**
       
  1857  * Constructor
       
  1858  */
       
  1859 	{
       
  1860 	SetTestStepName(KCommsdat65Step);                                                                                           
       
  1861 	}
       
  1862 
       
  1863 TVerdict CCommsdat65Step::doTestStepL()
       
  1864 /**
       
  1865  * @return - TVerdict code
       
  1866  * Test storing a single field on a records.
       
  1867  */
       
  1868 	{
       
  1869     SetTestStepResult(EFail);	
       
  1870 	INFO_PRINTF1(_L("I am in CCommsdat65Step::doTestStepL() and trying to test load, find, store, and modify"));
       
  1871 	
       
  1872 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1873  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1874 #else
       
  1875  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1876 #endif
       
  1877 	CleanupStack::PushL(cmdbSession);
       
  1878 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
  1879 	CleanupStack::PushL(iapRecord);
       
  1880 	
       
  1881 	iapRecord->iNetworkWeighting = 10;
       
  1882 	TBool found = iapRecord->iNetworkWeighting.FindL(*cmdbSession);
       
  1883    	
       
  1884 	if(found)
       
  1885 		{
       
  1886 		TRAPD(loadErr, iapRecord->iNetworkWeighting.LoadL(*cmdbSession));
       
  1887 	   	INFO_PRINTF2(_L("LoadL for field returns %d - should be 0"), loadErr);
       
  1888 
       
  1889 		if(loadErr == KErrNone)
       
  1890 			{
       
  1891 			iapRecord->iNetworkWeighting = 20;
       
  1892 			TRAPD(modifyErr, iapRecord->iNetworkWeighting.ModifyL(*cmdbSession));
       
  1893     		INFO_PRINTF2(_L("ModifyL for field returns %d - should be 0"), modifyErr);
       
  1894 	        if(modifyErr == KErrNone)
       
  1895 				{
       
  1896 				CCDIAPRecord *newIapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
  1897 				CleanupStack::PushL(newIapRecord);
       
  1898 				
       
  1899                 newIapRecord->SetRecordId(72);
       
  1900 
       
  1901 				TRAPD(storeErr, newIapRecord->StoreL(*cmdbSession));
       
  1902                 INFO_PRINTF2(_L("StoreL for new IAP record returns %d - should be 0"), storeErr);
       
  1903 
       
  1904                 if(storeErr == KErrNone)
       
  1905 					{
       
  1906 					newIapRecord->iNetworkWeighting.SetRecordId(72);
       
  1907                     newIapRecord->iNetworkWeighting = 21;
       
  1908 
       
  1909 				    TRAP(storeErr, newIapRecord->iNetworkWeighting.StoreL(*cmdbSession));
       
  1910                     INFO_PRINTF2(_L("StoreL for field in new IAP record returns %d - should be 0"), storeErr);
       
  1911                 
       
  1912                     if(storeErr == KErrNone)
       
  1913 				    	{
       
  1914 				    	SetTestStepResult(EPass);
       
  1915 				    	}
       
  1916                     }
       
  1917 				
       
  1918 				CleanupStack::PopAndDestroy(newIapRecord);
       
  1919 				}
       
  1920 			}
       
  1921 		}
       
  1922 
       
  1923 	CleanupStack::PopAndDestroy(iapRecord);
       
  1924 	CleanupStack::PopAndDestroy(cmdbSession);
       
  1925 	return TestStepResult(); 
       
  1926 	}
       
  1927 //----------------------------------------------------------------------------------------------------------------
       
  1928 CCommsdat66Step::CCommsdat66Step()
       
  1929 /**
       
  1930  * Constructor
       
  1931  */
       
  1932 	{
       
  1933 	SetTestStepName(KCommsdat66Step);                                                                                           
       
  1934 	}
       
  1935 TVerdict CCommsdat66Step::doTestStepL()
       
  1936 /**
       
  1937  * @return - TVerdict code
       
  1938  * Test linking two records
       
  1939  */
       
  1940 	{
       
  1941     SetTestStepResult(EFail);	
       
  1942 	INFO_PRINTF1(_L("I am in CCommsdat66Step::doTestStepL() and trying to establish a link between an IAP and a Location record"));
       
  1943 	
       
  1944 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1945  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  1946 #else
       
  1947  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  1948 #endif
       
  1949 	CleanupStack::PushL(cmdbSession);
       
  1950 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
  1951 	CleanupStack::PushL(iapRecord);
       
  1952 
       
  1953 	
       
  1954 	iapRecord->iNetworkWeighting = 21;
       
  1955 
       
  1956     TBool found(EFalse);
       
  1957     found = iapRecord->FindL(*cmdbSession);
       
  1958     INFO_PRINTF3(_L("FindL for iap record returns %d, %d - should be 1.  Element Id is %08x"), found, iapRecord->ElementId());
       
  1959 
       
  1960 	if(found)
       
  1961 		{
       
  1962 		CCDLocationRecord *locationRecord = (CCDLocationRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord);
       
  1963 		CleanupStack::PushL(locationRecord);
       
  1964 		
       
  1965 		TPtrC recordName(_L("Location 1")); 
       
  1966 	    locationRecord->iRecordName.SetMaxLengthL(recordName.Length());
       
  1967         locationRecord->iRecordName = recordName;
       
  1968 		
       
  1969         cmdbSession->SetAttributeMask(ECDNoWriteButDelete | ECDPrivate | ECDHidden);
       
  1970 
       
  1971 		found = locationRecord->FindL(*cmdbSession);
       
  1972         INFO_PRINTF2(_L("FindL for location record returns %d - should be 1"), found);
       
  1973 
       
  1974 		if(found)
       
  1975 			{
       
  1976 			iapRecord->iLocation = locationRecord->RecordId();
       
  1977 			TRAPD(modifyErr, iapRecord->ModifyL(*cmdbSession));
       
  1978             INFO_PRINTF2(_L("ModifyL for iap record returns %d - should be 0"), modifyErr);
       
  1979 
       
  1980 			if(modifyErr == KErrNone)
       
  1981 				{
       
  1982 				SetTestStepResult(EPass);
       
  1983 				}
       
  1984 			}
       
  1985 		
       
  1986 		CleanupStack::PopAndDestroy(locationRecord);
       
  1987 		}
       
  1988 	
       
  1989 	CleanupStack::PopAndDestroy(iapRecord);
       
  1990 	CleanupStack::PopAndDestroy(cmdbSession);		
       
  1991 	return TestStepResult(); 
       
  1992 	}
       
  1993 //----------------------------------------------------------------------------------------------------------------
       
  1994 CCommsdat67Step::CCommsdat67Step()
       
  1995 /**
       
  1996  * Constructor
       
  1997  */
       
  1998 	{
       
  1999 	SetTestStepName(KCommsdat67Step);                                                                                           
       
  2000 	}
       
  2001 
       
  2002 TVerdict CCommsdat67Step::doTestStepL()
       
  2003 /**
       
  2004  * @return - TVerdict code
       
  2005  * Test linking two records
       
  2006  */
       
  2007 	{
       
  2008     SetTestStepResult(EFail);	
       
  2009 	INFO_PRINTF1(_L("I am in CCommsdat67Step::doTestStepL() and trying to reach linked records fields"));
       
  2010 	
       
  2011 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2012  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2013 #else
       
  2014  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2015 #endif
       
  2016 	CleanupStack::PushL(cmdbSession);
       
  2017 	CCDIAPRecord *iapRecord = (CCDIAPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord);
       
  2018 	CleanupStack::PushL(iapRecord);
       
  2019 	
       
  2020 	iapRecord->iNetworkWeighting = 21; 
       
  2021 	
       
  2022     TBool found(0);
       
  2023 
       
  2024     TRAPD(findErr, found = iapRecord->FindL(*cmdbSession));
       
  2025     INFO_PRINTF4(_L("FindL for iap record returns %d, %d - should be 0, 1.  Element Id is %08x"), findErr, found, iapRecord->ElementId());
       
  2026 	
       
  2027     if(found)
       
  2028 		{
       
  2029 		CCDLocationRecord *locationRecord = (CCDLocationRecord*)CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord);
       
  2030 		CleanupStack::PushL(locationRecord);
       
  2031 		
       
  2032 		locationRecord->SetRecordId(TMDBElementId (iapRecord->iLocation));
       
  2033 		
       
  2034 		TRAPD(loadErr, locationRecord->LoadL(*cmdbSession));
       
  2035 		if(loadErr == KErrNone)
       
  2036 			{
       
  2037 			TPtrC recordName(_L("Location 1"));
       
  2038 			TPtrC testName(locationRecord->iRecordName);
       
  2039 			INFO_PRINTF2(_L("Record name is %S"), &testName);
       
  2040 			TInt pauseAfterDialOut(locationRecord->iPauseAfterDialOut);
       
  2041 			INFO_PRINTF2(_L("Pause after dial is %d"), pauseAfterDialOut);
       
  2042 			if( testName == recordName)
       
  2043 				{
       
  2044 				SetTestStepResult(EPass);
       
  2045 				}
       
  2046 			}
       
  2047 		
       
  2048 		CleanupStack::PopAndDestroy(locationRecord);
       
  2049 		}
       
  2050 	
       
  2051 	CleanupStack::PopAndDestroy(iapRecord);
       
  2052 	CleanupStack::PopAndDestroy(cmdbSession);		
       
  2053 	return TestStepResult(); 
       
  2054 	}
       
  2055 //----------------------------------------------------------------------------------------------------------------
       
  2056 _LIT(KVeryLongText, 
       
  2057 "A very long text; which is of 1024 characters:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       
  2058 L"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
       
  2059 L"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
       
  2060 L"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
       
  2061 L"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
       
  2062 L"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
       
  2063 L"GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"
       
  2064 L"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
       
  2065 L"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
       
  2066 L"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ"
       
  2067 L"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk The end.");
       
  2068 
       
  2069 CCommsdat68Step::CCommsdat68Step()
       
  2070 /**
       
  2071  * Constructor
       
  2072  */
       
  2073 	{
       
  2074 	SetTestStepName(KCommsdat68Step);                                                                                           
       
  2075 	}
       
  2076 
       
  2077 TVerdict CCommsdat68Step::doTestStepL()
       
  2078 /**
       
  2079  * @return - TVerdict code
       
  2080  * Test long texts as field value
       
  2081  */
       
  2082 	{
       
  2083     SetTestStepResult(EFail);	
       
  2084 	INFO_PRINTF1(_L("Testing long text as field values in CCommsdat68Step::doTestStepL() "));
       
  2085 	
       
  2086 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2087  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2088 #else
       
  2089  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2090 #endif
       
  2091 	CleanupStack::PushL(cmdbSession); 
       
  2092 	
       
  2093 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2094 	CleanupStack::PushL(record);
       
  2095 	
       
  2096 	//Create a new dial out ISP record
       
  2097 	record->SetRecordId(KCDNewRecordRequest);
       
  2098 				
       
  2099 	record->iLoginScript.SetL(KVeryLongText);
       
  2100 		
       
  2101 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2102 		
       
  2103 	if(storeErr == KErrNone) 
       
  2104 		{
       
  2105 		SetTestStepResult(EPass);
       
  2106 		}
       
  2107 
       
  2108 	CleanupStack::PopAndDestroy(record);
       
  2109     CleanupStack::PopAndDestroy(cmdbSession);
       
  2110 	
       
  2111 	return TestStepResult();
       
  2112 	}
       
  2113 
       
  2114 //----------------------------------------------------------------------------------------------------------------
       
  2115 _LIT(KLongTextGreaterThan1024, 
       
  2116 "A very long text; which is of 1024 characters:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       
  2117 L"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
       
  2118 L"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
       
  2119 L"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
       
  2120 L"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
       
  2121 L"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
       
  2122 L"GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG"
       
  2123 L"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
       
  2124 L"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
       
  2125 L"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ"
       
  2126 L"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk The end.+");
       
  2127 
       
  2128 CCommsdat69Step::CCommsdat69Step()
       
  2129 /**
       
  2130  * Constructor
       
  2131  */
       
  2132 	{
       
  2133 	SetTestStepName(KCommsdat69Step);                                                                                           
       
  2134 	}
       
  2135 
       
  2136 TVerdict CCommsdat69Step::doTestStepL()
       
  2137 /**
       
  2138  * @return - TVerdict code
       
  2139  * Test long texts as field value
       
  2140  */
       
  2141 	{
       
  2142     SetTestStepResult(EFail);	
       
  2143 	INFO_PRINTF1(_L("Testing long text as field values in CCommsdat69Step::doTestStepL() "));
       
  2144 	
       
  2145 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2146  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2147 #else
       
  2148  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2149 #endif
       
  2150 	CleanupStack::PushL(cmdbSession); 
       
  2151 	
       
  2152 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2153 	CleanupStack::PushL(record);
       
  2154 	
       
  2155 	//Create a new dial out ISP record
       
  2156 	record->SetRecordId(KCDNewRecordRequest);
       
  2157 				
       
  2158 	record->iLoginScript.SetL(KLongTextGreaterThan1024);
       
  2159 		
       
  2160 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2161 		
       
  2162 	if(storeErr == KErrOverflow) 
       
  2163 		{
       
  2164 		SetTestStepResult(EPass);
       
  2165 		}
       
  2166 
       
  2167 	CleanupStack::PopAndDestroy(record);
       
  2168     CleanupStack::PopAndDestroy(cmdbSession);
       
  2169 	
       
  2170 	return TestStepResult();
       
  2171 	}
       
  2172 //----------------------------------------------------------------------------------------------------------------
       
  2173 _LIT(KMedText255, 
       
  2174 "A medium long text; which is of 255 characters:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       
  2175 L"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
       
  2176 L"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
       
  2177 L" The end.");
       
  2178 
       
  2179 CCommsdat70Step::CCommsdat70Step()
       
  2180 /**
       
  2181  * Constructor
       
  2182  */
       
  2183 	{
       
  2184 	SetTestStepName(KCommsdat70Step);                                                                                           
       
  2185 	}
       
  2186 
       
  2187 TVerdict CCommsdat70Step::doTestStepL()
       
  2188 /**
       
  2189  * @return - TVerdict code
       
  2190  * Test medium texts as field value
       
  2191  */
       
  2192 	{
       
  2193     SetTestStepResult(EFail);	
       
  2194 	INFO_PRINTF1(_L("Testing medium text as field values in CCommsdat70Step::doTestStepL() "));
       
  2195 	
       
  2196 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2197  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2198 #else
       
  2199  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2200 #endif
       
  2201 	CleanupStack::PushL(cmdbSession); 
       
  2202 	
       
  2203 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2204 	CleanupStack::PushL(record);
       
  2205 	
       
  2206 	//Create a new dial out ISP record
       
  2207 	record->SetRecordId(KCDNewRecordRequest);
       
  2208 				
       
  2209 	record->iLoginName.SetL(KMedText255);
       
  2210 		
       
  2211 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2212 		
       
  2213 	if(storeErr == KErrNone) 
       
  2214 		{
       
  2215 		SetTestStepResult(EPass);
       
  2216 		}
       
  2217 
       
  2218 	CleanupStack::PopAndDestroy(record);
       
  2219     CleanupStack::PopAndDestroy(cmdbSession);
       
  2220 	
       
  2221 	return TestStepResult();
       
  2222 	}
       
  2223 //--------------------------------------------------------------------------------------------------------------
       
  2224 _LIT(KMedTextGreaterThan255, 
       
  2225 "A medium long text; which is of 256 characters:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       
  2226 L"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
       
  2227 L"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
       
  2228 L" The end.+");
       
  2229 
       
  2230 CCommsdat71Step::CCommsdat71Step()
       
  2231 /**
       
  2232  * Constructor
       
  2233  */
       
  2234 	{
       
  2235 	SetTestStepName(KCommsdat71Step);                                                                                           
       
  2236 	}
       
  2237 
       
  2238 TVerdict CCommsdat71Step::doTestStepL()
       
  2239 /**
       
  2240  * @return - TVerdict code
       
  2241  * Test medium texts as field value
       
  2242  */
       
  2243 	{
       
  2244     SetTestStepResult(EFail);	
       
  2245 	INFO_PRINTF1(_L("Testing medium text as field values in CCommsdat71Step::doTestStepL() "));
       
  2246 	
       
  2247 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2248  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2249 #else
       
  2250  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2251 #endif
       
  2252 	CleanupStack::PushL(cmdbSession); 
       
  2253 	
       
  2254 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2255 	CleanupStack::PushL(record);
       
  2256 	
       
  2257 	//Create a new dial out ISP record
       
  2258 	record->SetRecordId(KCDNewRecordRequest);
       
  2259 				
       
  2260 	record->iLoginName.SetL(KMedTextGreaterThan255);
       
  2261 		
       
  2262 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2263 	
       
  2264     INFO_PRINTF2(_L("storeErr = %d"), storeErr);
       
  2265     
       
  2266 	if(storeErr == KErrOverflow) 
       
  2267 		{
       
  2268 		SetTestStepResult(EPass);
       
  2269 		}
       
  2270 
       
  2271 	CleanupStack::PopAndDestroy(record);
       
  2272     CleanupStack::PopAndDestroy(cmdbSession);
       
  2273 	
       
  2274 	return TestStepResult();
       
  2275 	}
       
  2276 //--------------------------------------------------------------------------------------------------------------
       
  2277 _LIT(KText50, 
       
  2278 "A text; which is of 50 characters:AAAAAAAAAAAAAAAA");
       
  2279 
       
  2280 CCommsdat72Step::CCommsdat72Step()
       
  2281 /**
       
  2282  * Constructor
       
  2283  */
       
  2284 	{
       
  2285 	SetTestStepName(KCommsdat72Step);                                                                                           
       
  2286 	}
       
  2287 
       
  2288 TVerdict CCommsdat72Step::doTestStepL()
       
  2289 /**
       
  2290  * @return - TVerdict code
       
  2291  * Test medium texts as field value
       
  2292  */
       
  2293 	{
       
  2294     SetTestStepResult(EFail);	
       
  2295 	INFO_PRINTF1(_L("Testing text as field values in CCommsdat72Step::doTestStepL() "));
       
  2296 	
       
  2297 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2298  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2299 #else
       
  2300  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2301 #endif
       
  2302 	CleanupStack::PushL(cmdbSession); 
       
  2303 	
       
  2304 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2305 	CleanupStack::PushL(record);
       
  2306 	
       
  2307 	//Create a new dial out ISP record
       
  2308 	record->SetRecordId(KCDNewRecordRequest);
       
  2309 				
       
  2310 	record->iDescription.SetL(KText50);
       
  2311 		
       
  2312 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2313 		
       
  2314 	if(storeErr == KErrNone) 
       
  2315 		{
       
  2316 		SetTestStepResult(EPass);
       
  2317 		}
       
  2318 
       
  2319 	CleanupStack::PopAndDestroy(record);
       
  2320     CleanupStack::PopAndDestroy(cmdbSession);
       
  2321 	
       
  2322 	return TestStepResult();
       
  2323 	}
       
  2324 //--------------------------------------------------------------------------------------------------------------
       
  2325 _LIT(KTextGreaterThan50, 
       
  2326 "A text; which is of 51 characters:AAAAAAAAAAAAAAAA+");
       
  2327 
       
  2328 CCommsdat73Step::CCommsdat73Step()
       
  2329 /**
       
  2330  * Constructor
       
  2331  */
       
  2332 	{
       
  2333 	SetTestStepName(KCommsdat73Step);                                                                                           
       
  2334 	}
       
  2335 
       
  2336 TVerdict CCommsdat73Step::doTestStepL()
       
  2337 /**
       
  2338  * @return - TVerdict code
       
  2339  * Test medium texts as field value
       
  2340  */
       
  2341 	{
       
  2342     SetTestStepResult(EFail);	
       
  2343 	INFO_PRINTF1(_L("Testing text as field values in CCommsdat73Step::doTestStepL() "));
       
  2344 	
       
  2345 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  2346  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
  2347 #else
       
  2348  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
  2349 #endif
       
  2350 	CleanupStack::PushL(cmdbSession); 
       
  2351 	
       
  2352 	CCDDialOutISPRecord *record = (CCDDialOutISPRecord*)CCDRecordBase::RecordFactoryL(KCDTIdDialOutISPRecord);
       
  2353 	CleanupStack::PushL(record);
       
  2354 	
       
  2355 	//Create a new dial out ISP record
       
  2356 	record->SetRecordId(KCDNewRecordRequest);
       
  2357 				
       
  2358 	record->iDescription.SetL(KTextGreaterThan50);
       
  2359 		
       
  2360 	TRAPD(storeErr, record->StoreL(*cmdbSession));
       
  2361 	
       
  2362     INFO_PRINTF2(_L("storeErr = %d"), storeErr);
       
  2363     
       
  2364 	if(storeErr == KErrOverflow) 
       
  2365 		{
       
  2366 		SetTestStepResult(EPass);
       
  2367 		}
       
  2368 
       
  2369 	CleanupStack::PopAndDestroy(record);
       
  2370     CleanupStack::PopAndDestroy(cmdbSession);
       
  2371 	
       
  2372 	return TestStepResult();
       
  2373 	}
       
  2374 //--------------------------------------------------------------------------------------------------------------