[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
Wed Nov 15 17:47:41 UTC 2017


 include/test/sheet/xscenariossupplier.hxx                       |   34 +++++++
 qadevOOo/Jar_OOoRunner.mk                                       |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv |    1 
 qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java          |   47 ----------
 sc/qa/extras/sctablesheetobj.cxx                                |   11 +-
 test/Library_subsequenttest.mk                                  |    1 
 test/source/sheet/xscenariossupplier.cxx                        |   32 ++++++
 7 files changed, 75 insertions(+), 52 deletions(-)

New commits:
commit 9ccd22820d6b57393b59fe0f70b29dce71eade48
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Wed Nov 15 07:05:22 2017 +0000

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

diff --git a/include/test/sheet/xscenariossupplier.hxx b/include/test/sheet/xscenariossupplier.hxx
new file mode 100644
index 000000000000..e4a6eea11f17
--- /dev/null
+++ b/include/test/sheet/xscenariossupplier.hxx
@@ -0,0 +1,34 @@
+/* -*- 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_XSCENARIOSSUPPLIER_HXX
+#define INCLUDED_TEST_SHEET_XSCENARIOSSUPPLIER_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 XScenariosSupplier
+{
+public:
+    virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+    void testGetScenarios();
+
+protected:
+    ~XScenariosSupplier() {}
+};
+}
+
+#endif // INCLUDED_TEST_SHEET_XSCENARIOSSUPPLIER_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 f239a22e9cfd..229bef198f03 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -610,7 +610,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
     qadevOOo/tests/java/ifc/sheet/_XRecentFunctions \
     qadevOOo/tests/java/ifc/sheet/_XScenario \
     qadevOOo/tests/java/ifc/sheet/_XScenarioEnhanced \
-    qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier \
     qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor \
     qadevOOo/tests/java/ifc/sheet/_XSheetAuditing \
     qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
index d43bdf798988..9c5a9b9fe29f 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
@@ -42,7 +42,6 @@
 "ScTableSheetObj";"com::sun::star::style::CharacterPropertiesAsian";"ParaIsForbiddenRules"
 "ScTableSheetObj";"com::sun::star::style::CharacterPropertiesAsian";"ParaIsHangingPunctuation"
 "ScTableSheetObj";"com::sun::star::sheet::XCellRangeAddressable";"getRangeAddress()"
-"ScTableSheetObj";"com::sun::star::sheet::XScenariosSupplier";"getScenarios()"
 "ScTableSheetObj";"com::sun::star::util::XReplaceable";"createReplaceDescriptor()"
 "ScTableSheetObj";"com::sun::star::util::XReplaceable";"replaceAll()"
 "ScTableSheetObj";"com::sun::star::chart::XChartData";"addChartDataChangeEventListener()"
diff --git a/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java b/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java
deleted file mode 100644
index eb112c7efaa7..000000000000
--- a/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.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 lib.MultiMethodTest;
-
-import com.sun.star.sheet.XScenarios;
-import com.sun.star.sheet.XScenariosSupplier;
-
-/**
-* Testing <code>com.sun.star.sheet.XSheetAnnotationsSupplier</code>
-* interface methods :
-* <ul>
-*  <li><code> getAnnotations()</code></li>
-* </ul> <p>
-* @see com.sun.star.sheet.XSheetAnnotationsSupplier
-*/
-public class _XScenariosSupplier extends MultiMethodTest {
-    public XScenariosSupplier oObj = null;
-
-    /**
-    * Test calls the method and checks returned value. <p>
-    * Has <b> OK </b> status if returned value isn't null. <p>
-    */
-    public void _getScenarios(){
-        XScenarios oSc = oObj.getScenarios();
-        tRes.tested("getScenarios()", oSc != null);
-    }
-
-} // EOC _XScenariosSupplier
-
diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index 64decbb96675..2217b70b4cd8 100644
--- a/sc/qa/extras/sctablesheetobj.cxx
+++ b/sc/qa/extras/sctablesheetobj.cxx
@@ -10,6 +10,7 @@
 #include <test/calc_unoapi_test.hxx>
 #include <test/sheet/xcellseries.hxx>
 #include <test/sheet/xprintareas.hxx>
+#include <test/sheet/xscenariossupplier.hxx>
 #include <test/sheet/xsheetannotationssupplier.hxx>
 #include <test/sheet/xsheetcellrange.hxx>
 #include <test/sheet/xsheetfilterable.hxx>
@@ -32,11 +33,12 @@ using namespace css::uno;
 namespace sc_apitest
 {
 
-#define NUMBER_OF_TESTS 24
+#define NUMBER_OF_TESTS 25
 
 class ScTableSheetObj : public CalcUnoApiTest, public apitest::XCellSeries,
                                                public apitest::XPrintAreas,
                                                public apitest::XReplaceable,
+                                               public apitest::XScenariosSupplier,
                                                public apitest::XSearchable,
                                                public apitest::XSheetAnnotationsSupplier,
                                                public apitest::XSheetCellRange,
@@ -74,14 +76,17 @@ public:
     CPPUNIT_TEST(testReplaceAll);
     CPPUNIT_TEST(testCreateReplaceDescriptor);
 
-    // XSheetAnnotationsSupplier
-    CPPUNIT_TEST(testGetAnnotations);
+    // XScenariosSupplier
+    CPPUNIT_TEST(testGetScenarios);
 
     // XSearchable
     CPPUNIT_TEST(testFindAll);
     CPPUNIT_TEST(testFindNext);
     CPPUNIT_TEST(testFindFirst);
 
+    // XSheetAnnotationsSupplier
+    CPPUNIT_TEST(testGetAnnotations);
+
     // XSheetCellRange
     CPPUNIT_TEST(testGetSpreadsheet);
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index dbdac2a4ca06..531dfa35dc47 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
 	test/source/sheet/xnamedranges \
 	test/source/sheet/xprintareas \
 	test/source/sheet/xscenarios \
+	test/source/sheet/xscenariossupplier \
 	test/source/sheet/xspreadsheetdocument \
 	test/source/sheet/xspreadsheet \
 	test/source/sheet/xspreadsheets \
diff --git a/test/source/sheet/xscenariossupplier.cxx b/test/source/sheet/xscenariossupplier.cxx
new file mode 100644
index 000000000000..c9819d5e8389
--- /dev/null
+++ b/test/source/sheet/xscenariossupplier.cxx
@@ -0,0 +1,32 @@
+/* -*- 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/xscenariossupplier.hxx>
+
+#include <com/sun/star/sheet/XScenarios.hpp>
+#include <com/sun/star/sheet/XScenariosSupplier.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XScenariosSupplier::testGetScenarios()
+{
+    uno::Reference<sheet::XScenariosSupplier> xSupplier(init(), UNO_QUERY_THROW);
+
+    uno::Reference<sheet::XScenarios> xScenarios(xSupplier->getScenarios(), UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_MESSAGE("Unable to get XScenarios", xScenarios.is());
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list