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
.dialogs
;
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.lang
.XMultiServiceFactory
;
24 import com
.sun
.star
.ui
.dialogs
.XFolderPicker
;
27 * Testing <code>com.sun.star.ui.XFolderPicker</code>
30 * <li><code> setDisplayDirectory()</code></li>
31 * <li><code> getDisplayDirectory()</code></li>
33 * Test is <b> NOT </b> multithread compilant. <p>
34 * @see com.sun.star.ui.XFolderPicker
36 public class _XFolderPicker
extends MultiMethodTest
{
38 public XFolderPicker oObj
= null;
39 private String dir
= null ;
42 * Sets the current directory to SOffice temp dir. <p>
43 * Has <b>OK</b> status if no exceptions occurred.
45 public void _setDisplayDirectory() {
46 boolean result
= true ;
47 dir
= util
.utils
.getOfficeTemp((XMultiServiceFactory
)tParam
.getMSF()) ;
49 log
.println("Trying to set dir '" + dir
+ "'") ;
51 oObj
.setDisplayDirectory(dir
) ;
52 } catch (com
.sun
.star
.lang
.IllegalArgumentException e
) {
53 log
.println("Directory '" + dir
+ "' not found :" + e
) ;
57 tRes
.tested("setDisplayDirectory()", result
) ;
61 * Gets the current directory. <p>
62 * Has <b>OK</b> status if get value is equal to set value
63 * passed to <code>setDisplayDirectory</code> <p>
64 * The following method tests are to be completed successfully before :
66 * <li> <code> setDisplayDirectory </code> </li>
69 public void _getDisplayDirectory() {
70 requiredMethod("setDisplayDirectory()") ;
72 String gDir
= oObj
.getDisplayDirectory() ;
74 log
.println("Get dir '" + gDir
+ "'") ;
76 tRes
.tested("getDisplayDirectory()", dir
.equals(gDir
)) ;
80 * Gets the directory chosen by the user. <p>
81 * Has <b>OK</b> status if get value is not NULL <p>
83 public void _getDirectory() {
85 String gDir
= oObj
.getDirectory() ;
87 log
.println("Get dir '" + gDir
+ "'") ;
89 tRes
.tested("getDirectory()", gDir
!= null) ;
93 * Sets the Description for the dialog. <p>
94 * Has <b>OK</b> status if no error occurs <p>
96 public void _setDescription() {
98 oObj
.setDescription("XFolderPicker") ;
99 //to visually check if the method works
101 tRes
.tested("setDescription()", true) ;