cid#1607171 Data race condition
[LibreOffice.git] / qadevOOo / tests / java / ifc / io / _XConnectable.java
blob8efb86defe7a49fdb5ed1ff4d109f65353991b67
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.io;
21 import lib.MultiMethodTest;
23 import com.sun.star.io.XConnectable;
24 import com.sun.star.uno.UnoRuntime;
25 import com.sun.star.uno.XInterface;
27 /**
28 * Testing <code>com.sun.star.io.XConnectable</code>
29 * interface methods:
30 * <ul>
31 * <li><code>setPredecessor()</code></li>
32 * <li><code>getPredecessor()</code></li>
33 * <li><code>setSuccessor()</code></li>
34 * <li><code>getSuccessor()</code></li>
35 * </ul> <p>
36 * This test needs the following object relations :
37 * <ul>
38 * <li> <code>'Connectable'</code> (supports the <code>XConnectable</code>
39 * interface):
40 * another object to connect </li>
41 * </ul>
42 * After test completion object environment has to be recreated.
43 * @see com.sun.star.io.XConnectable
45 public class _XConnectable extends MultiMethodTest {
47 public XConnectable oObj = null;
49 private XConnectable xConnect = null ;
51 /**
52 * Get another connectable object from object relations.
54 @Override
55 public void before() {
56 XInterface x = (XInterface)tEnv.getObjRelation("Connectable");
57 xConnect = UnoRuntime.queryInterface(
58 XConnectable.class, x) ;
61 /**
62 * Test calls the method using interface <code>XConnectable</code>
63 * received in method <code>before()</code> as parameter. <p>
64 * Has <b> OK </b> status if the method successfully returns. <p>
66 public void _setPredecessor() {
67 oObj.setPredecessor(xConnect) ;
69 tRes.tested("setPredecessor()", true) ;
72 /**
73 * Test calls the method and compares returned value with value that was
74 * set in the method <code>setPredecessor()</code>. <p>
75 * Has <b> OK </b> status if values are equal. <p>
76 * The following method tests are to be completed successfully before :
77 * <ul>
78 * <li> <code> setPredecessor() </code></li>
79 * </ul>
81 public void _getPredecessor() {
82 requiredMethod("setPredecessor()") ;
84 XConnectable gConnect = oObj.getPredecessor() ;
86 tRes.tested("getPredecessor()", xConnect.equals(gConnect)) ;
89 /**
90 * Test calls the method using interface <code>XConnectable</code>
91 * received in method <code>before()</code> as parameter. <p>
92 * Has <b> OK </b> status if the method successfully returns. <p>
94 public void _setSuccessor() {
95 oObj.setSuccessor(xConnect) ;
97 tRes.tested("setSuccessor()", true) ;
101 * Test calls the method and compares returned value with value that was
102 * set in the method <code>setSuccessor()</code>. <p>
103 * Has <b> OK </b> status if values are equal. <p>
104 * The following method tests are to be completed successfully before :
105 * <ul>
106 * <li> <code> setSuccessor() </code></li>
107 * </ul>
109 public void _getSuccessor() {
110 requiredMethod("setSuccessor()") ;
112 XConnectable gConnect = oObj.getSuccessor() ;
114 tRes.tested("getSuccessor()", xConnect.equals(gConnect)) ;
118 * Forces object environment recreation.
120 @Override
121 public void after() {
122 this.disposeEnvironment() ;