bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / tests / java / ifc / ui / _XUIConfiguration.java
blobcae741cec0993c7ae4e128b914f56f14d824600e
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 ifc.ui;
21 import com.sun.star.ui.XUIConfiguration;
22 import com.sun.star.ui.XUIConfigurationListener;
23 import lib.MultiMethodTest;
25 /**
26 * Testing <code>com.sun.star.ui.XUIConfiguration</code>
27 * interface methods :
28 * <ul>
29 * <li><code> addConfigurationListener()</code></li>
30 * <li><code> removeConfigurationListener()</code></li>
31 * </ul> <p>
32 * Test is <b> NOT </b> multithread compilant. <p>
33 * After test completion object environment has to be recreated.
34 * @see com.sun.star.ui.XUIConfiguration
37 public class _XUIConfiguration extends MultiMethodTest {
39 public XUIConfiguration oObj;
40 XUIConfigurationListenerImpl xListener = null;
42 /**
43 * Interface for the Listener of the object relation
44 * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
45 * @see com.sun.star.ui.XUIConfigurationListener
47 public static interface XUIConfigurationListenerImpl
48 extends XUIConfigurationListener {
49 public void reset();
50 public void fireEvent();
51 public boolean actionWasTriggered();
55 /**
56 * try to get a listener out of the object relation
57 * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
59 public void before() {
60 xListener = (XUIConfigurationListenerImpl)tEnv.getObjRelation(
61 "XUIConfiguration.XUIConfigurationListenerImpl");
64 /**
65 * adds a listener an fire an event
66 * Has <B>OK</B> status if listener was called
68 public void _addConfigurationListener() {
69 oObj.addConfigurationListener(xListener);
70 xListener.fireEvent();
71 tRes.tested("addConfigurationListener()", xListener.actionWasTriggered());
74 /**
75 * removes the listener and calls an event.
76 * Has <B>OK</B> status if listener is not called.
78 public void _removeConfigurationListener() {
79 requiredMethod("addConfigurationListener()");
80 oObj.removeConfigurationListener(xListener);
81 xListener.reset();
82 xListener.fireEvent();
83 tRes.tested("removeConfigurationListener()", !xListener.actionWasTriggered());
86 /**
87 * Dispose because the UIConfigurationManager has to be recreated
89 public void after() {
90 disposeEnvironment();