[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa test/Library_subsequenttest.mk test/source

Jens Carl j.carl43 at gmx.de
Fri Dec 15 00:58:41 UTC 2017


 include/test/sheet/xconsolidatable.hxx                     |   35 +++++++++
 qadevOOo/Jar_OOoRunner.mk                                  |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv |    2 
 qadevOOo/tests/java/ifc/sheet/_XConsolidatable.java        |   47 -------------
 sc/qa/extras/scmodelobj.cxx                                |   18 ++++
 test/Library_subsequenttest.mk                             |    1 
 test/source/sheet/xconsolidatable.cxx                      |   46 ++++++++++++
 7 files changed, 98 insertions(+), 52 deletions(-)

New commits:
commit acc24edf21b99822b6e6d8119eba3ab843458401
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Thu Dec 14 19:31:00 2017 +0000

    tdf#45904 Move _XConsolidatable Java tests to C++
    
    Change-Id: Id851121d424e88d28f0c941d50ab115eba5cea18
    Reviewed-on: https://gerrit.libreoffice.org/46485
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jens Carl <j.carl43 at gmx.de>

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: */


More information about the Libreoffice-commits mailing list