bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / tests / java / ifc / ucb / _XFileIdentifierConverter.java
blob8fb2d5eac6f97333cd66dfa0fadedd3a7ad508f4
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.ucb;
21 import lib.MultiMethodTest;
23 import com.sun.star.lang.XMultiServiceFactory;
24 import com.sun.star.ucb.XFileIdentifierConverter;
26 /**
27 * Testing <code>com.sun.star.ucb.XFileIdentifierConverter</code>
28 * interface methods :
29 * <ul>
30 * <li><code> getFileProviderLocality()</code></li>
31 * <li><code> getFileURLFromSystemPath()</code></li>
32 * <li><code> getSystemPathFromFileURL()</code></li>
33 * </ul> <p>
34 * Test is <b> NOT </b> multithread compilant. <p>
35 * @see com.sun.star.ucb.XFileIdentifierConverter
37 public class _XFileIdentifierConverter extends MultiMethodTest {
39 /**
40 * Contains the tested object.
42 public XFileIdentifierConverter oObj;
44 /**
45 * Gets the locality for SOffice temporary directory. <p>
46 * Has <b> OK </b> status if the method returns value greater
47 * than 0 (as office temp directory is supposed to be in the
48 * same location). <p>
50 public void _getFileProviderLocality() {
51 String baseURL = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF());
52 log.println("Using: "+baseURL);
53 int loc = oObj.getFileProviderLocality(baseURL);
54 log.println("Getting: "+loc);
55 tRes.tested("getFileProviderLocality()",loc > 0);
58 /**
59 * Tries to convert URL of SOffice temp directory to system
60 * dependent path. <p>
61 * Has <b> OK </b> status if the method returns system dependent
62 * representation of the URL passed. <p>
64 public void _getSystemPathFromFileURL() {
65 String baseURL = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF());
66 log.println("Using (Base): "+baseURL);
67 String sysURL = util.utils.getOfficeTempDirSys((XMultiServiceFactory)tParam.getMSF());
68 log.println("Using (System): "+sysURL);
69 String get = oObj.getSystemPathFromFileURL(baseURL);
70 log.println("Getting: "+get);
71 //sysURL = sysURL.substring(0,sysURL.length()-1);
72 tRes.tested("getSystemPathFromFileURL()",get.equals(sysURL));
75 /**
76 * Tries to convert system dependent path of SOffice temp
77 * directory to URL representation. <p>
78 * Has <b> OK </b> status if the method returns URL representation
79 * of the system dependent path passed. <p>
81 public void _getFileURLFromSystemPath() {
82 String baseURL = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF());
83 log.println("Using (Base): "+baseURL);
84 String sysURL = util.utils.getOfficeTempDirSys((XMultiServiceFactory)tParam.getMSF());
85 log.println("Using (System): "+sysURL);
86 String get = oObj.getFileURLFromSystemPath(sysURL,sysURL);
87 log.println("Getting: "+get);
88 tRes.tested("getFileURLFromSystemPath()",get.equals(baseURL));