[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [sink/develop] /: Dummyresource mailtest
From:       Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date:       2016-06-30 19:49:33
Message-ID: E1bIhxt-0005c3-5T () code ! kde ! org
[Download RAW message or body]

Git commit b86ffa5a6e7884fb7a25fa84358de3caaeff11e8 by Christian Mollekopf.
Committed on 26/06/2016 at 12:47.
Pushed by cmollekopf into branch 'develop'.

Dummyresource mailtest

M  +12   -0    common/domain/applicationdomaintype.cpp
M  +3    -0    common/domain/applicationdomaintype.h
M  +2    -1    examples/dummyresource/resourcefactory.cpp
M  +1    -0    tests/CMakeLists.txt
A  +29   -0    tests/dummyresourcemailtest.cpp     [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.


http://commits.kde.org/akonadi-next/b86ffa5a6e7884fb7a25fa84358de3caaeff11e8

diff --git a/common/domain/applicationdomaintype.cpp \
b/common/domain/applicationdomaintype.cpp index d1faf25..44eeb13 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -247,6 +247,18 @@ Identity::~Identity()
 
 }
 
+namespace DummyResource {
+    SinkResource create(const QByteArray &account)
+    {
+        auto &&resource = ApplicationDomainType::createEntity<SinkResource>();
+        resource.setProperty("type", "org.kde.dummy");
+        resource.setProperty("account", account);
+        resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << \
ResourceCapabilities::Mail::storage << "-folder.rename")); +        // \
resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << \
ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << \
"-folder.rename" << ResourceCapabilities::Mail::trash)); +        return resource;
+    }
+}
+
 namespace MaildirResource {
     SinkResource create(const QByteArray &account)
     {
diff --git a/common/domain/applicationdomaintype.h \
b/common/domain/applicationdomaintype.h index 928ea58..849c3e2 100644
--- a/common/domain/applicationdomaintype.h
+++ b/common/domain/applicationdomaintype.h
@@ -244,6 +244,9 @@ struct SINK_EXPORT Identity : public ApplicationDomainType {
     virtual ~Identity();
 };
 
+namespace DummyResource {
+    SinkResource SINK_EXPORT create(const QByteArray &account);
+};
 namespace MaildirResource {
     SinkResource SINK_EXPORT create(const QByteArray &account);
 };
diff --git a/examples/dummyresource/resourcefactory.cpp \
b/examples/dummyresource/resourcefactory.cpp index a443581..2bd52cc 100644
--- a/examples/dummyresource/resourcefactory.cpp
+++ b/examples/dummyresource/resourcefactory.cpp
@@ -37,6 +37,7 @@
 #include "indexupdater.h"
 #include "adaptorfactoryregistry.h"
 #include "synchronizer.h"
+#include "mailpreprocessor.h"
 #include "remoteidmap.h"
 #include <QDate>
 #include <QUuid>
@@ -131,7 +132,7 @@ DummyResource::DummyResource(const QByteArray \
                &instanceIdentifier, const QShared
     setupSynchronizer(QSharedPointer<DummySynchronizer>::create(PLUGIN_NAME, \
                instanceIdentifier));
     setupChangereplay(QSharedPointer<Sink::NullChangeReplay>::create(instanceIdentifier));
  setupPreprocessors(ENTITY_TYPE_MAIL,
-            QVector<Sink::Preprocessor*>() << new \
DefaultIndexUpdater<Sink::ApplicationDomain::Mail>); +            \
QVector<Sink::Preprocessor*>() << new MailPropertyExtractor <<  new \
DefaultIndexUpdater<Sink::ApplicationDomain::Mail>);  \
                setupPreprocessors(ENTITY_TYPE_FOLDER,
             QVector<Sink::Preprocessor*>() << new \
DefaultIndexUpdater<Sink::ApplicationDomain::Folder>);  \
                setupPreprocessors(ENTITY_TYPE_EVENT,
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 0d45f3a..294cce2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -46,6 +46,7 @@ auto_tests (
     inspectiontest
     accountstest
     testaccounttest
+    dummyresourcemailtest
 )
 generate_flatbuffers(dummyresourcetest calendar)
 target_link_libraries(dummyresourcetest sink_resource_dummy)
diff --git a/tests/dummyresourcemailtest.cpp b/tests/dummyresourcemailtest.cpp
new file mode 100644
index 0000000..2de2902
--- /dev/null
+++ b/tests/dummyresourcemailtest.cpp
@@ -0,0 +1,29 @@
+#include <QtTest>
+
+#include <tests/mailtest.h>
+
+#include "common/test.h"
+#include "common/domain/applicationdomaintype.h"
+
+using namespace Sink;
+using namespace Sink::ApplicationDomain;
+
+class DummyMailTest : public Sink::MailTest
+{
+    Q_OBJECT
+
+protected:
+    void resetTestEnvironment() Q_DECL_OVERRIDE
+    {
+    }
+
+    Sink::ApplicationDomain::SinkResource createResource() Q_DECL_OVERRIDE
+    {
+        auto resource = ApplicationDomain::DummyResource::create("account1");
+        return resource;
+    }
+};
+
+QTEST_MAIN(DummyMailTest)
+
+#include "dummyresourcemailtest.moc"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic