summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-12-14 19:31:00 +0000
committerJens Carl <j.carl43@gmx.de>2017-12-15 01:55:26 +0100
commitacc24edf21b99822b6e6d8119eba3ab843458401 (patch)
tree811962669f9687b6476be9842a42e2ace9dd7813
parentaac4e447c3fb276a85c475f86d3469b8e34eeb5a (diff)
tdf#45904 Move _XConsolidatable Java tests to C++
Change-Id: Id851121d424e88d28f0c941d50ab115eba5cea18 Reviewed-on: https://gerrit.libreoffice.org/46485 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
-rw-r--r--include/test/sheet/xconsolidatable.hxx35
-rw-r--r--qadevOOo/Jar_OOoRunner.mk1
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv2
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XConsolidatable.java47
-rw-r--r--sc/qa/extras/scmodelobj.cxx18
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xconsolidatable.cxx46
7 files changed, 98 insertions, 52 deletions
diff --git a/include/test/sheet/xconsolidatable.hxx b/include/test/sheet/xconsolidatable.hxx
new file mode 100644
index 000000000000..9edb591089ba
--- /dev/null
+++ b/include/test/sheet/xconsolidatable.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX
+#define INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <test/testdllapi.hxx>
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XConsolidatable
+{
+public:
+ virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+ void testCreateConsolidationDescriptor();
+ void testConsolidate();
+
+protected:
+ ~XConsolidatable() {}
+};
+}
+
+#endif // INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 4e378ebc4b0e..6f07cb3ab936 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -593,7 +593,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement \
qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer \
qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery \
- qadevOOo/tests/java/ifc/sheet/_XConsolidatable \
qadevOOo/tests/java/ifc/sheet/_XDDELink \
qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing \
qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv
index b77e34c1984a..69b54496331b 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv
@@ -30,8 +30,6 @@
"ScModelObj";"com::sun::star::frame::XStorable";"store()"
"ScModelObj";"com::sun::star::frame::XStorable";"storeAsURL()"
"ScModelObj";"com::sun::star::frame::XStorable";"storeToURL()"
-"ScModelObj";"com::sun::star::sheet::XConsolidatable";"createConsolidationDescriptor()"
-"ScModelObj";"com::sun::star::sheet::XConsolidatable";"consolidate()"
"ScModelObj";"com::sun::star::document::XEventsSupplier#optional";"getEvents()"
"ScModelObj";"com::sun::star::util::XModifiable";"isModified()"
"ScModelObj";"com::sun::star::util::XModifiable";"setModified()"
diff --git a/qadevOOo/tests/java/ifc/sheet/_XConsolidatable.java b/qadevOOo/tests/java/ifc/sheet/_XConsolidatable.java
deleted file mode 100644
index cde8a8f12921..000000000000
--- a/qadevOOo/tests/java/ifc/sheet/_XConsolidatable.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-package ifc.sheet;
-
-import com.sun.star.sheet.XConsolidatable;
-import com.sun.star.sheet.XConsolidationDescriptor;
-import lib.MultiMethodTest;
-
-/**
- * Test the XConsolidatable interface
- */
-public class _XConsolidatable extends MultiMethodTest {
- public XConsolidatable oObj = null;
- XConsolidationDescriptor xDescriptor = null;
-
- /**
- * Check consolidation
- */
- public void _consolidate() {
- requiredMethod("createConsolidationDescriptor()");
- oObj.consolidate(xDescriptor);
- tRes.tested("consolidate()", true);
- }
-
- /**
- * Check the creation of a ConsolidationDescriptor
- */
- public void _createConsolidationDescriptor() {
- xDescriptor = oObj.createConsolidationDescriptor(true);
- tRes.tested("createConsolidationDescriptor()", xDescriptor != null);
- }
-}
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
index 8c9c9e918cf6..418a23e98e09 100644
--- a/sc/qa/extras/scmodelobj.cxx
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -8,16 +8,23 @@
*/
#include <test/unoapi_test.hxx>
+#include <test/sheet/xconsolidatable.hxx>
#include <test/sheet/xgoalseek.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
using namespace css;
using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 1
+#define NUMBER_OF_TESTS 3
-class ScModelObj : public UnoApiTest, public apitest::XGoalSeek
+class ScModelObj : public UnoApiTest, public apitest::XConsolidatable,
+ public apitest::XGoalSeek
{
public:
virtual void setUp() override;
@@ -28,7 +35,14 @@ public:
ScModelObj();
CPPUNIT_TEST_SUITE(ScModelObj);
+
+ // XConsolidatable
+ CPPUNIT_TEST(testCreateConsolidationDescriptor);
+ CPPUNIT_TEST(testConsolidate);
+
+ // XGoalSeek
CPPUNIT_TEST(testSeekGoal);
+
CPPUNIT_TEST_SUITE_END();
private:
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 544b9def3942..1d2fab702738 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -54,6 +54,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xcellrangereferrer \
test/source/sheet/xcellrangesquery \
test/source/sheet/xcellseries \
+ test/source/sheet/xconsolidatable \
test/source/sheet/xconsolidationdescriptor \
test/source/sheet/xgoalseek \
test/source/sheet/xdatabaserange \
diff --git a/test/source/sheet/xconsolidatable.cxx b/test/source/sheet/xconsolidatable.cxx
new file mode 100644
index 000000000000..f5616e78c43e
--- /dev/null
+++ b/test/source/sheet/xconsolidatable.cxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <test/sheet/xconsolidatable.hxx>
+
+#include <com/sun/star/sheet/GeneralFunction.hpp>
+#include <com/sun/star/sheet/XConsolidatable.hpp>
+#include <com/sun/star/sheet/XConsolidationDescriptor.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XConsolidatable::testCreateConsolidationDescriptor()
+{
+ uno::Reference<sheet::XConsolidatable> xConsolidatable(init(), UNO_QUERY_THROW);
+
+ uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
+ xConsolidatable->createConsolidationDescriptor(true), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_MESSAGE("Unable to create ConsolidationDescriptor",
+ xConsolidationDescriptor.is());
+}
+
+void XConsolidatable::testConsolidate()
+{
+ uno::Reference<sheet::XConsolidatable> xConsolidatable(init(), UNO_QUERY_THROW);
+
+ uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
+ xConsolidatable->createConsolidationDescriptor(true), UNO_QUERY_THROW);
+
+ xConsolidatable->consolidate(xConsolidationDescriptor);
+ CPPUNIT_ASSERT_MESSAGE("consolidate()", true);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */