commsconfig/commsdatabaseshim/ts_commdb/Step_028_xx.cpp
changeset 72 ae47d0499bee
parent 68 5da8188e392b
child 77 c9776eadbffd
equal deleted inserted replaced
68:5da8188e392b 72:ae47d0499bee
     1 // Copyright (c) 2001-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 // This contains CommDb Unit Test Cases 028.XX
       
    15 // 
       
    16 //
       
    17 
       
    18 // EPOC includes
       
    19 #include <e32base.h>
       
    20 #include <commdb.h>
       
    21 #include <d32comm.h>
       
    22 
       
    23 // Test system includes
       
    24 #include <networking/log.h>
       
    25 #include <networking/teststep.h>
       
    26 #include "Teststepcommdb.h"
       
    27 #include "TestSuiteCommdb.h"
       
    28 #include "Step_028_xx.h"
       
    29 
       
    30 CCommDbTest028_01::CCommDbTest028_01()
       
    31 	{
       
    32 	// store the name of this test case
       
    33 	iTestStepName = _L("step_028_01");
       
    34 	}
       
    35 
       
    36 CCommDbTest028_01::~CCommDbTest028_01()
       
    37 	{}
       
    38 
       
    39 TVerdict CCommDbTest028_01::doTestStepL( void )
       
    40 	{
       
    41 	if(executeStepL()==KErrNone)
       
    42 		return EPass;
       
    43 	return EFail;
       
    44 	}
       
    45 
       
    46 TVerdict CCommDbTest028_01::doTestStepPreambleL()
       
    47 	{
       
    48 	iTheDb=CCommsDatabase::NewL();
       
    49 
       
    50 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
    51 	CleanupStack::Pop();
       
    52 
       
    53 	return EPass;
       
    54 	}
       
    55 
       
    56 TInt CCommDbTest028_01::executeStepL()
       
    57 	{
       
    58 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
    59 	pref1.iRanking = 1;
       
    60 	pref1.iDirection = ECommDbConnectionDirectionOutgoing;
       
    61 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
    62 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
    63 	pref1.iBearer.iIapId = 1;
       
    64 
       
    65 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
    66 
       
    67 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
    68 	pref2.iRanking = 2;
       
    69 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
    70 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
    71 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
    72 	pref2.iBearer.iIapId = 2;
       
    73 	
       
    74 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
    75 
       
    76 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref retrievedPref;
       
    77 	User::LeaveIfError(iPrefView->GotoFirstRecord());
       
    78 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
    79 	
       
    80 	if(!(retrievedPref==pref1))	//Check to see if correct preferance has been fetched
       
    81 		return KErrGeneral;
       
    82 
       
    83 	User::LeaveIfError(iPrefView->GotoNextRecord());
       
    84 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
    85 
       
    86 	if(!(retrievedPref==pref2))	//Check to see if correct preferance has been fetched
       
    87 		return KErrGeneral;
       
    88 
       
    89 	if((iPrefView->GotoNextRecord())!=KErrNotFound)	//Make sure there are no more records.
       
    90 		return KErrGeneral;
       
    91 
       
    92 	return KErrNone;
       
    93 	}
       
    94 	
       
    95 TVerdict CCommDbTest028_01::doTestStepPostambleL()
       
    96 	{
       
    97 		//Get rid of our view
       
    98 	if(iPrefView)
       
    99 		{
       
   100 		delete iPrefView;
       
   101 		}
       
   102 	iPrefView=0;
       
   103 
       
   104 	//Create a new view that should have the record that was added in executeStepL and
       
   105 	// may have been left in by a leave condition
       
   106 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   107 	CleanupStack::Pop();
       
   108 
       
   109 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   110 		{
       
   111 		iPrefView->DeleteConnectionPreferenceL();
       
   112 		}
       
   113 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   114 		{
       
   115 		iPrefView->DeleteConnectionPreferenceL();
       
   116 		}
       
   117 	
       
   118 	// Cleanup after test run
       
   119 	CTestStepCommDb::doTestStepPostambleL();	
       
   120 	return EPass;
       
   121 	}
       
   122 
       
   123 //
       
   124 
       
   125 CCommDbTest028_02::CCommDbTest028_02()
       
   126 	{
       
   127 	// store the name of this test case
       
   128 	iTestStepName = _L("step_028_02");
       
   129 	}
       
   130 
       
   131 CCommDbTest028_02::~CCommDbTest028_02()
       
   132 	{}
       
   133 
       
   134 TVerdict CCommDbTest028_02::doTestStepL( void )
       
   135 	{
       
   136 	if(executeStepL()==KErrNone)
       
   137 		return EPass;
       
   138 	return EFail;
       
   139 	}
       
   140 
       
   141 TVerdict CCommDbTest028_02::doTestStepPreambleL()
       
   142 	{
       
   143 	iTheDb=CCommsDatabase::NewL();
       
   144 
       
   145 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   146 	CleanupStack::Pop();
       
   147 
       
   148 	return EPass;
       
   149 	}
       
   150 
       
   151 TInt CCommDbTest028_02::executeStepL()
       
   152 	{
       
   153 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
   154 	pref1.iRanking = 1;
       
   155 	pref1.iDirection = ECommDbConnectionDirectionOutgoing;
       
   156 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
   157 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
   158 	pref1.iBearer.iIapId = 1;
       
   159 
       
   160 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   161 
       
   162 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
   163 	pref2.iRanking = 2;
       
   164 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
   165 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
   166 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
   167 	pref2.iBearer.iIapId = 2;
       
   168 	
       
   169 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
   170 
       
   171 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref retrievedPref;
       
   172 	User::LeaveIfError(iPrefView->GotoFirstRecord());
       
   173 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
   174 	
       
   175 	while (iPrefView->GotoNextRecord()!=KErrNotFound)	//Move through to last record
       
   176 		{}
       
   177 	
       
   178 	User::LeaveIfError(iPrefView->GotoPreviousRecord());
       
   179 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
   180 
       
   181 	if(!(retrievedPref==pref2))	//Check to see if correct preferance has been fetched
       
   182 		return KErrGeneral;
       
   183 
       
   184 	User::LeaveIfError(iPrefView->GotoPreviousRecord());
       
   185 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
   186 
       
   187 	if(!(retrievedPref==pref1))	//Check to see if correct preferance has been fetched
       
   188 		return KErrGeneral;
       
   189 
       
   190 	if(iPrefView->GotoPreviousRecord()!=KErrNotFound)	//Check that there are no more records
       
   191 		return KErrGeneral;
       
   192 
       
   193 	return KErrNone;
       
   194 	}
       
   195 	
       
   196 TVerdict CCommDbTest028_02::doTestStepPostambleL()
       
   197 	{
       
   198 		//Get rid of our view
       
   199 	if(iPrefView)
       
   200 		{
       
   201 		delete iPrefView;
       
   202 		}
       
   203 	iPrefView=0;
       
   204 
       
   205 	//Create a new view that should have the record that was added in executeStepL and
       
   206 	// may have been left in by a leave condition
       
   207 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   208 	CleanupStack::Pop();
       
   209 
       
   210 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   211 		{
       
   212 		iPrefView->DeleteConnectionPreferenceL();
       
   213 		}
       
   214 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   215 		{
       
   216 		iPrefView->DeleteConnectionPreferenceL();
       
   217 		}
       
   218 	
       
   219 	// Cleanup after test run
       
   220 	CTestStepCommDb::doTestStepPostambleL();	
       
   221 	return EPass;
       
   222 	}
       
   223 
       
   224 //
       
   225 
       
   226 CCommDbTest028_03::CCommDbTest028_03()
       
   227 	{
       
   228 	// store the name of this test case
       
   229 	iTestStepName = _L("step_028_03");
       
   230 	}
       
   231 
       
   232 CCommDbTest028_03::~CCommDbTest028_03()
       
   233 	{}
       
   234 
       
   235 TVerdict CCommDbTest028_03::doTestStepL( void )
       
   236 	{
       
   237 	if(executeStepL()==KErrNone)
       
   238 		return EPass;
       
   239 	return EFail;
       
   240 	}
       
   241 
       
   242 TVerdict CCommDbTest028_03::doTestStepPreambleL()
       
   243 	{
       
   244 	iTheDb=CCommsDatabase::NewL();
       
   245 
       
   246 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   247 	CleanupStack::Pop();
       
   248 
       
   249 	return EPass;
       
   250 	}
       
   251 
       
   252 TInt CCommDbTest028_03::executeStepL()
       
   253 	{
       
   254 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
   255 	pref1.iRanking = 1;
       
   256 	pref1.iDirection = ECommDbConnectionDirectionIncoming;
       
   257 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
   258 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
   259 	pref1.iBearer.iIapId = 3;
       
   260 
       
   261 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   262 
       
   263 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
   264 	pref2.iRanking = 2;
       
   265 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
   266 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
   267 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
   268 	pref2.iBearer.iIapId = 2;
       
   269 	
       
   270 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
   271 
       
   272 	delete iPrefView;	//Create a new view to look only at outgoing records.
       
   273 	iPrefView=NULL;
       
   274 	iPrefView=iTheDb->OpenConnectionPrefTableLC(ECommDbConnectionDirectionOutgoing);
       
   275 	CleanupStack::Pop(iPrefView);
       
   276 
       
   277 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref retrievedPref;
       
   278 	User::LeaveIfError(iPrefView->GotoFirstRecord());
       
   279 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
   280 		
       
   281 	if(!(retrievedPref==pref2))	//First record in this table should be pref2
       
   282 		return KErrGeneral;
       
   283 
       
   284 	if(iPrefView->GotoNextRecord()!=KErrNotFound)	//There should be no more records in this view.
       
   285 		return KErrGeneral;
       
   286 
       
   287 	return KErrNone;
       
   288 	}
       
   289 	
       
   290 TVerdict CCommDbTest028_03::doTestStepPostambleL()
       
   291 	{
       
   292 		//Get rid of our view
       
   293 	if(iPrefView)
       
   294 		{
       
   295 		delete iPrefView;
       
   296 		}
       
   297 	iPrefView=0;
       
   298 
       
   299 	//Create a new view that should have the record that was added in executeStepL and
       
   300 	// may have been left in by a leave condition
       
   301 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   302 	CleanupStack::Pop();
       
   303 
       
   304 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   305 		{
       
   306 		iPrefView->DeleteConnectionPreferenceL();
       
   307 		}
       
   308 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   309 		{
       
   310 		iPrefView->DeleteConnectionPreferenceL();
       
   311 		}
       
   312 	
       
   313 	// Cleanup after test run
       
   314 	CTestStepCommDb::doTestStepPostambleL();	
       
   315 	return EPass;
       
   316 	}
       
   317 
       
   318 //
       
   319 
       
   320 CCommDbTest028_04::CCommDbTest028_04()
       
   321 	{
       
   322 	// store the name of this test case
       
   323 	iTestStepName = _L("step_028_04");
       
   324 	}
       
   325 
       
   326 CCommDbTest028_04::~CCommDbTest028_04()
       
   327 	{}
       
   328 
       
   329 TVerdict CCommDbTest028_04::doTestStepL( void )
       
   330 	{
       
   331 	if(executeStepL()==KErrNone)
       
   332 		return EPass;
       
   333 	return EFail;
       
   334 	}
       
   335 
       
   336 TVerdict CCommDbTest028_04::doTestStepPreambleL()
       
   337 	{
       
   338 	iTheDb=CCommsDatabase::NewL();
       
   339 
       
   340 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   341 	CleanupStack::Pop();
       
   342 
       
   343 	return EPass;
       
   344 	}
       
   345 
       
   346 TInt CCommDbTest028_04::executeStepL()
       
   347 	{
       
   348 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
   349 	pref1.iRanking = 1;
       
   350 	pref1.iDirection = ECommDbConnectionDirectionIncoming;
       
   351 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
   352 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
   353 	pref1.iBearer.iIapId = 3;
       
   354 
       
   355 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   356 
       
   357 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
   358 	pref2.iRanking = 2;
       
   359 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
   360 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
   361 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
   362 	pref2.iBearer.iIapId = 2;
       
   363 	
       
   364 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
   365 
       
   366 	delete iPrefView;	//Create a new view to look only at incoming records.
       
   367 	iPrefView=NULL;
       
   368 	iPrefView=iTheDb->OpenConnectionPrefTableLC(ECommDbConnectionDirectionIncoming);
       
   369 	CleanupStack::Pop(iPrefView);
       
   370 
       
   371 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref retrievedPref;
       
   372 	User::LeaveIfError(iPrefView->GotoFirstRecord());
       
   373 	iPrefView->ReadConnectionPreferenceL(retrievedPref);
       
   374 		
       
   375 	if(!(retrievedPref==pref1))	//First record in this table should be pref1
       
   376 		return KErrGeneral;
       
   377 
       
   378 	if(iPrefView->GotoNextRecord()!=KErrNotFound)	//There should be no more records in this view.
       
   379 		return KErrGeneral;
       
   380 
       
   381 	return KErrNone;
       
   382 	}
       
   383 	
       
   384 TVerdict CCommDbTest028_04::doTestStepPostambleL()
       
   385 	{
       
   386 		//Get rid of our view
       
   387 	if(iPrefView)
       
   388 		{
       
   389 		delete iPrefView;
       
   390 		}
       
   391 	iPrefView=0;
       
   392 
       
   393 	//Create a new view that should have the record that was added in executeStepL and
       
   394 	// may have been left in by a leave condition
       
   395 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   396 	CleanupStack::Pop();
       
   397 
       
   398 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   399 		{
       
   400 		iPrefView->DeleteConnectionPreferenceL();
       
   401 		}
       
   402 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   403 		{
       
   404 		iPrefView->DeleteConnectionPreferenceL();
       
   405 		}
       
   406 	
       
   407 	// Cleanup after test run
       
   408 	CTestStepCommDb::doTestStepPostambleL();	
       
   409 	return EPass;
       
   410 	}
       
   411 
       
   412 //
       
   413 
       
   414 CCommDbTest028_05::CCommDbTest028_05()
       
   415 	{
       
   416 	// store the name of this test case
       
   417 	iTestStepName = _L("step_028_05");
       
   418 	}
       
   419 
       
   420 CCommDbTest028_05::~CCommDbTest028_05()
       
   421 	{}
       
   422 
       
   423 TVerdict CCommDbTest028_05::doTestStepL( void )
       
   424 	{
       
   425 	if(executeStepL()==KErrNone)
       
   426 		return EPass;
       
   427 	return EFail;
       
   428 	}
       
   429 
       
   430 TVerdict CCommDbTest028_05::doTestStepPreambleL()
       
   431 	{
       
   432 	iTheDb=CCommsDatabase::NewL();
       
   433 
       
   434 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   435 	CleanupStack::Pop();
       
   436 
       
   437 	return EPass;
       
   438 	}
       
   439 
       
   440 TInt CCommDbTest028_05::executeStepL()
       
   441 	{
       
   442 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
   443 	pref1.iRanking = 1;
       
   444 	pref1.iDirection = ECommDbConnectionDirectionOutgoing;
       
   445 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
   446 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
   447 	pref1.iBearer.iIapId = 1;
       
   448 
       
   449 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   450 
       
   451 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
   452 	pref2.iRanking = 2;
       
   453 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
   454 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
   455 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
   456 	pref2.iBearer.iIapId = 2;
       
   457 	
       
   458 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
   459 
       
   460 	delete iPrefView;	//Create a new view to look only at incoming records.
       
   461 	iPrefView=NULL;
       
   462 	iPrefView=iTheDb->OpenConnectionPrefTableLC(ECommDbConnectionDirectionIncoming);
       
   463 	CleanupStack::Pop(iPrefView);
       
   464 
       
   465 	if(iPrefView->GotoPreviousRecord()!=KErrNotFound)	//There should be no records in this table.
       
   466 		return KErrGeneral;
       
   467 
       
   468 	return KErrNone;
       
   469 	}
       
   470 	
       
   471 TVerdict CCommDbTest028_05::doTestStepPostambleL()
       
   472 	{
       
   473 		//Get rid of our view
       
   474 	if(iPrefView)
       
   475 		{
       
   476 		delete iPrefView;
       
   477 		}
       
   478 	iPrefView=0;
       
   479 
       
   480 	//Create a new view that should have the record that was added in executeStepL and
       
   481 	// may have been left in by a leave condition
       
   482 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   483 	CleanupStack::Pop();
       
   484 
       
   485 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   486 		{
       
   487 		iPrefView->DeleteConnectionPreferenceL();
       
   488 		}
       
   489 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   490 		{
       
   491 		iPrefView->DeleteConnectionPreferenceL();
       
   492 		}
       
   493 	
       
   494 	// Cleanup after test run
       
   495 	CTestStepCommDb::doTestStepPostambleL();	
       
   496 	return EPass;
       
   497 	}
       
   498 
       
   499 //
       
   500 
       
   501 CCommDbTest028_06::CCommDbTest028_06()
       
   502 	{
       
   503 	// store the name of this test case
       
   504 	iTestStepName = _L("step_028_06");
       
   505 	}
       
   506 
       
   507 CCommDbTest028_06::~CCommDbTest028_06()
       
   508 	{}
       
   509 
       
   510 TVerdict CCommDbTest028_06::doTestStepL( void )
       
   511 	{
       
   512 	if(executeStepL()==KErrNone)
       
   513 		return EPass;
       
   514 	return EFail;
       
   515 	}
       
   516 
       
   517 TVerdict CCommDbTest028_06::doTestStepPreambleL()
       
   518 	{
       
   519 	iTheDb=CCommsDatabase::NewL();
       
   520 
       
   521 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   522 	CleanupStack::Pop();
       
   523 
       
   524 	return EPass;
       
   525 	}
       
   526 
       
   527 TInt CCommDbTest028_06::executeStepL()
       
   528 	{
       
   529 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
       
   530 	pref1.iRanking = 1;
       
   531 	pref1.iDirection = ECommDbConnectionDirectionOutgoing;
       
   532 	pref1.iDialogPref = ECommDbDialogPrefPrompt;
       
   533 	pref1.iBearer.iBearerSet = KCommDbBearerCSD;
       
   534 	pref1.iBearer.iIapId = 1;
       
   535 
       
   536 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   537 
       
   538 	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
       
   539 	pref2.iRanking = 2;
       
   540 	pref2.iDirection = ECommDbConnectionDirectionOutgoing;
       
   541 	pref2.iDialogPref = ECommDbDialogPrefPrompt;
       
   542 	pref2.iBearer.iBearerSet = KCommDbBearerCSD;
       
   543 	pref2.iBearer.iIapId = 2;
       
   544 	
       
   545 	iPrefView->InsertConnectionPreferenceL(pref2, EFalse);
       
   546 
       
   547 	delete iPrefView;	//Create a new view to look only at incoming records.
       
   548 	iPrefView=NULL;
       
   549 	iPrefView=iTheDb->OpenConnectionPrefTableLC(ECommDbConnectionDirectionIncoming);
       
   550 	CleanupStack::Pop(iPrefView);
       
   551 
       
   552 	if(iPrefView->GotoNextRecord()!=KErrNotFound)	//There should be no records in this table.
       
   553 		return KErrGeneral;
       
   554 
       
   555 	return KErrNone;
       
   556 	}
       
   557 	
       
   558 TVerdict CCommDbTest028_06::doTestStepPostambleL()
       
   559 	{
       
   560 		//Get rid of our view
       
   561 	if(iPrefView)
       
   562 		{
       
   563 		delete iPrefView;
       
   564 		}
       
   565 	iPrefView=0;
       
   566 
       
   567 	//Create a new view that should have the record that was added in executeStepL and
       
   568 	// may have been left in by a leave condition
       
   569 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   570 	CleanupStack::Pop();
       
   571 
       
   572 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   573 		{
       
   574 		iPrefView->DeleteConnectionPreferenceL();
       
   575 		}
       
   576 	if(iPrefView->GotoFirstRecord() == KErrNone)
       
   577 		{
       
   578 		iPrefView->DeleteConnectionPreferenceL();
       
   579 		}
       
   580 	
       
   581 	// Cleanup after test run
       
   582 	CTestStepCommDb::doTestStepPostambleL();	
       
   583 	return EPass;
       
   584 	}
       
   585 
       
   586 //
       
   587 
       
   588 CCommDbTest028_07::CCommDbTest028_07()
       
   589 	{
       
   590 	// store the name of this test case
       
   591 	iTestStepName = _L("step_028_07");
       
   592 	}
       
   593 
       
   594 CCommDbTest028_07::~CCommDbTest028_07()
       
   595 	{}
       
   596 
       
   597 TVerdict CCommDbTest028_07::doTestStepL( void )
       
   598 	{
       
   599 	Log(_L("Step 028.07 called "));
       
   600 
       
   601 	iTestStepResult = EPass;
       
   602 
       
   603 	CCommDbTest028_01* step028_01 = new(ELeave) CCommDbTest028_01;
       
   604 	CleanupStack::PushL(step028_01);
       
   605 	step028_01->iSuite = iSuite;
       
   606 	doTestStepWithHeapFailureL( *step028_01, KErrNone);
       
   607 	CleanupStack::PopAndDestroy(step028_01);
       
   608 
       
   609 	CCommDbTest028_02* step028_02 = new(ELeave) CCommDbTest028_02;
       
   610 	CleanupStack::PushL(step028_02);
       
   611 	step028_02->iSuite = iSuite;
       
   612 	doTestStepWithHeapFailureL( *step028_02, KErrNone);
       
   613 	CleanupStack::PopAndDestroy(step028_02);
       
   614 
       
   615 	CCommDbTest028_03* step028_03 = new(ELeave) CCommDbTest028_03;
       
   616 	CleanupStack::PushL(step028_03);
       
   617 	step028_03->iSuite = iSuite;
       
   618 	doTestStepWithHeapFailureL( *step028_03, KErrNone);
       
   619 	CleanupStack::PopAndDestroy(step028_03);
       
   620 
       
   621 	CCommDbTest028_04* step028_04 = new(ELeave) CCommDbTest028_04;
       
   622 	CleanupStack::PushL(step028_04);
       
   623 	step028_04->iSuite = iSuite;
       
   624 	doTestStepWithHeapFailureL( *step028_04, KErrNone);
       
   625 	CleanupStack::PopAndDestroy(step028_04);
       
   626 
       
   627 	CCommDbTest028_05* step028_05 = new(ELeave) CCommDbTest028_05;
       
   628 	CleanupStack::PushL(step028_05);
       
   629 	step028_05->iSuite = iSuite;
       
   630 	doTestStepWithHeapFailureL( *step028_05, KErrNone);
       
   631 	CleanupStack::PopAndDestroy(step028_05);
       
   632 
       
   633 	CCommDbTest028_06* step028_06 = new(ELeave) CCommDbTest028_06;
       
   634 	CleanupStack::PushL(step028_06);
       
   635 	step028_06->iSuite = iSuite;
       
   636 	doTestStepWithHeapFailureL( *step028_06, KErrNone);
       
   637 	CleanupStack::PopAndDestroy(step028_06);
       
   638 
       
   639 	return iTestStepResult;
       
   640 	}