2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package complex
.ConfigItems
;
21 import com
.sun
.star
.beans
.NamedValue
;
22 import com
.sun
.star
.lang
.XMultiServiceFactory
;
23 import com
.sun
.star
.task
.XJob
;
24 import com
.sun
.star
.uno
.UnoRuntime
;
27 import org
.junit
.After
;
28 import org
.junit
.AfterClass
;
29 import org
.junit
.Before
;
30 import org
.junit
.BeforeClass
;
31 import org
.junit
.Test
;
32 import org
.openoffice
.test
.OfficeConnection
;
35 /** @short todo document me
36 * @deprecated this tests seems no longer work as expected.
39 public class CheckConfigItems
47 /** points to the global uno service manager. */
48 private XMultiServiceFactory m_xSmgr
= null;
50 /** implements real config item tests in C++. */
51 private XJob m_xTest
= null;
57 /** @short Create the environment for following tests.
59 * @descr Use either a component loader from desktop or
62 @Before public void before()
63 throws java
.lang
.Exception
65 // get uno service manager from global test environment
68 // TODO register helper service
70 // create module manager
71 m_xTest
= UnoRuntime
.queryInterface(XJob
.class, m_xSmgr
.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
76 * @short close the environment.
78 @After public void after()
79 throws java
.lang
.Exception
81 // TODO deregister helper service
88 @Test public void checkPicklist()
89 throws java
.lang
.Exception
91 impl_triggerTest("checkPicklist");
95 @Test public void checkURLHistory()
96 throws java
.lang
.Exception
98 impl_triggerTest("checkURLHistory");
102 @Test public void checkHelpBookmarks()
103 throws java
.lang
.Exception
105 impl_triggerTest("checkHelpBookmarks");
109 @Test public void checkAccessibilityOptions()
110 throws java
.lang
.Exception
112 impl_triggerTest("checkAccessibilityOptions");
116 @Test public void checkUserOptions()
117 throws java
.lang
.Exception
119 impl_triggerTest("checkUserOptions");
123 /** @todo document me
125 private void impl_triggerTest(String sTest
)
126 throws java
.lang
.Exception
128 NamedValue
[] lArgs
= new NamedValue
[1];
129 lArgs
[0] = new NamedValue();
130 lArgs
[0].Name
= "Test";
131 lArgs
[0].Value
= sTest
;
132 m_xTest
.execute(lArgs
);
136 private XMultiServiceFactory
getMSF()
138 return UnoRuntime
.queryInterface(XMultiServiceFactory
.class, connection
.getComponentContext().getServiceManager());
141 // setup and close connections
142 @BeforeClass public static void setUpConnection() throws Exception
{
143 System
.out
.println("setUpConnection()");
147 @AfterClass public static void tearDownConnection()
148 throws InterruptedException
, com
.sun
.star
.uno
.Exception
150 System
.out
.println("tearDownConnection()");
151 connection
.tearDown();
154 private static final OfficeConnection connection
= new OfficeConnection();