1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.ui;
25 
26 import com.sun.star.embed.XStorage;
27 import com.sun.star.ui.XUIConfigurationStorage;
28 import lib.MultiMethodTest;
29 /**
30 * Testing <code>com.sun.star.ui.XUIConfigurationStorage</code>
31 * interface methods :
32 * <ul>
33 *  <li><code> setStorage()</code></li>
34 *  <li><code> hasStorage()</code></li>
35 * </ul> <p>
36 * Test is <b> NOT </b> multithread compilant. <p>
37 * @see com.sun.star.ui.XUIConfigurationStorage
38 */
39 
40 public class _XUIConfigurationStorage extends MultiMethodTest {
41 
42     public XUIConfigurationStorage oObj;
43     private XStorage xStore = null;
44 
before()45     public void before() {
46         xStore = (XStorage)tEnv.getObjRelation("XUIConfigurationStorage.Storage");
47     }
48 
49     /**
50     * Set the object relation <code>XUIConfigurationStorage.Storage</code>
51     * as storage.
52     * Has <b>OK</b> status if no exception is thrown.
53     */
_setStorage()54     public void _setStorage() {
55         if (!oObj.hasStorage())
56             oObj.setStorage(xStore);
57         else
58             log.println("For initializing this object, the setStorage() method was already called at the object.");
59         tRes.tested("setStorage()", true);
60     }
61 
62     /**
63      * Queries object for a storage.
64      * Has <b>OK</b> status if <code>hasStorage</code> returns <code>OK</code>
65      */
_hasStorage()66     public void _hasStorage() {
67         requiredMethod("setStorage()");
68         boolean has = oObj.hasStorage();
69         tRes.tested("hasStorage()", has);
70     }
71 
72 }