xref: /AOO41X/main/qadevOOo/tests/java/ifc/ui/_XUIConfigurationPersistence.java (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.ui;
29 
30 import com.sun.star.embed.XStorage;
31 import com.sun.star.ui.XUIConfigurationPersistence;
32 import lib.MultiMethodTest;
33 
34 public class _XUIConfigurationPersistence extends MultiMethodTest {
35 
36     public XUIConfigurationPersistence oObj;
37     private XStorage xStore = null;
38 
39     public void before() {
40         xStore = (XStorage)tEnv.getObjRelation("XUIConfigurationStorage.Storage");
41     }
42 
43     public void _reload() {
44         try {
45             oObj.reload();
46         }
47         catch(com.sun.star.uno.Exception e) {
48             e.printStackTrace(log);
49         }
50         tRes.tested("reload()", true);
51     }
52 
53     public void _store() {
54         try {
55             oObj.store();
56         }
57         catch(com.sun.star.uno.Exception e) {
58             e.printStackTrace(log);
59         }
60         tRes.tested("store()", true);
61     }
62 
63     public void _storeToStorage() {
64         boolean result = true;
65         try {
66             oObj.storeToStorage(xStore);
67         }
68         catch(com.sun.star.uno.Exception e) {
69             result = false;
70             e.printStackTrace(log);
71         }
72         tRes.tested("storeToStorage()", result);
73     }
74 
75     public void _isModified() {
76         tRes.tested("isModified()", !oObj.isModified());
77     }
78 
79     public void _isReadOnly() {
80         tRes.tested("isReadOnly()", !oObj.isReadOnly());
81     }
82 
83 }
84