Avoid potential negative array index access to cached text.
[LibreOffice.git] / qadevOOo / tests / java / ifc / util / _PathSettings.java
blob7d6e42f7f99134a2c52852382c708da5f468537d
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.util;
21 import lib.MultiPropertyTest;
22 import util.utils;
24 /**
25 * Testing <code>com.sun.star.util.PathSettings</code>
26 * service properties :
27 * <ul>
28 * <li><code> Addin </code></li>
29 * <li><code> AutoCorrect </code></li>
30 * <li><code> AutoText </code></li>
31 * <li><code> Backup </code></li>
32 * <li><code> Basic </code></li>
33 * <li><code> Bitmap </code></li>
34 * <li><code> Config </code></li>
35 * <li><code> Dictionary </code></li>
36 * <li><code> Favorites </code></li>
37 * <li><code> Filter </code></li>
38 * <li><code> Gallery </code></li>
39 * <li><code> Graphic </code></li>
40 * <li><code> Help </code></li>
41 * <li><code> Linguistic </code></li>
42 * <li><code> Module </code></li>
43 * <li><code> Palette </code></li>
44 * <li><code> Plugin </code></li>
45 * <li><code> Storage </code></li>
46 * <li><code> Temp </code></li>
47 * <li><code> Template </code></li>
48 * <li><code> UIConfig </code></li>
49 * <li><code> UserConfig </code></li>
50 * <li><code> UserDictionary</code></li>
51 * <li><code> Work </code></li>
52 * </ul> <p>
54 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
55 * @see com.sun.star.util.PathSettings
57 public class _PathSettings extends MultiPropertyTest {
59 /**
60 * This path list could be empty after SO installation.
61 * And the URL is validated to match the pattern 'file:///*'
62 * that's why the custom changing of this property required.
64 public void _UIConfig() {
65 testProperty("UIConfig", new PropertyTester() {
66 @Override
67 public Object getNewValue(String propName, Object oldVal) {
68 String path = (String) oldVal;
69 if (path == null) path = "";
70 if (path.length() > 0 && !path.endsWith(";")) {
71 path += ";";
73 path += utils.getOfficeTemp(tParam.getMSF());
74 return path;
76 });