diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-27 15:32:19 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-28 00:24:48 -0400 |
commit | d0af33e87db753d6d171548f75c2e242cde00497 (patch) | |
tree | ee6bde2d2707378d741c77bf992ee6e41fb05204 /sc | |
parent | 08f4273d7513e92f3dafa40b888467aaaf3c4b9f (diff) |
Initial skeleton for API test on ScEditFieldObj.
ScEditFieldObj was formerly ScCellFieldObj and ScHeaderFieldObj merged
into one.
Change-Id: I600188d7ee22bb7c7c18735f570460ce50083c6a
Diffstat (limited to 'sc')
-rw-r--r-- | sc/CppunitTest_sc_editfieldobj.mk | 134 | ||||
-rw-r--r-- | sc/qa/extras/sceditfieldobj.cxx | 89 |
2 files changed, 223 insertions, 0 deletions
diff --git a/sc/CppunitTest_sc_editfieldobj.mk b/sc/CppunitTest_sc_editfieldobj.mk new file mode 100644 index 000000000000..2e68c1e52f0e --- /dev/null +++ b/sc/CppunitTest_sc_editfieldobj.mk @@ -0,0 +1,134 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Kohei Yoshida <kohei.yoshida@suse.com> +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_editfieldobj)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_editfieldobj, \ + sc/qa/extras/sceditfieldobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_editfieldobj, \ + avmedia \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + drawinglayer \ + editeng \ + fileacc \ + for \ + forui \ + i18nisolang1 \ + msfilter \ + oox \ + sal \ + salhelper \ + sax \ + sb \ + sc \ + sfx \ + sot \ + svl \ + svt \ + svx \ + svxcore \ + test \ + tl \ + tk \ + subsequenttest \ + ucbhelper \ + unotest \ + utl \ + vbahelper \ + vcl \ + xo \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_editfieldobj,\ + -I$(SRCDIR)/sc/source/ui/inc \ + -I$(SRCDIR)/sc/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sc_editfieldobj,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sc_editfieldobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_editfieldobj,\ + basic/util/sb \ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + dbaccess/util/dba \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + forms/util/frm \ + framework/util/fwk \ + i18npool/util/i18npool \ + oox/util/oox \ + package/source/xstor/xstor \ + package/util/package2 \ + sax/source/expatwrap/expwrap \ + sax/source/fastparser/fastsax \ + sc/util/sc \ + sc/util/scd \ + sc/util/scfilt \ + sc/util/vbaobj \ + scripting/source/basprov/basprov \ + scripting/util/scriptframe \ + sfx2/util/sfx \ + sot/util/sot \ + svl/source/fsstor/fsstorage \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + ucb/source/ucp/tdoc/ucptdoc1 \ + unotools/util/utl \ + unoxml/source/rdf/unordf \ + unoxml/source/service/unoxml \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_editfieldobj)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sc_editfieldobj)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sc_editfieldobj,\ + $(OUTDIR)/unittest/registry \ +)) + +# we need to +# - explicitly depend on the sc resource files needed at unit-test runtime +$(call gb_CppunitTest_get_target,sc_editfieldobj) : \ + $(WORKDIR)/AllLangRes/sc \ + +# vim: set noet sw=4 ts=4: diff --git a/sc/qa/extras/sceditfieldobj.cxx b/sc/qa/extras/sceditfieldobj.cxx new file mode 100644 index 000000000000..a065a3fe50cc --- /dev/null +++ b/sc/qa/extras/sceditfieldobj.cxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida@suse.com> + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <test/unoapi_test.hxx> +#include <test/text/xtextfield.hxx> + +#include <com/sun/star/text/XTextField.hpp> + +#define NUMBER_OF_TESTS 1 + +namespace sc_apitest { + +class ScEditFieldObj : public UnoApiTest, apitest::XTextField +{ +public: + ScEditFieldObj(); + + virtual void setUp(); + virtual void tearDown(); + virtual uno::Reference<uno::XInterface> init(); + + CPPUNIT_TEST_SUITE(ScEditFieldObj); + CPPUNIT_TEST(testGetPresentation); + CPPUNIT_TEST_SUITE_END(); + +private: + static sal_Int32 nTest; + static uno::Reference<lang::XComponent> mxComponent; +}; + +sal_Int32 ScEditFieldObj::nTest = 0; +uno::Reference<lang::XComponent> ScEditFieldObj::mxComponent; + +ScEditFieldObj::ScEditFieldObj() {} + +void ScEditFieldObj::setUp() +{ + ++nTest; + UnoApiTest::setUp(); +} + +void ScEditFieldObj::tearDown() +{ + if (nTest == NUMBER_OF_TESTS) + closeDocument(mxComponent); + + UnoApiTest::tearDown(); +} + +uno::Reference<uno::XInterface> ScEditFieldObj::init() +{ + if (!mxComponent.is()) + mxComponent = loadFromDesktop("private:factory/scalc"); + + return mxComponent; +} + +CPPUNIT_TEST_SUITE_REGISTRATION(ScEditFieldObj); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |