[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
Sat Jul 8 10:41:16 UTC 2017


 include/test/sheet/xsheetannotationshapesupplier.hxx              |   35 ++++++++
 qadevOOo/Jar_OOoRunner.mk                                         |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv   |    1 
 qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationShapeSupplier.java |   34 --------
 sc/qa/extras/scannotationobj.cxx                                  |   12 ++
 test/Library_subsequenttest.mk                                    |    1 
 test/source/sheet/xsheetannotationshapesupplier.cxx               |   41 ++++++++++
 7 files changed, 87 insertions(+), 38 deletions(-)

New commits:
commit 472737ad70f1a3eaa22cab9b746d35e4b94094a0
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Wed Jul 5 06:17:49 2017 +0000

    tdf#45904 Move Java XSheetAnnotationShapeSupplier test to C++
    
    Change-Id: I5a3d64fd255fb8fd1f1caba572bc00a5399a6519
    Reviewed-on: https://gerrit.libreoffice.org/39550
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/test/sheet/xsheetannotationshapesupplier.hxx b/include/test/sheet/xsheetannotationshapesupplier.hxx
new file mode 100644
index 000000000000..ff569df07f56
--- /dev/null
+++ b/include/test/sheet/xsheetannotationshapesupplier.hxx
@@ -0,0 +1,35 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDE_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX
+#define INCLUDE_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSheetAnnotationShapeSupplier
+{
+public:
+    virtual uno::Reference< uno::XInterface > init() = 0;
+    virtual ~XSheetAnnotationShapeSupplier(){}
+
+    void testGetAnnotationShape();
+};
+
+}
+
+#endif // INCLUDE_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 458ebf1b7cf9..ab9a8c3e2fba 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -632,7 +632,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
     qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation \
     qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor \
     qadevOOo/tests/java/ifc/sheet/_XSheetAnnotations \
-    qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationShapeSupplier \
     qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationsSupplier \
     qadevOOo/tests/java/ifc/sheet/_XSheetAuditing \
     qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
index 7821167a6d1a..fba2a0877540 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
@@ -7,7 +7,6 @@
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"getEnd()"
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"getString()"
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"setString()"
-"ScAnnotationObj";"com::sun::star::sheet::XSheetAnnotationShapeSupplier#optional";"getAnnotationShape()"
 "ScAnnotationObj";"com::sun::star::sheet::XSheetAnnotation";"getPosition()"
 "ScAnnotationObj";"com::sun::star::sheet::XSheetAnnotation";"getAuthor()"
 "ScAnnotationObj";"com::sun::star::sheet::XSheetAnnotation";"getDate()"
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationShapeSupplier.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationShapeSupplier.java
deleted file mode 100644
index 136cf865f518..000000000000
--- a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationShapeSupplier.java
+++ /dev/null
@@ -1,34 +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.drawing.XShape;
-import com.sun.star.sheet.XSheetAnnotationShapeSupplier;
-import lib.MultiMethodTest;
-
-public class _XSheetAnnotationShapeSupplier extends MultiMethodTest
-{
-    public XSheetAnnotationShapeSupplier oObj = null;
-
-    public void _getAnnotationShape() {
-        XShape xShape = oObj.getAnnotationShape ();
-        tRes.tested ("getAnnotationShape()",xShape!=null);
-    }
-
-}
diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx
index 4b4b048dfb0c..1120974d71b4 100644
--- a/sc/qa/extras/scannotationobj.cxx
+++ b/sc/qa/extras/scannotationobj.cxx
@@ -9,7 +9,9 @@
 
 #include <test/calc_unoapi_test.hxx>
 #include <test/sheet/xsheetannotation.hxx>
+#include <test/sheet/xsheetannotationshapesupplier.hxx>
 
+#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -24,9 +26,9 @@ using namespace css::uno;
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 5
+#define NUMBER_OF_TESTS 6
 
-class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation
+class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation, public apitest::XSheetAnnotationShapeSupplier
 {
 public:
     ScAnnontationObj();
@@ -38,11 +40,17 @@ public:
     virtual uno::Reference< sheet::XSheetAnnotation> getAnnotation(table::CellAddress&) override;
 
     CPPUNIT_TEST_SUITE(ScAnnontationObj);
+
+    // XSheetAnnotation
     CPPUNIT_TEST(testGetPosition);
     CPPUNIT_TEST(testGetAuthor);
     CPPUNIT_TEST(testGetDate);
     CPPUNIT_TEST(testGetIsVisible);
     CPPUNIT_TEST(testSetIsVisible);
+
+    // XSheetAnnotationShapeSupplier
+    CPPUNIT_TEST(testGetAnnotationShape);
+
     CPPUNIT_TEST_SUITE_END();
 private:
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 1f68fd395ba5..fb0e3f42000d 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -62,6 +62,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
     test/source/sheet/xspreadsheets2 \
     test/source/sheet/xsheetannotation \
     test/source/sheet/xsheetannotations \
+    test/source/sheet/xsheetannotationshapesupplier \
     test/source/sheet/xsheetoutline \
     test/source/sheet/xstyleloader \
     test/source/sheet/xviewpane \
diff --git a/test/source/sheet/xsheetannotationshapesupplier.cxx b/test/source/sheet/xsheetannotationshapesupplier.cxx
new file mode 100644
index 000000000000..c5baa9aadca8
--- /dev/null
+++ b/test/source/sheet/xsheetannotationshapesupplier.cxx
@@ -0,0 +1,41 @@
+/* -*- 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 <test/sheet/xsheetannotationshapesupplier.hxx>
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
+
+#include "cppunit/extensions/HelperMacros.h"
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+
+namespace apitest {
+
+void XSheetAnnotationShapeSupplier::testGetAnnotationShape()
+{
+    uno::Reference< sheet::XSheetAnnotationShapeSupplier > xSheetAnnotationShapeSupplier(init(), UNO_QUERY_THROW);
+    uno::Reference< drawing::XShape > xShape = xSheetAnnotationShapeSupplier->getAnnotationShape();
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong X position",
+                                 sal_Int32(7373), xShape->getPosition().X);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong Y position",
+                                 sal_Int32(426), xShape->getPosition().Y);
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong width",
+                                 sal_Int32(11275), xShape->getSize().Width);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong height",
+                                 sal_Int32(1386), xShape->getSize().Height);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list