|
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: Main test class for hspluginmodel library. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_CACLIENT_H |
|
19 #define T_CACLIENT_H |
|
20 |
|
21 #include <QtTest/QtTest> |
|
22 #include "cadefs.h" |
|
23 |
|
24 #ifdef Q_OS_SYMBIAN |
|
25 #include <e32std.h> |
|
26 #endif |
|
27 |
|
28 class CaService; |
|
29 class CaEntry; |
|
30 class CaItemModel; |
|
31 |
|
32 /** |
|
33 * @test Test class for hsmcsserviceprovider library. |
|
34 */ |
|
35 class TestCaClient : public QObject |
|
36 { |
|
37 Q_OBJECT |
|
38 |
|
39 private slots: |
|
40 |
|
41 /** |
|
42 * initialize |
|
43 */ |
|
44 void initTestCase(); |
|
45 |
|
46 // contentsorage_api - caservice |
|
47 void Test_instance(); |
|
48 |
|
49 void Test_getEntry(); |
|
50 void Test_getEntries_ByIds(); |
|
51 void Test_getEntries_ByQuery(); |
|
52 |
|
53 void Test_createEntry(); |
|
54 |
|
55 void Test_removeEntry_ById(); |
|
56 void Test_removeEntry_ByEntry(); |
|
57 void Test_removeEntries_ByIds(); |
|
58 void Test_RemoveEntries_ByEntries(); |
|
59 |
|
60 void Test_epdateEntry(); |
|
61 void Test_touch(); |
|
62 |
|
63 void Test_insertEntryIntoGroup_ById(); |
|
64 void Test_insertEntryIntoGroup_ByEntry(); |
|
65 void Test_insertEntriesIntoGroup_ByIds(); |
|
66 void Test_insertEntriesIntoGroup_ByEntries(); |
|
67 |
|
68 void Test_removeEntryFromGroup_ById(); |
|
69 void Test_removeEntryFromGroup_ByEntry(); |
|
70 void Test_removeEntriesFromGroup_ByIds(); |
|
71 void Test_removeEntriesFromGroup_ByEntries(); |
|
72 |
|
73 void Test_appendEntryToGroup_ById(); |
|
74 void Test_appendEntryToGroup_ByEntry(); |
|
75 void Test_appendEntriesToGroup_ByIds(); |
|
76 void Test_appendEntriesToGroup_ByEntries(); |
|
77 |
|
78 void Test_prependEntryToGroup_ById(); |
|
79 void Test_prependEntryToGroup_ByEntry(); |
|
80 void Test_prependEntriesToGroup_ByIds(); |
|
81 void Test_prependEntriesToGroup_ByEntries(); |
|
82 #ifdef Q_OS_SYMBIAN |
|
83 void Test_executeCommand_ById(); |
|
84 void Test_executeCommand_ByEntry(); |
|
85 #endif //Q_OS_SYMBIAN |
|
86 |
|
87 void Test_createNotifier(); |
|
88 void Test_customSort(); |
|
89 void Test_lastError(); |
|
90 |
|
91 // contentsorage_api - camenuiconutility |
|
92 void Test_getApplicationIcon(); |
|
93 void Test_getEntryIcon(); |
|
94 |
|
95 /** |
|
96 * cleanup |
|
97 */ |
|
98 void cleanupTestCase(); |
|
99 |
|
100 private: |
|
101 void startThread(); |
|
102 void stopThread(); |
|
103 // utility methods |
|
104 QSharedPointer<CaEntry> createGroup(const QString &groupName, const QString &typeName); |
|
105 QSharedPointer<CaEntry> createItem(const QString &itemName, const QString &description, |
|
106 const QString &typeName, EntryFlags flags); |
|
107 QSharedPointer<CaEntry> createItem(const QString &itemName, const QString &typeName); |
|
108 void addItemToGroup(int groupId, int itemId); |
|
109 void removeItemFromGroup(int groupId, int itemId); |
|
110 void removeEntry(int entryId); |
|
111 bool removeEntry(const QString &entryName); |
|
112 QString itemName(const CaItemModel &model, int row); |
|
113 void terminatServer(); |
|
114 |
|
115 #ifdef Q_OS_SYMBIAN |
|
116 RThread iThread; |
|
117 #endif //Q_OS_SYMBIAN |
|
118 |
|
119 private: |
|
120 QSharedPointer<CaService> mService; |
|
121 }; |
|
122 |
|
123 |
|
124 #endif//T_CACLIENT_H |