[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:18 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=e5ff64a

The following commit has been merged in the master branch:
commit e5ff64a00ab3d38fa87397a6d7ce885acc54521e
Author: George Goldberg <george.goldberg at collabora.co.uk>
Date:   Sat Jan 29 12:51:39 2011 +0000

    Add unit test for creating the PIMO Person when adding a contact to Nepomuk.
---
 kpeople/nepomuk-feeder/tests/storage-test.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/kpeople/nepomuk-feeder/tests/storage-test.cpp b/kpeople/nepomuk-feeder/tests/storage-test.cpp
index 202a904..a5fade7 100644
--- a/kpeople/nepomuk-feeder/tests/storage-test.cpp
+++ b/kpeople/nepomuk-feeder/tests/storage-test.cpp
@@ -24,9 +24,14 @@
 #include "test-backdoors.h"
 
 #include "ontologies/contactgroup.h"
+#include "ontologies/pimo.h"
 
 #include <KDebug>
 
+#include <Nepomuk/Resource>
+#include <Nepomuk/ResourceManager>
+#include <Nepomuk/Thing>
+
 #include <qtest_kde.h>
 
 StorageTest::StorageTest(QObject *parent)
@@ -360,6 +365,9 @@ void StorageTest::testCreateContact()
     QVERIFY(imAcc1.exists());
     QCOMPARE(imAcc1.isAccessedByOf().size(), 0);
 
+    // Check there is only 1 PIMO Person in Nepomuk.
+    QCOMPARE(Nepomuk::ResourceManager::instance()->allResourcesOfType(Nepomuk::Vocabulary::PIMO::Person()).size(), 1);
+
     // Test 1: Create a contact which doesn't already exist.
     m_storage->createContact(QLatin1String("/foo/bar/baz"),
                              QLatin1String("test at remote-contact.com"));
@@ -391,6 +399,16 @@ void StorageTest::testCreateContact()
     QCOMPARE(pC2.iMAccounts().size(), 1);
     QCOMPARE(pC2.iMAccounts().first(), imAcc2);
 
+    // Check the PIMO Person.
+    QCOMPARE(Nepomuk::ResourceManager::instance()->allResourcesOfType(Nepomuk::Vocabulary::PIMO::Person()).size(), 2);
+
+    foreach (Nepomuk::Resource r, Nepomuk::ResourceManager::instance()->allResourcesOfType(Nepomuk::Vocabulary::PIMO::Person())) {
+        if (r != Nepomuk::Resource("nepomuk:/myself")) {
+            Nepomuk::Thing t(r);
+            QVERIFY(t.groundingOccurrences().contains(pC2));
+        }
+    }
+
     // Test 2: Create a contact which already exists in Nepomuk.
     // Pre-populate Nepomuk with a valid contact
     Nepomuk::IMAccount imAcc3;

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list