summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-01 19:30:04 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-01 20:29:19 +0200
commit14c2ab30201d97f733375b4e3e88e5919701be25 (patch)
tree9c8209acfd9c5d347511e79f691e531ae5aec3a1 /chart2
parent84a8f817e174855ef72f0bafc734847690c5d736 (diff)
add export test for charts
Change-Id: I176f7967d37f3032057758d9aaa5f39c46d29c3d
Diffstat (limited to 'chart2')
-rw-r--r--chart2/CppunitTest_chart2_exporttest.mk119
-rw-r--r--chart2/Module_chart2.mk2
-rw-r--r--chart2/qa/extras/chart2export.cxx34
-rw-r--r--chart2/qa/extras/charttest.hxx23
-rw-r--r--chart2/qa/extras/data/ods/simple_export_chart.odsbin0 -> 13269 bytes
5 files changed, 177 insertions, 1 deletions
diff --git a/chart2/CppunitTest_chart2_exporttest.mk b/chart2/CppunitTest_chart2_exporttest.mk
new file mode 100644
index 000000000000..0c0e0253ca29
--- /dev/null
+++ b/chart2/CppunitTest_chart2_exporttest.mk
@@ -0,0 +1,119 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,chart2_export))
+
+$(eval $(call gb_CppunitTest_use_external,chart2_export,boost_headers))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,chart2_export, \
+ chart2/qa/extras/chart2export \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,chart2_export, \
+ avmedia \
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ drawinglayer \
+ editeng \
+ fileacc \
+ for \
+ forui \
+ i18nlangtag \
+ msfilter \
+ oox \
+ sal \
+ salhelper \
+ sax \
+ sb \
+ sc \
+ sfx \
+ sot \
+ svl \
+ svt \
+ svx \
+ svxcore \
+ test \
+ tl \
+ tk \
+ ucbhelper \
+ unotest \
+ utl \
+ vbahelper \
+ vcl \
+ xo \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,chart2_export,\
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,chart2_export,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,chart2_export))
+
+$(eval $(call gb_CppunitTest_use_components,chart2_export,\
+ basic/util/sb \
+ chart2/source/controller/chartcontroller \
+ chart2/source/chartcore \
+ comphelper/util/comphelp \
+ configmgr/source/configmgr \
+ dbaccess/util/dba \
+ embeddedobj/util/embobj \
+ eventattacher/source/evtatt \
+ fileaccess/source/fileacc \
+ filter/source/config/cache/filterconfig1 \
+ forms/util/frm \
+ framework/util/fwk \
+ i18npool/util/i18npool \
+ linguistic/source/lng \
+ oox/util/oox \
+ package/source/xstor/xstor \
+ package/util/package2 \
+ sax/source/expatwrap/expwrap \
+ sax/source/fastparser/fastsax \
+ sc/util/sc \
+ sc/util/scd \
+ sc/util/scfilt \
+ $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \
+ sc/util/vbaobj) \
+ scaddins/source/analysis/analysis \
+ scaddins/source/datefunc/date \
+ scripting/source/basprov/basprov \
+ scripting/util/scriptframe \
+ sfx2/util/sfx \
+ sot/util/sot \
+ svl/source/fsstor/fsstorage \
+ svl/util/svl \
+ svtools/util/svt \
+ svx/util/svx \
+ toolkit/util/tk \
+ ucb/source/core/ucb1 \
+ ucb/source/ucp/file/ucpfile1 \
+ ucb/source/ucp/tdoc/ucptdoc1 \
+ unotools/util/utl \
+ unoxml/source/rdf/unordf \
+ unoxml/source/service/unoxml \
+ xmloff/util/xo \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,chart2_export))
+
+$(eval $(call gb_CppunitTest_use_filter_configuration,chart2_export))
+
+$(eval $(call gb_CppunitTest_use_unittest_configuration,chart2_export))
+
+# vim: set noet sw=4 ts=4:
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index 13e9f3b86570..3dacc4c16a0e 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -17,7 +17,7 @@ $(eval $(call gb_Module_add_targets,chart2,\
))
$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
- CppunitTest_chart2_importtest \
+ CppunitTest_chart2_exporttest \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
new file mode 100644
index 000000000000..d17416f7a27d
--- /dev/null
+++ b/chart2/qa/extras/chart2export.cxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "charttest.hxx"
+
+class Chart2ExportTest : public ChartTest
+{
+public:
+ void test();
+
+ CPPUNIT_TEST_SUITE(Chart2ExportTest);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+};
+
+void Chart2ExportTest::test()
+{
+ load("/chart2/qa/extras/data/ods/", "simple_export_chart.ods");
+ reload("Calc Office Open XML");
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index e4968f1fde01..8fe76e2288ce 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -22,6 +22,10 @@
#include <com/sun/star/table/XTableChart.hpp>
#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#include <unotools/tempfile.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -30,6 +34,8 @@
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+#include <iostream>
+
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -37,6 +43,7 @@ class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
void load( const char* pDir, const char* pName );
+ void reload( const OUString& rFilterName );
virtual void setUp();
virtual void tearDown();
@@ -50,6 +57,22 @@ void ChartTest::load( const char* pDir, const char* pName )
CPPUNIT_ASSERT(mxComponent.is());
}
+void ChartTest::reload(const OUString& rFilterName)
+{
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aArgs(1);
+ aArgs[0].Name = "FilterName";
+ aArgs[0].Value <<= rFilterName;
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ xStorable->storeToURL(aTempFile.GetURL(), aArgs);
+ uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY);
+ xComponent->dispose();
+ mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.sheet.SpreadsheetDocument");
+ std::cout << aTempFile.GetURL();
+ CPPUNIT_ASSERT(mxComponent.is());
+}
+
void ChartTest::setUp()
{
test::BootstrapFixture::setUp();
diff --git a/chart2/qa/extras/data/ods/simple_export_chart.ods b/chart2/qa/extras/data/ods/simple_export_chart.ods
new file mode 100644
index 000000000000..b944c360c1f7
--- /dev/null
+++ b/chart2/qa/extras/data/ods/simple_export_chart.ods
Binary files differ