summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-10-18 13:36:09 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-10-18 13:36:09 (GMT)
commitc0ddadb5da7a5c64ca0381998020162c6237d873 (patch)
treea98735a96d4e3038f935cb5b08eadc0c5d85694c
parentfd348713860576b76584022de425414276326756 (diff)
downloadkolab-utils-c0ddadb5da7a5c64ca0381998020162c6237d873.tar.gz
Make some basic checks on the generated ifb file.
-rw-r--r--fbdaemon/tests/fbaggregatortest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/fbdaemon/tests/fbaggregatortest.cpp b/fbdaemon/tests/fbaggregatortest.cpp
index 82dbe6b..6fe3797 100644
--- a/fbdaemon/tests/fbaggregatortest.cpp
+++ b/fbdaemon/tests/fbaggregatortest.cpp
@@ -22,6 +22,8 @@
#include <kolabobject.h>
#include <freebusy.h>
#include <kcalconversion.h>
+#include <kcalcore/memorycalendar.h>
+#include <kcalcore/icalformat.h>
#include "fbdaemon/fbgeneratorjob.h"
#include "settings.h"
#include <fbaggregatorjob.h>
@@ -98,6 +100,19 @@ private:
void checkFbObject()
{
QVERIFY(QFileInfo(generatedFile).exists());
+ QFile file(generatedFile);
+ QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text));
+ QTextStream in(&file);
+ QString data = in.readAll();
+
+ qDebug() << data;
+
+ KCalCore::ICalFormat format;
+ KCalCore::Calendar::Ptr cal(new KCalCore::MemoryCalendar(KDateTime::Spec::UTC()));
+ KCalCore::ScheduleMessage::Ptr msg = format.parseScheduleMessage(cal, data);
+ QVERIFY(msg);
+ QCOMPARE(msg->method(), KCalCore::iTIPPublish);
+ QCOMPARE(format.timeSpec(), KDateTime::Spec::UTC());
//Check that aggregated fb object has been created
}