bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / tests / java / ifc / io / _XConnectable.java
blob8c8d061b9c7c440f0a7f65d5c02e86b490265fde
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 0bject 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 public void before() {
55 XInterface x = (XInterface)tEnv.getObjRelation("Connectable");
56 xConnect = UnoRuntime.queryInterface(
57 XConnectable.class, x) ;
60 /**
61 * Test calls the method using interface <code>XConnectable</code>
62 * received in method <code>before()</code> as parameter. <p>
63 * Has <b> OK </b> status if the method successfully returns. <p>
65 public void _setPredecessor() {
66 oObj.setPredecessor(xConnect) ;
68 tRes.tested("setPredecessor()", true) ;
71 /**
72 * Test calls the method and compares returned value with value that was
73 * set in the method <code>setPredecessor()</code>. <p>
74 * Has <b> OK </b> status if values are equal. <p>
75 * The following method tests are to be completed successfully before :
76 * <ul>
77 * <li> <code> setPredecessor() </code></li>
78 * </ul>
80 public void _getPredecessor() {
81 requiredMethod("setPredecessor()") ;
83 XConnectable gConnect = oObj.getPredecessor() ;
85 tRes.tested("getPredecessor()", xConnect.equals(gConnect)) ;
88 /**
89 * Test calls the method using interface <code>XConnectable</code>
90 * received in method <code>before()</code> as parameter. <p>
91 * Has <b> OK </b> status if the method successfully returns. <p>
93 public void _setSuccessor() {
94 oObj.setSuccessor(xConnect) ;
96 tRes.tested("setSuccessor()", true) ;
99 /**
100 * Test calls the method and compares returned value with value that was
101 * set in the method <code>setSuccessor()</code>. <p>
102 * Has <b> OK </b> status if values are equal. <p>
103 * The following method tests are to be completed successfully before :
104 * <ul>
105 * <li> <code> setSuccessor() </code></li>
106 * </ul>
108 public void _getSuccessor() {
109 requiredMethod("setSuccessor()") ;
111 XConnectable gConnect = oObj.getSuccessor() ;
113 tRes.tested("getSuccessor()", xConnect.equals(gConnect)) ;
117 * Forces object environment recreation.
119 public void after() {
120 this.disposeEnvironment() ;