summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-19 15:10:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-19 15:59:42 +0200
commitd9b0108e3af7244179bcc7b07db9d0826c3ac8a6 (patch)
tree3728194e8b44fcb86551d0d98f17b0b7b2ec7b6a /sw
parent08d7d972f64f08f658440dceb12c4ffa845425bc (diff)
sw mailmerge: add writer data source testcase
Fails with commit 83b43ef2223b66484e0e90e7b614886e06f955b5 (sw mail merge: add support for the new 'writer' connectivity driver, 2017-07-18) reverted. Change-Id: I675e15bdbc655a34cca3de2b5d070167ca69cac8 Reviewed-on: https://gerrit.libreoffice.org/40174 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_mailmerge.mk1
-rw-r--r--sw/qa/extras/mailmerge/data/10-testing-addresses-writer.odtbin0 -> 12849 bytes
-rw-r--r--sw/qa/extras/mailmerge/data/writer-mail-merge.odtbin0 -> 8410 bytes
-rw-r--r--sw/qa/extras/mailmerge/mailmerge.cxx14
4 files changed, 15 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_mailmerge.mk b/sw/CppunitTest_sw_mailmerge.mk
index 8d798c1788a4..336b235a7df1 100644
--- a/sw/CppunitTest_sw_mailmerge.mk
+++ b/sw/CppunitTest_sw_mailmerge.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_mailmerge, \
configmgr/source/configmgr \
connectivity/source/cpool/dbpool2 \
connectivity/source/drivers/calc/calc \
+ connectivity/source/drivers/writer/writer \
connectivity/source/manager/sdbc2 \
dbaccess/source/filter/xml/dbaxml \
dbaccess/util/dba \
diff --git a/sw/qa/extras/mailmerge/data/10-testing-addresses-writer.odt b/sw/qa/extras/mailmerge/data/10-testing-addresses-writer.odt
new file mode 100644
index 000000000000..40b61eda3bbb
--- /dev/null
+++ b/sw/qa/extras/mailmerge/data/10-testing-addresses-writer.odt
Binary files differ
diff --git a/sw/qa/extras/mailmerge/data/writer-mail-merge.odt b/sw/qa/extras/mailmerge/data/writer-mail-merge.odt
new file mode 100644
index 000000000000..f3d42f6b4781
--- /dev/null
+++ b/sw/qa/extras/mailmerge/data/writer-mail-merge.odt
Binary files differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index e97edbd11306..60b5c0bd9011 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -426,6 +426,20 @@ DECLARE_FILE_MAILMERGE_TEST(testSimpleMailMerge, "simple-mail-merge.odt", "10-te
}
}
+DECLARE_FILE_MAILMERGE_TEST(testWriterDataSource, "writer-mail-merge.odt", "10-testing-addresses-writer.odt", "testing-addresses-writer")
+{
+ // This failed as the .odt data source was mapped to the jdbc: protocol.
+ executeMailMerge();
+ for (int doc = 0; doc < 10; ++doc)
+ {
+ loadMailMergeDocument(doc);
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ CPPUNIT_ASSERT_EQUAL(OUString("Fixed text."), getRun(getParagraph(1), 1)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("lastname" + OUString::number(doc + 1)), getRun(getParagraph(2), 1)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("Another fixed text."), getRun(getParagraph(3), 1)->getString());
+ }
+}
+
DECLARE_FILE_MAILMERGE_TEST(test2Pages, "simple-mail-merge-2pages.odt", "10-testing-addresses.ods", "testing-addresses")
{
executeMailMerge();