--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/tsrc/t_caclient/inc/t_caclient.h Thu Sep 16 12:11:40 2010 +0100
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main test class for hspluginmodel library.
+*
+*/
+
+#ifndef T_CACLIENT_H
+#define T_CACLIENT_H
+
+#include <QtTest/QtTest>
+#include "cadefs.h"
+
+#ifdef Q_OS_SYMBIAN
+#include <e32std.h>
+#endif
+
+class CaService;
+class CaEntry;
+class CaItemModel;
+
+/**
+ * @test Test class for hsmcsserviceprovider library.
+ */
+class TestCaClient : public QObject
+{
+ Q_OBJECT
+
+private slots:
+
+#ifdef Q_OS_SYMBIAN
+ //executeCommand
+ void TestExecuteCommandRemove();
+
+ void TestExecuteCommandOpen();
+#endif //Q_OS_SYMBIAN
+
+ /**
+ * initialize
+ */
+ void initTestCase();
+
+ //localization
+
+ void TestLocalizationEntryGetters();
+
+ void TestLocalizationTApp();
+
+ void TestCreateLocalizedItem();
+
+// query&entry getters
+ void TestEntryGetters();
+
+ void TestEntryAssignmentOperator();
+
+ void TestQueryGetters();
+
+ void TestQueryClear();
+
+ void TestQueryRemove();
+
+ void TestQueryAssignmentOperator();
+
+ void TestMakeDefaultCollectionIcon();
+
+ void TestMakeDefaultApplicationIcon();
+
+ void TestMakeNotNativeApplicationIcon();
+
+ void TestMakeExistingIcon();
+
+ void TestMakeNotExistingIcon();
+
+ void TestGetEntryIcon();
+ void TestGetApplicationIcon();
+ void TestGetIconFromEntry();
+ void TestGetIconFromApparc();
+ void TestGetDefaultIcon();
+
+
+//create&update
+ void TestUpdateItem();
+
+ void TestCreateItem();
+
+ void TestCreateGroup();
+
+ void TestCreateItemNotAllParams();
+
+ void TestCreateGroupNotAllParams();
+
+ void TestUpdateGroup();
+
+//remove
+ void TestRemoveItem();
+
+ void TestRemoveGroup();
+
+ void TestRemoveItems();
+
+ void TestRemoveItemsFail();
+
+ void TestRemoveGroups();
+
+ void TestRemoveGroupsFail();
+
+// backup
+
+ void TestCreateBackupNotifier();
+
+ void TestBackupNotifierRunL();
+
+
+//organize
+
+ void TestAppendEntryIntoGroup1();
+
+ void TestAppendEntryIntoGroup2();
+
+ void TestAppendEntriesIntoGroup1();
+
+ void TestAppendEntriesIntoGroup2();
+
+ void TestPrependEntryIntoGroup1();
+
+ void TestPrependEntryIntoGroup2();
+
+ void TestPrependEntriesIntoGroup1();
+
+ void TestPrependEntriesIntoGroup2();
+
+ void TestInsertEntryIntoGroup1();
+
+ void TestInsertEntryIntoGroup2();
+
+ void TestInsertEntriesIntoGroup1();
+
+ void TestInsertEntriesIntoGroup2();
+
+ void TestRemoveEntryFromGroup1();
+
+ void TestRemoveEntryFromGroup2();
+
+ void TestRemoveEntriesFromGroup1();
+
+ void TestRemoveEntriesFromGroup2();
+
+ void TestCustomSort();
+
+ void TestCustomSortArrange();
+
+ void TestCustomSortGroups();
+
+ void TestCustomSortFake();
+
+
+//get entries
+ void TestGetEntry();
+
+ void TestGetEntriesByIds();
+
+ void TestGetEntriesByRole();
+
+ void TestGetEntriesByParent();
+
+ void TestGetEntriesByType1();
+
+ void TestGetEntriesByType2();
+
+ void TestGetEntriesByFlagsOn();
+
+ void TestGetEntriesByFlagsOff();
+
+ void TestGetEntriesByFlagsOnOff();
+
+ void TestGetEntriesByRoleParent();
+
+ void TestGetEntriesByRoleType();
+
+ void TestGetEntriesByRoleFlags();
+
+ void TestGetEntriesByParentType();
+
+ void TestGetEntriesByParentFlags();
+
+ void TestGetEntriesByTypeFlags();
+
+ void TestGetEntriesByRoleParentType();
+
+ void TestGetEntriesByRoleParentFlags();
+
+ void TestGetEntriesByParentTypeFlags();
+
+ void TestGetEntriesByRoleParentTypeFlags();
+
+ void TestGetEntriesCount();
+
+ void TestGetEntriesSortCreated();
+
+ void TestGetEntriesSortDefault();
+
+ void TestGetEntriesSortName();
+
+ void TestGetEntriesSortLast();
+
+ void TestGetEntriesSortMost();
+
+ void TestGetEntriesIdsByRole();
+
+ void TestGetEntriesIdsByParent();
+
+ void TestGetEntriesIdsByType1();
+
+ void TestGetEntriesIdsByType2();
+
+ void TestGetEntriesIdsByFlagsOn();
+
+ void TestGetEntriesIdsByFlagsOff();
+
+ void TestGetEntriesIdsByFlagsOnOff();
+
+ void TestGetEntriesIdsByRoleParent();
+
+ void TestGetEntriesIdsByRoleType();
+
+ void TestGetEntriesIdsByRoleFlags();
+
+ void TestGetEntriesIdsByParentType();
+
+ void TestGetEntriesIdsByParentFlags();
+
+ void TestGetEntriesIdsByTypeFlags();
+
+ void TestGetEntriesIdsByRoleParentType();
+
+ void TestGetEntriesIdsByRoleParentFlags();
+
+ void TestGetEntriesIdsByParentTypeFlags();
+
+ void TestGetEntriesIdsByRoleParentTypeFlags();
+
+ void TestGetEntriesIdsCount();
+
+ void TestGetEntriesIdsSortDefault();
+
+ void TestGetEntriesIdsSortCreated();
+
+ void TestGetEntriesIdsSortName();
+
+ void TestGetEntriesIdsSortLast();
+
+ void TestGetEntriesIdsSortMost();
+
+ void TestGetEntriesByAttributes();
+
+ //caitemmodel
+ void TestCaItemModelConstruct();
+ void TestCaItemModelAutoUpdate();
+ void TestCaItemModelIndex();
+ void TestCaItemModelData();
+ void TestCaItemModelIconSize();
+ void TestCaItemModelChangeParent();
+ void TestCaItemModelSortOrder();
+ void TestCaItemModelUpdateItem();
+ void TestCaItemModelAddItems();
+ void TestCaItemModelEmptySignal();
+
+// notifier
+
+ void TestAssignmentOperatorNotifier();
+
+ void TestAddItemChangeTypeNotifier();
+ void TestAddGroupChangeTypeNotifier();
+
+ void TestRemoveEntryChangeTypeNotifier();
+ void TestRemoveEntryIdChangeTypeNotifier();
+ void TestRemoveEntryChangeTypeNotifierFake();
+ void TestRemoveEntryIdChangeTypeNotifierFake();
+ void TestRemoveEntriesChangeTypeNotifier();
+ void TestRemoveEntriesIdsChangeTypeNotifier();
+ void TestRemoveEntriesChangeTypeNotifierFake();
+ void TestRemoveEntriesIdsChangeTypeNotifierFake();
+ void TestRemoveGroupChangeTypeNotifier();
+ void TestRemoveGroupsChangeTypeNotifier();
+
+ void TestUpdateChangeTypeNotifier();
+ void TestUpdateChangeTypeNotifierFake();
+ void TestAddUpdateRemove();
+
+ void TestRegisterNotifier();
+ void TestUnregisterNotifier();
+
+ void TestTouchEntryNotifier();
+ void TestTouchEntryIdNotifier();
+ void TestTouchEntryUidNotifier();
+ void TestTouchEntryNotifierFake();
+ void TestTouchEntryIdNotifierFake();
+ void TestTouchGroupNotifier();
+
+ void TestAppendEntryGroupNotifier();
+ void TestAppendEntryGroupIdNotifier();
+ void TestAppendEntriesGroupNotifier();
+ void TestAppendEntriesGroupIdNotifier();
+
+ void TestPrependEntryGroupNotifier();
+ void TestPrependEntryGroupIdNotifier();
+ void TestPrependEntriesGroupNotifier();
+ void TestPrependEntriesGroupIdNotifier();
+
+ void TestRemoveEntryGroupNotifier();
+ void TestRemoveEntryGroupIdNotifier();
+ void TestRemoveEntriesGroupNotifier();
+ void TestRemoveEntriesGroupIdNotifier();
+
+ void TestInsertEntryGroupNotifier();
+ void TestInsertEntryGroupIdNotifier();
+ void TestInsertEntriesGroupNotifier();
+ void TestInsertEntriesGroupIdNotifier();
+
+ void TestChangeEntryWithParentIdNotifier();
+
+
+
+ void TestRemoveEntriesChangeTypeNotifier3Clients();
+
+ void TestAddItemChangeTypeNotifierNClients();
+ void TestAddItemChangeTypeNotifierNClientsFast();
+ void TestAddItemChangeTypeNotifierNClientsThreads();
+
+ void TestRemoveEntryChangeTypeNotifierNClients();
+ void TestRemoveEntryChangeTypeNotifierNClientsThreads();
+ void TestRemoveEntryIdChangeTypeNotifierNClientsThreads();
+
+ void TestAddItemChangeTypeNotifierManyClientsThreads();
+ //void TestRemoveEntriesChangeTypeNotifier3Clients();
+
+ // void TestAppendRemoveEntryGroupNotifier();
+
+ void TestCreateItemWhenServerWasTerminated();
+
+ void TestAddItemChangeTypeNotifier3Clients();
+ void TestRemoveEntryChangeTypeNotifier3Clients();
+
+ /**
+ * cleanup
+ */
+ void cleanupTestCase();
+
+private:
+ void startThread();
+ void stopThread();
+ // utility methods
+ QSharedPointer<CaEntry> createGroup(const QString &groupName, const QString &typeName);
+ QSharedPointer<CaEntry> createItem(const QString &itemName, const QString &description,
+ const QString &typeName, EntryFlags flags);
+ QSharedPointer<CaEntry> createItem(const QString &itemName, const QString &typeName);
+ void addItemToGroup(int groupId, int itemId);
+ void removeItemFromGroup(int groupId, int itemId);
+ void removeEntry(int entryId);
+ bool removeEntry(const QString &entryName);
+ QString itemName(const CaItemModel &model, int row);
+ void terminatServer();
+
+#ifdef Q_OS_SYMBIAN
+ RThread iThread;
+#endif //Q_OS_SYMBIAN
+
+private:
+ QSharedPointer<CaService> mService;
+};
+
+
+#endif//T_CACLIENT_H