Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / ui / dialogs / _XFolderPicker.java
blob998256484e8285547c201dbc4cea93d634949f2d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XFolderPicker.java,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package ifc.ui.dialogs;
33 import lib.MultiMethodTest;
35 import com.sun.star.lang.XMultiServiceFactory;
36 import com.sun.star.ui.dialogs.XFolderPicker;
38 /**
39 * Testing <code>com.sun.star.ui.XFolderPicker</code>
40 * interface methods :
41 * <ul>
42 * <li><code> setDisplayDirectory()</code></li>
43 * <li><code> getDisplayDirectory()</code></li>
44 * </ul> <p>
45 * Test is <b> NOT </b> multithread compilant. <p>
46 * @see com.sun.star.ui.XFolderPicker
48 public class _XFolderPicker extends MultiMethodTest {
50 public XFolderPicker oObj = null;
51 private String dir = null ;
53 /**
54 * Sets the current directory to SOffice temp dir. <p>
55 * Has <b>OK</b> status if no exceptions occured.
57 public void _setDisplayDirectory() {
58 boolean result = true ;
59 dir = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()) ;
61 log.println("Trying to set dir '" + dir + "'") ;
62 try {
63 oObj.setDisplayDirectory(dir) ;
64 } catch (com.sun.star.lang.IllegalArgumentException e) {
65 log.println("Directory '" + dir + "' not found :" + e) ;
66 result = false ;
69 tRes.tested("setDisplayDirectory()", result) ;
72 /**
73 * Gets the current directory. <p>
74 * Has <b>OK</b> status if get value is equal to set value
75 * passed to <code>setDisplayDirectory</code> <p>
76 * The following method tests are to be completed successfully before :
77 * <ul>
78 * <li> <code> setDisplayDirectory </code> </li>
79 * </ul>
81 public void _getDisplayDirectory() {
82 requiredMethod("setDisplayDirectory()") ;
84 String gDir = oObj.getDisplayDirectory() ;
86 log.println("Get dir '" + gDir + "'") ;
88 tRes.tested("getDisplayDirectory()", dir.equals(gDir)) ;
91 /**
92 * Gets the directory chosen by the user. <p>
93 * Has <b>OK</b> status if get value is not NULL <p>
95 public void _getDirectory() {
97 String gDir = oObj.getDirectory() ;
99 log.println("Get dir '" + gDir + "'") ;
101 tRes.tested("getDirectory()", gDir != null) ;
105 * Sets the Description for the dialog. <p>
106 * Has <b>OK</b> status if no error occurs <p>
108 public void _setDescription() {
110 oObj.setDescription("XFolderPicker") ;
111 //to visually check if the method works
112 //oObj.execute();
113 tRes.tested("setDescription()", true) ;