phonebookengines/contactsmodel/tsrc/cntmodel2/T_PlTransactionManager.h
changeset 0 e686773b3f54
child 24 0ba2181d7c28
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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 //
       
    15 
       
    16 
       
    17 #ifndef __TPLTRANSACTIONMANAGER__
       
    18 #define __TPLTRANSACTIONMANAGER__
       
    19 
       
    20 #include "persistencelayer.h"
       
    21 #include "NbCntTestLib.h"
       
    22 
       
    23 namespace nsPlTransMgr 
       
    24 {
       
    25 	_LIT(KFilename, "C:TransMgr.cdb");
       
    26 	const TInt KOnce 	   = 1;
       
    27 	_LIT(KNumber,  "123456789");
       
    28 	_LIT(KName,    "NAME");
       
    29 	_LIT(KEmail,   "name@email.com");
       
    30 	_LIT(KHomeAdd, "Home address");
       
    31 	
       
    32 }
       
    33 
       
    34 
       
    35 class CPlTransMgrTest : public CBase
       
    36 	{
       
    37 public:	
       
    38 	static CPlTransMgrTest* NewLC();
       
    39 	~CPlTransMgrTest();
       
    40 	void RunTestsL();
       
    41 
       
    42 	virtual void HandleDatabaseEventL(TContactDbObserverEvent /*aEvent*/)
       
    43 		{};
       
    44 	virtual void DeleteNotifyL(TContactItemId /*aContactId*/)
       
    45 		{};
       
    46 
       
    47 private:
       
    48 	void ConstructL();
       
    49 	void CreateAndCommitTestL();
       
    50 	void RollbackAndRecoverTestL();
       
    51 	void OutOfMemoryAddTestL();
       
    52 	void OutOfMemoryDeleteTestL();
       
    53 	void OutOfMemoryUpdateTestL();	
       
    54 	TBool IsContactInDbL(TInt aCntID);
       
    55 	TInt AddContactL();
       
    56 	void DeleteContactL(TInt aCntID); 
       
    57 	void UpdateContactL(TInt aCntID);
       
    58 	TInt AddAndCommitContactL();
       
    59 	void UpdateAndCommitTestL();
       
    60 	TBool CheckChangedFieldL(TInt aCntID);
       
    61 	void DeleteAndCommitTestL();
       
    62 
       
    63 private: // member variables
       
    64 	CContactItemViewDef* 	iMatchAll;
       
    65 	CPersistenceLayer* 		iPersistLayer;
       
    66 	CCntItemBuilder*		iCntItemBldr;
       
    67 	RFs iFs;
       
    68 	TInt iTestNo;
       
    69 	};
       
    70 	
       
    71 	
       
    72 #endif //__TPLTRANSACTIONMANAGER__