50
|
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: Header file for contact adapter's datastore unit tests.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __CNSMLDUMMYDATASTORE_TEST_H__
|
|
19 |
#define __CNSMLDUMMYDATASTORE_TEST_H__
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <ceunittestsuiteclass.h>
|
|
23 |
#include <smldatasyncdefs.h>
|
|
24 |
#include <cntdb.h>
|
|
25 |
#include <s32mem.h>
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class CNSmlDummyDataStore;
|
|
29 |
class CNSmlAdapterTestUtilities;
|
|
30 |
class CNSmlDummyDataStoreWaiter;
|
|
31 |
class CSmlDataStore;
|
|
32 |
|
|
33 |
// CLASS DEFINITION
|
|
34 |
/**
|
|
35 |
* Generated EUnit test suite class.
|
|
36 |
*/
|
|
37 |
NONSHARABLE_CLASS( CNSmlDummyDataStore_Test )
|
|
38 |
: public CEUnitTestSuiteClass, public MSmlSyncRelationship
|
|
39 |
{
|
|
40 |
public: // Constructors and destructor
|
|
41 |
|
|
42 |
static CNSmlDummyDataStore_Test* NewL();
|
|
43 |
static CNSmlDummyDataStore_Test* NewLC();
|
|
44 |
~CNSmlDummyDataStore_Test();
|
|
45 |
|
|
46 |
private: // Constructors
|
|
47 |
|
|
48 |
CNSmlDummyDataStore_Test();
|
|
49 |
void ConstructL();
|
|
50 |
|
|
51 |
private: // New methods
|
|
52 |
|
|
53 |
void Empty() {};
|
|
54 |
|
|
55 |
// ++ Setup methods ++
|
|
56 |
void SetupL();
|
|
57 |
|
|
58 |
void SetupAndOpenStoreL();
|
|
59 |
|
|
60 |
void SetupAndPopulateContactDbL();
|
|
61 |
|
|
62 |
void SetupPopulateDbAndOpenStoreL();
|
|
63 |
|
|
64 |
// ++ Teardown methods ++
|
|
65 |
void Teardown();
|
|
66 |
|
|
67 |
void TeardownAndCloseStore();
|
|
68 |
|
|
69 |
void TeardownAndEmptyContactDb();
|
|
70 |
|
|
71 |
void TeardownCloseAndEmptyContactDb();
|
|
72 |
|
|
73 |
// ++ DataStore test cases ++
|
|
74 |
void NewLL();
|
|
75 |
|
|
76 |
void DoOpenLL();
|
|
77 |
|
|
78 |
void DoHasSyncHistoryL();
|
|
79 |
|
|
80 |
void DoModifiedItemsL();
|
|
81 |
|
|
82 |
void DoResetChangeInfoLL();
|
|
83 |
|
|
84 |
void DoCommitChangeInfoLL();
|
|
85 |
|
|
86 |
void AddSingleItemL();
|
|
87 |
|
|
88 |
void AddItemBatchL();
|
|
89 |
|
|
90 |
void CancelBatchL();
|
|
91 |
|
|
92 |
void FetchItemL();
|
|
93 |
|
|
94 |
void UpdateItemL();
|
|
95 |
|
|
96 |
void DeleteItemL();
|
|
97 |
|
|
98 |
void DeleteAllItemsL();
|
|
99 |
|
|
100 |
void GetStoreFormatResourceFileLL();
|
|
101 |
|
|
102 |
void TestStoreSupportMimeTypeL();
|
|
103 |
|
|
104 |
void DoBeginTransactionL();
|
|
105 |
|
|
106 |
void DoCommitTransactionL();
|
|
107 |
|
|
108 |
void DoRevertTransaction();
|
|
109 |
|
|
110 |
void StoreNameL();
|
|
111 |
|
|
112 |
void FindChangedItemsL();
|
|
113 |
|
|
114 |
void MoveAndDeleteL();
|
|
115 |
|
|
116 |
void DoSetRemoteMaxObjectSize();
|
|
117 |
|
|
118 |
void DoMaxObjectSize();
|
|
119 |
|
|
120 |
void GetDataMod();
|
|
121 |
|
|
122 |
// ++ Helper methods ++
|
|
123 |
TContactItemId AddContactL( const TDesC& aFirstName,
|
|
124 |
const TDesC& aLastName,
|
|
125 |
const TDesC& aPhoneNumber );
|
|
126 |
|
|
127 |
void CreateDataStoreL();
|
|
128 |
|
|
129 |
void DeleteDataStoreL();
|
|
130 |
|
|
131 |
private: // from MSmlSyncRelationship
|
|
132 |
TSmlSyncTaskKey SyncTaskKey() const;
|
|
133 |
|
|
134 |
void OpenReadStreamLC( RReadStream& aReadStream, TUid aStreamUid );
|
|
135 |
|
|
136 |
void OpenWriteStreamLC( RWriteStream& aWriteStream, TUid aStreamUid );
|
|
137 |
|
|
138 |
TBool IsStreamPresentL( TUid aStreamUid ) const;
|
|
139 |
|
|
140 |
private: // Data
|
|
141 |
|
|
142 |
CNSmlDummyDataStore* iCNSmlDummyDataStore;
|
|
143 |
CNSmlAdapterTestUtilities* iTestUtilities;
|
|
144 |
|
|
145 |
CContactDatabase* iContactDatabase;
|
|
146 |
CContactIdArray* iIdArray;
|
|
147 |
RFs iFsSession;
|
|
148 |
RFileWriteStream iWriteStream;
|
|
149 |
TSmlDbItemUid iItemUid;
|
|
150 |
|
|
151 |
CNSmlDummyDataStoreWaiter* iStoreWaiter;
|
|
152 |
CSmlDataStore* iDataStore;
|
|
153 |
|
|
154 |
EUNIT_DECLARE_TEST_TABLE;
|
|
155 |
};
|
|
156 |
|
|
157 |
#endif // __CNSMLDUMMYDATASTORE_TEST_H__
|