Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include <test/unoapi_test.hxx>
11 : #include <test/sheet/xgoalseek.hxx>
12 :
13 : using namespace css;
14 : using namespace css::uno;
15 :
16 : namespace sc_apitest {
17 :
18 : #define NUMBER_OF_TESTS 1
19 :
20 2 : class ScModelObj : public UnoApiTest, apitest::XGoalSeek
21 : {
22 : public:
23 : virtual void setUp() SAL_OVERRIDE;
24 : virtual void tearDown() SAL_OVERRIDE;
25 :
26 : virtual uno::Reference< uno::XInterface > init() SAL_OVERRIDE;
27 :
28 : ScModelObj();
29 :
30 2 : CPPUNIT_TEST_SUITE(ScModelObj);
31 1 : CPPUNIT_TEST(testSeekGoal);
32 5 : CPPUNIT_TEST_SUITE_END();
33 :
34 : private:
35 : static sal_Int32 nTest;
36 : static uno::Reference< lang::XComponent > mxComponent;
37 : };
38 :
39 1 : ScModelObj::ScModelObj()
40 1 : : UnoApiTest("/sc/qa/extras/testdocuments")
41 : {
42 1 : }
43 :
44 : sal_Int32 ScModelObj::nTest = 0;
45 1 : uno::Reference< lang::XComponent > ScModelObj::mxComponent;
46 :
47 1 : uno::Reference< uno::XInterface > ScModelObj::init()
48 : {
49 1 : OUString aFileURL;
50 1 : createFileURL(OUString("ScModelObj.ods"), aFileURL);
51 1 : if(!mxComponent.is())
52 1 : mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
53 1 : CPPUNIT_ASSERT(mxComponent.is());
54 :
55 1 : return mxComponent;
56 : }
57 :
58 1 : void ScModelObj::setUp()
59 : {
60 1 : nTest++;
61 1 : UnoApiTest::setUp();
62 1 : }
63 :
64 1 : void ScModelObj::tearDown()
65 : {
66 1 : if (nTest == NUMBER_OF_TESTS)
67 : {
68 1 : closeDocument(mxComponent);
69 1 : mxComponent.clear();
70 : }
71 :
72 1 : UnoApiTest::tearDown();
73 1 : }
74 :
75 1 : CPPUNIT_TEST_SUITE_REGISTRATION(ScModelObj);
76 :
77 : }
78 :
79 4 : CPPUNIT_PLUGIN_IMPLEMENT();
80 :
81 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|