Kaydet (Commit) 472737ad authored tarafından Jens Carl's avatar Jens Carl Kaydeden (comit) Markus Mohrhard

tdf#45904 Move Java XSheetAnnotationShapeSupplier test to C++

Change-Id: I5a3d64fd255fb8fd1f1caba572bc00a5399a6519
Reviewed-on: https://gerrit.libreoffice.org/39550Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst bbfdd034
/* -*- 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: */
......@@ -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 \
......
......@@ -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()"
......
/*
* 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);
}
}
......@@ -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:
......
......@@ -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 \
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment