Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / qadevOOo / tests / java / ifc / io / _XActiveDataSource.java
bloba363dd5edeb87408b36c052b7bfb901b30214ccd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 package ifc.io;
30 import lib.MultiMethodTest;
32 import com.sun.star.io.XActiveDataSource;
33 import com.sun.star.io.XOutputStream;
34 import com.sun.star.uno.UnoRuntime;
35 import com.sun.star.uno.XInterface;
37 /**
38 * Testing <code>com.sun.star.io.XActiveDataSource</code>
39 * interface methods:
40 * <ul>
41 * <li><code>setOutputStream()</code></li>
42 * <li><code>getOutputStream()</code></li>
43 * </ul> <p>
45 * This test needs the following object relations :
46 * <ul>
47 * <li> <code>'OutputStream'</code>
48 * (of type <code>com.sun.star.io.OutputStream</code>):
49 * acceptable output stream which can be set by <code>setOutputStream</code> </li>
50 * <ul> <p>
52 * After test completion object environment has to be recreated.
53 * @see com.sun.star.io.XActiveDataSource
54 * @see com.sun.star.io.XOutputStream
56 public class _XActiveDataSource extends MultiMethodTest {
58 public XActiveDataSource oObj = null;
60 private XOutputStream oStream = null;
62 /**
63 * Take the XOutputStream from the environment for setting and getting.
65 public void before() {
66 XInterface x = (XInterface)tEnv.getObjRelation("OutputStream");
67 oStream = (XOutputStream) UnoRuntime.queryInterface
68 (XOutputStream.class, x) ;
71 /**
72 * Test calls the method using interface <code>XOutputStream</code>
73 * received in method <code>before()</code> as parameter. <p>
74 * Has <b> OK </b> status if the method successfully returns. <p>
76 public void _setOutputStream() {
77 oObj.setOutputStream(oStream);
78 tRes.tested("setOutputStream()", true);
81 /**
82 * Test calls the method and compares returned value with value that was
83 * set in the method <code>setOutputStream()</code>. <p>
84 * Has <b> OK </b> status if values are equal. <p>
85 * The following method tests are to be completed successfully before :
86 * <ul>
87 * <li> <code> setOutputStream() </code></li>
88 * </ul>
90 public void _getOutputStream() {
91 requiredMethod("setOutputStream()");
93 tRes.tested("getOutputStream()",
94 oStream.equals(oObj.getOutputStream()));
97 /**
98 * Forces object environment recreation.
100 public void after() {
101 this.disposeEnvironment() ;