Kaydet (Commit) 8e12e517 authored tarafından Rahul Gurung's avatar Rahul Gurung Kaydeden (comit) Markus Mohrhard

tdf#45904 Move _XChild Java tests to C++

Change-Id: Idaf883eadb95792bdb333dea487be084b1722194
Reviewed-on: https://gerrit.libreoffice.org/60146
Tested-by: Jenkins
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 2789bbfd
/* -*- 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_TABLE_XCHILD_HXX
#define INCLUDED_TEST_TABLE_XCHILD_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 XChild
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testGetSetParent();
protected:
~XChild() {}
};
}
#endif // INCLUDED_TEST_TABLE_XCHILD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -7,5 +7,3 @@
"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::container::XChild";"getParent()"
"ScAnnotationObj";"com::sun::star::container::XChild";"setParent()"
......@@ -8,6 +8,7 @@
*/
#include <test/calc_unoapi_test.hxx>
#include <test/container/xchild.hxx>
#include <test/sheet/xsheetannotation.hxx>
#include <test/sheet/xsheetannotationshapesupplier.hxx>
......@@ -26,7 +27,9 @@ using namespace css::uno;
namespace sc_apitest {
class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation, public apitest::XSheetAnnotationShapeSupplier
class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation,
public apitest::XSheetAnnotationShapeSupplier,
public apitest::XChild
{
public:
ScAnnontationObj();
......@@ -39,6 +42,9 @@ public:
CPPUNIT_TEST_SUITE(ScAnnontationObj);
// XChild
CPPUNIT_TEST(testGetSetParent);
// XSheetAnnotation
CPPUNIT_TEST(testGetPosition);
CPPUNIT_TEST(testGetAuthor);
......
......@@ -41,6 +41,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/unoapi_test \
test/source/calc_unoapi_test \
test/source/beans/xpropertyset \
test/source/container/xchild \
test/source/container/xelementaccess \
test/source/container/xindexaccess \
test/source/container/xnamecontainer \
......
/* -*- 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/cppunitasserthelper.hxx>
#include <test/container/xchild.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace com::sun::star;
using namespace com::sun::star::uno;
namespace apitest
{
void XChild::testGetSetParent()
{
uno::Reference<container::XChild> xChild(init(), UNO_QUERY_THROW);
uno::Reference<uno::XInterface> xInterface(xChild, UNO_QUERY_THROW);
xInterface = xChild->getParent();
CPPUNIT_ASSERT_MESSAGE("Successfully able to Get Parent", xInterface);
xChild->setParent(xInterface);
CPPUNIT_ASSERT_MESSAGE("Successfully able to Set Parent", xChild);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
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