1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 package complex.imageManager;
29 
30 
31 
32 
33 import com.sun.star.lang.XInitialization;
34 import lib.TestParameters;
35 
36 /**
37 * Testing <code>com.sun.star.lang.XInitialization</code>
38 * interface methods. <p>
39 * This test needs the following object relations :
40 * <ul>
41 *  <li> <code>'XInitialization.args'</code> (of type <code>Object[]</code>):
42 *   (<b>Optional</b>) : argument for <code>initialize</code>
43 *   method. If ommitet zero length array is used. </li>
44 * <ul> <p>
45 * Test is multithread compilant. <p>
46 * Till the present time there was no need to recreate environment
47 * after this test completion.
48 */
49 public class _XInitialization {
50 
51 
52     TestParameters tEnv = null;
53     public static XInitialization oObj = null;
54 
55     public _XInitialization(TestParameters tEnv, XInitialization oObj) {
56 
57         this.tEnv = tEnv;
58         this.oObj = oObj;
59     }
60 
61     /**
62     * Test calls the method with 0 length array and checks that
63     * no exceptions were thrown. <p>
64     * Has <b> OK </b> status if no exceptions were thrown. <p>
65     */
66     public boolean _initialize() {
67         boolean result = true ;
68 
69         try {
70             Object[] args = (Object[]) tEnv.get("XInitialization.args");
71             if (args==null) {
72                 oObj.initialize(new Object[0]);
73             } else {
74                 oObj.initialize(args);
75             }
76 
77         } catch (com.sun.star.uno.Exception e) {
78             System.out.println("Exception occured while method calling.") ;
79             result = false ;
80         }
81 
82         return  result ;
83     } // finished _initialize()
84 
85     /**
86     * Disposes object environment.
87     */
88     public void after() {
89 //        disposeEnvironment() ;
90     }
91 
92 } // finished class _XInitialization
93 
94 
95