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 ************************************************************************/
31 import lib
.MultiMethodTest
;
33 import lib
.StatusException
;
35 import com
.sun
.star
.document
.XExporter
;
36 import com
.sun
.star
.lang
.XComponent
;
39 * Testing <code>com.sun.star.document.XExporter</code>
42 * <li><code> setSourceDocument()</code></li>
44 * This test needs the following object relations :
46 * <li> <code>'SourceDocument'</code> (of type <code>XComponent</code>):
47 * the source document to be passed to the method. </li>
49 * Test is <b> NOT </b> multithread compilant. <p>
50 * @see com.sun.star.document.XExporter
52 public class _XExporter
extends MultiMethodTest
{
54 public XExporter oObj
= null;
55 public XComponent source
= null ;
58 * Retrieves object relations.
59 * @throws StatusException If one of relations not found.
61 public void before() {
62 source
= (XComponent
) tEnv
.getObjRelation("SourceDocument") ;
64 if (source
== null) throw new StatusException(Status
.failed
65 ("Relation not found")) ;
69 * Just calls the method. <p>
70 * Has <b> OK </b> status if no runtime exceptions occurred.
71 * Usually this interface is supported both with <code>XFilter</code>
72 * where source document setting is checked.
74 public void _setSourceDocument() {
75 boolean result
= true ;
78 oObj
.setSourceDocument(source
);
80 catch (com
.sun
.star
.lang
.IllegalArgumentException ex
) {
81 log
.println("Exception while checking :");
82 ex
.printStackTrace(log
);
86 tRes
.tested("setSourceDocument()", result
) ;