bump product version to 5.0.4.1
[LibreOffice.git] / svl / qa / complex / ConfigItems / CheckConfigItems.java
blobc7fb641a83b12199186fcaed8d1b45123b4b3a0c
1 /*
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.
38 public class CheckConfigItems
41 // some const
44 // member
46 /** points to the global uno service manager. */
47 private XMultiServiceFactory m_xSmgr = null;
49 /** implements real config item tests in C++. */
50 private XJob m_xTest = null;
53 // test environment
56 /** @short Create the environment for following tests.
58 * @descr Use either a component loader from desktop or
59 from frame
61 @Before public void before()
62 throws java.lang.Exception
64 // get uno service manager from global test environment
65 m_xSmgr = getMSF();
67 // TODO register helper service
69 // create module manager
70 m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
74 /**
75 * @short close the environment.
77 @After public void after()
78 throws java.lang.Exception
80 // TODO deregister helper service
82 m_xTest = null;
83 m_xSmgr = null;
87 @Test public void checkPicklist()
88 throws java.lang.Exception
90 impl_triggerTest("checkPicklist");
94 @Test public void checkURLHistory()
95 throws java.lang.Exception
97 impl_triggerTest("checkURLHistory");
101 @Test public void checkHelpBookmarks()
102 throws java.lang.Exception
104 impl_triggerTest("checkHelpBookmarks");
108 @Test public void checkAccessibilityOptions()
109 throws java.lang.Exception
111 impl_triggerTest("checkAccessibilityOptions");
115 @Test public void checkUserOptions()
116 throws java.lang.Exception
118 impl_triggerTest("checkUserOptions");
122 /** @todo document me
124 private void impl_triggerTest(String sTest)
125 throws java.lang.Exception
127 NamedValue[] lArgs = new NamedValue[1];
128 lArgs[0] = new NamedValue();
129 lArgs[0].Name = "Test";
130 lArgs[0].Value = sTest;
131 m_xTest.execute(lArgs);
135 private XMultiServiceFactory getMSF()
137 return UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
140 // setup and close connections
141 @BeforeClass public static void setUpConnection() throws Exception {
142 System.out.println("setUpConnection()");
143 connection.setUp();
146 @AfterClass public static void tearDownConnection()
147 throws InterruptedException, com.sun.star.uno.Exception
149 System.out.println("tearDownConnection()");
150 connection.tearDown();
153 private static final OfficeConnection connection = new OfficeConnection();