cid#1607171 Data race condition
[LibreOffice.git] / qadevOOo / tests / java / ifc / presentation / _Presentation.java
blob28f8a5aaba3bf7046045754105caea3b673f376c
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.presentation;
21 import lib.MultiPropertyTest;
22 import lib.Status;
23 import lib.StatusException;
25 import com.sun.star.presentation.XPresentation;
27 /**
28 * Testing <code>com.sun.star.presentation.Presentation</code>
29 * service properties :
30 * <ul>
31 * <li><code> AllowAnimations</code></li>
32 * <li><code> CustomShow</code></li>
33 * <li><code> FirstPage</code></li>
34 * <li><code> IsAlwaysOnTop</code></li>
35 * <li><code> IsAutomatic</code></li>
36 * <li><code> IsEndless</code></li>
37 * <li><code> IsFullScreen</code></li>
38 * <li><code> IsLivePresentation</code></li>
39 * <li><code> IsMouseVisible</code></li>
40 * <li><code> Pause</code></li>
41 * <li><code> StartWithNavigator</code></li>
42 * <li><code> UsePen</code></li>
43 * </ul> <p>
44 * This test needs the following object relations :
45 * <ul>
46 * <li> <code>'Presentation'</code> (of type <code>XPresentation</code>):
47 * for test of property <code>IsLivePresentation</code>
48 * presentation start needed </li>
49 * <ul> <p>
50 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
51 * @see com.sun.star.presentation.Presentation
52 * @see com.sun.star.presentation.XPresentation
54 public class _Presentation extends MultiPropertyTest {
56 public void _IsLivePresentation() {
57 XPresentation aPresentation = (XPresentation)
58 tEnv.getObjRelation("Presentation");
59 if (aPresentation == null) throw new StatusException(Status.failed
60 ("Relation 'Presentation' not found"));
62 aPresentation.start();
63 testProperty("IsLivePresentation");
66 protected PropertyTester CustomShowTester = new PropertyTester() {
67 @Override
68 protected Object getNewValue(String propName, Object oldValue)
69 throws java.lang.IllegalArgumentException {
70 if ( ((String)oldValue).equals("SecondPresentation") ) {
71 return "FirstPresentation";
72 } else {
73 return "SecondPresentation";
78 public void _CustomShow() {
79 testProperty("CustomShow", CustomShowTester);
81 } // finish class _Presentation