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