diff options
author | Stephan Wunderlich <sw@openoffice.org> | 2003-01-27 17:20:08 +0000 |
---|---|---|
committer | Stephan Wunderlich <sw@openoffice.org> | 2003-01-27 17:20:08 +0000 |
commit | 26ebdfc472be16f0eb4110aab0335666d2ba5e62 (patch) | |
tree | 89b1b245105889ab56b358ce8d2edecee7f009dc /qadevOOo/tests/java/ifc/lang | |
parent | c1b610e51c2f678a8adb7c4c265aafb7e1aeb8e1 (diff) |
NEW: initial version
Diffstat (limited to 'qadevOOo/tests/java/ifc/lang')
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_ServiceManager.java | 88 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XComponent.java | 191 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XEventListener.java | 95 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XInitialization.java | 118 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java | 153 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java | 199 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java | 92 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XServiceInfo.java | 130 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java | 201 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/lang/_XTypeProvider.java | 126 |
10 files changed, 1393 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/lang/_ServiceManager.java b/qadevOOo/tests/java/ifc/lang/_ServiceManager.java new file mode 100644 index 000000000000..f69f5b7a1eb9 --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_ServiceManager.java @@ -0,0 +1,88 @@ +/************************************************************************* + * + * $RCSfile: _ServiceManager.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:59 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.uno.XComponentContext; +import lib.MultiPropertyTest; + +public class _ServiceManager extends MultiPropertyTest { + + public void _DefaultContext() { + XComponentContext get = null; + boolean res = false; + try { + get = (XComponentContext) oObj.getPropertyValue("DefaultContext"); + res = get != null; + } catch (com.sun.star.beans.UnknownPropertyException upe) { + log.println("Property is optional and not supported"); + res = true; + } catch (com.sun.star.lang.WrappedTargetException wte) { + log.println("Unexpected Exception"); + wte.printStackTrace(log); + res = false; + } + tRes.tested("DefaultContext", get != null); + + } + +} // EOF _ServiceManager + diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java new file mode 100644 index 000000000000..b7184e4bea4e --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java @@ -0,0 +1,191 @@ +/************************************************************************* + * + * $RCSfile: _XComponent.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:58 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.frame.XDesktop; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XEventListener; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XComponent</code> +* interface methods : +* <ul> +* <li><code> dispose()</code></li> +* <li><code> addEventListener()</code></li> +* <li><code> removeEventListener()</code></li> +* </ul> +* After this interface test object <b>must be recreated</b>. <p> +* Multithreaded test ability <b>not implemented</b> yet. +* @see com.sun.star.lang.XComponent +*/ +public class _XComponent extends MultiMethodTest { + + public static XComponent oObj = null; + + boolean listenerDisposed[] = new boolean[2]; + String[] Loutput = new String[2]; + + /** + * Listener which added but not removed, and its method must be called + * on <code>dispose</code> call. + */ + public class MyEventListener implements XEventListener { + public void disposing ( EventObject oEvent ) { + Loutput[0] = Thread.currentThread() + " is DISPOSING EV1" + this; + listenerDisposed[0] = true; + } + }; + + /** + * Listener which added and then removed, and its method must <b>not</b> + * be called on <code>dispose</code> call. + */ + public class MyEventListener2 implements XEventListener { + public void disposing ( EventObject oEvent ) { + Loutput[0] = Thread.currentThread() + " is DISPOSING EV2" + this; + listenerDisposed[1] = true; + } + }; + + XEventListener listener1 = new MyEventListener(); + XEventListener listener2 = new MyEventListener2(); + + /** + * Adds two listeners. <p> + * Has OK status if then the first listener will receive an event + * on <code>dispose</code> method call. + */ + public void _addEventListener() { + + listenerDisposed[0] = false; + listenerDisposed[1] = false; + + oObj.addEventListener( listener1 ); + oObj.addEventListener( listener2 ); + + return; + } // finished _addEventListener() + + /** + * Removes the second of two added listeners. <p> + * Method tests to be completed successfully : + * <ul> + * <li> <code>addEventListener</code> : method must add two listeners. </li> + * </ul> <p> + * Has OK status if no events will be sent to the second listener on + * <code>dispose</code> method call. + */ + public void _removeEventListener() { + executeMethod("addEventListener()"); + if (disposed) return; + // the second listener should not be called + oObj.removeEventListener( listener2 ); + log.println(Thread.currentThread() + " is removing EL " + listener2); + } // finished _removeEventListener() + + static boolean disposed = false; + + /** + * Disposes the object and then check appropriate listeners were + * called or not. <p> + * Method tests to be completed successfully : + * <ul> + * <li> <code>removeEventListener</code> : method must remove one of two + * listeners. </li> + * </ul> <p> + * Has OK status if liseter removed wasn't called and other listener + * was. + */ + public void _dispose() { + disposed = false; + executeMethod("removeEventListener()"); + + log.println( "begin dispose" + Thread.currentThread()); + XDesktop oDesk = (XDesktop) tEnv.getObjRelation("Desktop"); + if (oDesk !=null) oDesk.terminate(); else oObj.dispose(); + try { + Thread.sleep(500) ; + } catch (InterruptedException e) {} + if (Loutput[0]!=null) log.println(Loutput[0]); + if (Loutput[1]!=null) log.println(Loutput[1]); + log.println( "end dispose" + Thread.currentThread()); + disposed = true; + + // check that dispose() works OK. + tRes.tested("addEventListener()", listenerDisposed[0]); + tRes.tested("removeEventListener()", !listenerDisposed[1]); + tRes.tested("dispose()", listenerDisposed[0] && !listenerDisposed[1]); + + } // finished _dispose() + + /** + * Forces object recreation. + */ + protected void after() { + disposeEnvironment(); + } + +} // finished class _XComponent + + diff --git a/qadevOOo/tests/java/ifc/lang/_XEventListener.java b/qadevOOo/tests/java/ifc/lang/_XEventListener.java new file mode 100644 index 000000000000..ab583672f862 --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XEventListener.java @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: _XEventListener.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:58 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XEventListener; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XEventListener</code> +* interface methods : +* <ul> +* <li><code> disposing()</code></li> +* </ul> <p> +* Tests nothing, all methods has <b>OK</b> status. +* @see com.sun.star.lang.XEventListener +*/ +public class _XEventListener extends MultiMethodTest { + + public XEventListener oObj = null; + + /** + * Nothing to test. Always has <b>OK</b> status. + */ + public void _disposing() { + log.println("The method 'disposing'"); + log.println("gets called when the broadcaster is about to be"+ + " disposed.") ; + log.println("All listeners and all other objects which reference "+ + "the broadcaster should release the references."); + log.println("So there is nothing to test here"); + tRes.tested("disposing()",true); + + } + +} //EOF of XEventListener + diff --git a/qadevOOo/tests/java/ifc/lang/_XInitialization.java b/qadevOOo/tests/java/ifc/lang/_XInitialization.java new file mode 100644 index 000000000000..10ed742e7873 --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XInitialization.java @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: _XInitialization.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:57 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XInitialization; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XInitialization</code> +* interface methods. <p> +* This test needs the following object relations : +* <ul> +* <li> <code>'XInitialization.args'</code> (of type <code>Object[]</code>): +* (<b>Optional</b>) : argument for <code>initialize</code> +* method. If ommitet zero length array is used. </li> +* <ul> <p> +* Test is multithread compilant. <p> +* Till the present time there was no need to recreate environment +* after this test completion. +*/ +public class _XInitialization extends MultiMethodTest { + + public static XInitialization oObj = null; + + /** + * Test calls the method with 0 length array and checks that + * no exceptions were thrown. <p> + * Has <b> OK </b> status if no exceptions were thrown. <p> + */ + public void _initialize() { + boolean result = true ; + + try { + Object[] args = (Object[]) tEnv.getObjRelation("XInitialization.args"); + if (args==null) { + oObj.initialize(new Object[0]); + } else { + oObj.initialize(args); + } + + } catch (com.sun.star.uno.Exception e) { + log.println("Exception occured while method calling.") ; + log.println(e) ; + result = false ; + } + + tRes.tested("initialize()", result) ; + } // finished _initialize() + + /** + * Disposes object environment. + */ + public void after() { + disposeEnvironment() ; + } + +} // finished class _XInitialization + + diff --git a/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java b/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java new file mode 100644 index 000000000000..5818c66f5ede --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java @@ -0,0 +1,153 @@ +/************************************************************************* + * + * $RCSfile: _XMultiComponentFactory.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:57 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.uno.XComponentContext; +import com.sun.star.uno.XInterface; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XMultiComponentFactory</code> +* interface methods : +* <ul> +* <li><code> createInstanceWithContext()</code></li> +* <li><code> createInstanceWithArgumentsAndContext()</code></li> +* <li><code> getAvailableServiceNames()</code></li> +* </ul> <p> +* Test is <b> NOT </b> multithread compilant. <p> +* @see com.sun.star.lang.XMultiComponentFactory +*/ +public class _XMultiComponentFactory extends MultiMethodTest { + public XMultiComponentFactory oObj = null; + + public XComponentContext xContext = null; + + public void before(){ + xContext = (XComponentContext)tEnv.getObjRelation("DC"); + } + + /** + * Calls the method with one of the available service names + * obtained by method getAvailableServiceNames. <p> + * Has <b> OK </b> status if no runtime exceptions occured + * and returned value is not null. + */ + public void _createInstanceWithContext() { + requiredMethod("getAvailableServiceNames()"); + boolean result = true; + + try { + XInterface component = (XInterface) + oObj.createInstanceWithContext( + availableServiceNames[0], xContext); + result = (component != null); + } catch (com.sun.star.uno.Exception e) { + log.println("Couldn't create instance " + availableServiceNames[0]); + result = false; + } + + tRes.tested("createInstanceWithContext()", result); + } + + /** + * Calls the method with one of the available service names + * obtained by method getAvailableServiceNames. <p> + * Has <b> OK </b> status if no runtime exceptions occured + * and returned value is not null. + */ + public void _createInstanceWithArgumentsAndContext() { + requiredMethod("getAvailableServiceNames()"); + boolean result = true; + + try { + XInterface component = (XInterface) + oObj.createInstanceWithArgumentsAndContext( + availableServiceNames[0], new Object[0], xContext); + result = (component != null); + } catch (com.sun.star.uno.Exception e) { + log.println("Couldn't create instance " + availableServiceNames[0]); + result = false; + } + + tRes.tested("createInstanceWithArgumentsAndContext()", result); + } + + String[] availableServiceNames; + + /** + * Just calls the method. <p> + * Has <b> OK </b> status if no runtime exceptions occured + * and returned value is not null. + */ + public void _getAvailableServiceNames() { + availableServiceNames = oObj.getAvailableServiceNames(); + + log.println("Available service names:"); + for(int i = 0; i < availableServiceNames.length; i++) { + log.println(" " + availableServiceNames[i]); + } + + tRes.tested("getAvailableServiceNames()", availableServiceNames != null); + } +} + diff --git a/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java b/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java new file mode 100644 index 000000000000..f45cd3fc14bb --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java @@ -0,0 +1,199 @@ +/************************************************************************* + * + * $RCSfile: _XMultiServiceFactory.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XMultiServiceFactory; +import lib.MultiMethodTest; +import lib.Status; + +/** +* Testing <code>com.sun.star.lang.XMultiServiceFactory</code> +* interface methods: +* <ul> +* <li><code>createInstance()</code></li> +* <li><code>createInstanceWithArguments()</code></li> +* <li><code>getAvailableServiceNames()</code></li> +* </ul> <p> +* +* This test needs the following object relations : +* <ul> +* <li> <code>'XMSF.serviceNames'</code> (of type <code>String[]</code>) +* <b>optional</b>: +* the relation used when service names are obtained the way +* other than calling <code>getAvailableServiceNames()</code> +* method. +* </li> +* <li> <code>'XMSF.serviceNamesWithArgs'</code> (of type <code>String[]</code>) +* <b>optional</b>: +* the relation used when service names are obtained the way +* other than calling <code>getAvailableServiceNames()</code> +* method for testing <code>createInstanceWithArguments</code> method. +* </li> +* <li> <code>'XMSF.Args'</code> (of type <code>Object[][]</code>) +* <b>optional</b>: +* if this relation exists than the method +* <code>createInstanceWithArguments</code> is tested. This relation +* supplies arguments for creating instances. If the relation +* <code>'XMSF.serviceNamesWithArgs'</code> is also specified +* then for each service name from that relation appropriate arguments +* are used from arguments array. If not than arguments with index +* 0 are used for services creation obtained by +* <code>getAvailableServiceNames</code> method. +* </li> +* </ul> <p> +* +* @see com.sun.star.lang.XMultiServiceFactory +*/ +public class _XMultiServiceFactory extends MultiMethodTest { + + public XMultiServiceFactory oObj = null; + public String[] services = null; + + /** + * Test calls the method and checks returned value. <p> + * Has <b> OK </b> status if returned value isn't null. <p> + */ + public void _getAvailableServiceNames() { + services = oObj.getAvailableServiceNames(); + tRes.tested("getAvailableServiceNames()",services != null); + } + + /** + * Test creates instance of the first service from names array + * get by <code>getAvailableServiceNames()</code>. If the array + * is empty than test looks for names from relation. <p> + * + * Has <b> OK </b> status if created instance isn't null. <p> + * + * The following method tests are to be completed successfully before : + * <ul> + * <li> <code> getAvailableServiceNames() </code> : to have list of + * supported services </li> + * </ul> + */ + public void _createInstance() { + requiredMethod("getAvailableServiceNames()"); + + if (services.length == 0) { + services = (String[]) tEnv.getObjRelation("XMSF.serviceNames"); + if (services == null) { + log.println("No service to create.") ; + tRes.tested("createInstance()", true); + return; + } + } + + try { + log.println("Creating Instance: " + services[0]); + Object Inst = oObj.createInstance(services[0]); + tRes.tested("createInstance()",Inst != null); + } catch (com.sun.star.uno.Exception ex) { + log.println("Exception occured during createInstance()"); + ex.printStackTrace(log); + tRes.tested("createInstance()",false); + } + } + + /** + * If the relation with arguments is not specified test does nothing. + * In other case it tries to create instance by its name from + * relation of from array <code>getAvailableServiceNames()</code> + * method supplied. <p> + * + * Has <b> OK </b> status if the created instance is not null. <p> + * + * The following method tests are to be completed successfully before : + * <ul> + * <li> <code> getAvailableServiceNames() </code> : to have list of + * supported services </li> + * </ul> + */ + public void _createInstanceWithArguments() { + requiredMethod("getAvailableServiceNames()"); + + Object[][] args = (Object[][]) + tEnv.getObjRelation("XMSF.Args"); + String[] sNames = (String[]) + tEnv.getObjRelation("XMSF.serviceNamesWithArgs"); + + if (args == null) { + log.println("Relation 'XMSF.serviceNamesWithArgs' not found"); + log.println("The component assumed not support " + + "createInstanceWithArguments()"); + tRes.tested("createInstanceWithArguments()",true); + } else { + if (sNames == null) sNames = services; + log.println("Creating service '" + sNames[0] + "' with arguments"); + try { + Object Inst = oObj.createInstanceWithArguments + (sNames[0], args[0]); + tRes.tested("createInstanceWithArguments()",Inst != null); + } catch (com.sun.star.uno.Exception ex) { + log.println("Exception occured during createInstanceWithArguments()"); + ex.printStackTrace(log); + tRes.tested("createInstanceWithArguments()",false); + } + } + } +} // finish class _XMultiServiceFactory + + diff --git a/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java b/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java new file mode 100644 index 000000000000..bd63a1117f20 --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java @@ -0,0 +1,92 @@ +/************************************************************************* + * + * $RCSfile: _XServiceDisplayName.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.Locale; +import com.sun.star.lang.XServiceDisplayName; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XServiceDisplayName</code> +* interface methods: +* <ul> +* <li><code>getServiceDisplayName()</code></li> +* </ul> <p> +* @see com.sun.star.lang.XServiceDisplayName +*/ +public class _XServiceDisplayName extends MultiMethodTest { + + public XServiceDisplayName oObj = null; + + /** + * Test calls the method and checks returned value. <p> + * Has <b> OK </b> status if returned value isn't null. <p> + */ + public void _getServiceDisplayName() { + String dn = oObj.getServiceDisplayName(new Locale("de","DE","")); + + tRes.tested("getServiceDisplayName()", dn != null); + } + +} // finish class MTest + + diff --git a/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java b/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java new file mode 100644 index 000000000000..a60e6095b4dc --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java @@ -0,0 +1,130 @@ +/************************************************************************* + * + * $RCSfile: _XServiceInfo.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XServiceInfo; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XServiceInfo</code> +* interface methods : +* <ul> +* <li><code> getImplementationName()</code></li> +* <li><code> supportsService()</code></li> +* <li><code> getSupportedServiceNames()</code></li> +* </ul> <p> +* Test is multithread compilant. <p> +* @see com.sun.star.lang.XServiceInfo +*/ +public class _XServiceInfo extends MultiMethodTest { + public static XServiceInfo oObj = null; + public static String[] names = null; + + /** + * Just calls the method.<p> + * Has <b>OK</b> status if no runtime exceptions occured. + */ + public void _getImplementationName() { + boolean result = true; + log.println("testing getImplementationName() ... "); + + log.println("The ImplementationName ist "+oObj.getImplementationName()); + result=true; + + tRes.tested("getImplementationName()", result); + + } // end getImplementationName() + + + /** + * Just calls the method.<p> + * Has <b>OK</b> status if no runtime exceptions occured. + */ + public void _getSupportedServiceNames() { + boolean result = true; + log.println("getting supported Services..."); + names = oObj.getSupportedServiceNames(); + for (int i=0;i<names.length;i++) { + int k = i+1; + log.println(k+". Supported Service is "+names[i]); + } + result=true; + + tRes.tested("getSupportedServiceNames()", result); + + } // end getSupportedServiceNames() + + /** + * Gets one of the service names returned by + * <code>getSupportedServiceNames</code> method and + * calls the <code>supportsService</code> methos with this + * name. <p> + * Has <b>OK</b> status if <code>true</code> value is + * returned. + */ + public void _supportsService() { + log.println("testing supportsService"); + names = oObj.getSupportedServiceNames(); + tRes.tested("supportsService()", oObj.supportsService(names[0])); + } // end supportsService() +} + diff --git a/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java new file mode 100644 index 000000000000..d9c6d3f48267 --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java @@ -0,0 +1,201 @@ +/************************************************************************* + * + * $RCSfile: _XSingleServiceFactory.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XSingleServiceFactory; +import com.sun.star.uno.UnoRuntime; +import lib.MultiMethodTest; + + +/** +/** +* Testing <code>com.sun.star.</code> +* interface methods :lang.XSingleServiceFactory +* <ul> +* <li><code> createInstance()</code></li> +* <li><code> createInstanceWithArguments()</code></li> +* </ul> <p> +* This test needs the following object relations : +* <ul> +* <li> <code>'XSingleServiceFactory.createInstance.negative'</code> : +* <code>String</code> relation; If its value 'true' then +* <code>createInstance</code> method for the object isn't +* supported. </li> +* <li> <code>'XSingleServiceFactory.arguments'</code> <b>(optional)</b>: +* has <code>Object[]</code> type. This relation is used as +* a parameter for <code>createInstanceWithArguments</code> +* method call. If this relation doesn't exist test pass +* zerro length array as argument. </li> +* <li> <code>'XSingleServiceFactory.MustSupport'</code> <b>(optional)</b>: +* of type <code>java.lang.Class[]</code>. This is an array of UNO +* interface classes which must be supported by created instance. +* </li> +* <ul> <p> +* Test is <b> NOT </b> multithread compilant. <p> +* After test completion object environment has to be recreated. +* @see com.sun.star.lang.XSingleServiceFactory +*/ +public class _XSingleServiceFactory extends MultiMethodTest { + + public XSingleServiceFactory oObj = null; + private Class[] mustSupport = null ; + + public void before() { + mustSupport = (Class[]) tEnv.getObjRelation + ("XSingleServiceFactory.MustSupport") ; + } + + /** + * Just calls the method and check the value returned. <p> + * + * Has <b>OK</b> status in case if this method is supported + * by object and non null value is returned, or if + * this method isn't supported then the method call must + * rise an exception or return <code>null</code> value. + * If the relation exists which specifies required interfaces + * supported by created instance then status is <b>OK</b> + * if all these interfaces are supported. + */ + public void _createInstance() { + // for some objects the method should fail. + // If thi is required the property is set to true. + String negStr = (String)tEnv.getObjRelation( + "XSingleServiceFactory.createInstance.negative"); + boolean negative = (negStr != null && negStr.equalsIgnoreCase("true")); + + if (negative) { + log.println("Negative test: createInstance should fail"); + } + + try { + log.println("Creating Instance: "); + Object Inst = oObj.createInstance(); + boolean bOK = Inst != null ; + + if (mustSupport != null && bOK) { + for (int i = 0; i < mustSupport.length; i++) { + Object ifc = UnoRuntime.queryInterface(mustSupport[i], Inst) ; + if (ifc == null) { + log.println(" !!! Created instance doesn't support " + + mustSupport[i].toString()) ; + } + bOK &= ifc != null ; + } + } + + tRes.tested("createInstance()", + (negative && Inst == null) || (!negative && bOK)); + } catch (com.sun.star.uno.Exception ex) { + log.println("Exception occured during createInstance()"); + if (negative) { + ex.printStackTrace(log); + } + tRes.tested("createInstance()", negative); + } + } + + /** + * Calls the method and checks the value returned. If relation + * with method argument doesn't exist new zerro length array + * is created. <p> + * Has <b>OK</b> status if non null value is returned. + * If the relation exists which specifies required interfaces + * supported by created instance then status is <b>OK</b> + * if all these interfaces are supported. + */ + public void _createInstanceWithArguments() { + Object[] arg = (Object[])tEnv.getObjRelation( + "XSingleServiceFactory.arguments"); + + if (arg == null) { + arg = new Object[0]; + } + + try { + boolean bOK = true ; + log.println("Creating Instance with Argument"); + Object Inst = oObj.createInstanceWithArguments(arg); + bOK &= Inst != null ; + + if (mustSupport != null) { + for (int i = 0; i < mustSupport.length; i++) { + Object ifc = UnoRuntime.queryInterface(mustSupport[i], Inst) ; + if (ifc == null) { + log.println(" !!! Created instance doesn't support " + + mustSupport[i].toString()) ; + } + bOK &= ifc != null ; + } + } + + tRes.tested("createInstanceWithArguments()", bOK); + } + catch (com.sun.star.uno.Exception ex) { + log.println("Exception occured during createInstanceWithArguments()"); + ex.printStackTrace(log); + tRes.tested("createInstanceWithArguments()",false); + } + } + +} // finish class _XSingleServiceFactory + + diff --git a/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java b/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java new file mode 100644 index 000000000000..ecf84277a25a --- /dev/null +++ b/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java @@ -0,0 +1,126 @@ +/************************************************************************* + * + * $RCSfile: _XTypeProvider.java,v $ + * + * $Revision: 1.1 $ + * + * last change:$Date: 2003-01-27 18:10:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package ifc.lang; + +import com.sun.star.lang.XTypeProvider; +import com.sun.star.uno.Type; +import lib.MultiMethodTest; + +/** +* Testing <code>com.sun.star.lang.XTypeProvider</code> +* interface methods : +* <ul> +* <li><code> getTypes()</code></li> +* <li><code> getImplementationId()</code></li> +* </ul> <p> +* Test is <b> NOT </b> multithread compilant. <p> +* @see com.sun.star.lang.XTypeProvider +*/ +public class _XTypeProvider extends MultiMethodTest { + + public static XTypeProvider oObj = null; + public static Type[] types = null; + + /** + * Just calls the method.<p> + * Has <b>OK</b> status if no runtime exceptions occured. + */ + public void _getImplementationId() { + boolean result = true; + log.println("testing getImplementationId() ... "); + + log.println("The ImplementationId is "+oObj.getImplementationId()); + result = true; + + tRes.tested("getImplementationId()", result); + + } // end getImplementationId() + + + /** + * alls the method and checks the return value.<p> + * Has <b>OK</b> status if one of the return value equals to the + * type <code>com.sun.star.lang.XTypeProvider</code>. + */ + public void _getTypes() { + boolean result = false; + log.println("getting Types..."); + types = oObj.getTypes(); + for (int i=0;i<types.length;i++) { + int k = i+1; + log.println(k+". Type is "+types[i].toString()); + if (types[i].toString().equals + ("Type<com.sun.star.lang.XTypeProvider>")) { + result = true; + } + } + if (!result) { + log.println("Component must provide Type " + +"<com.sun.star.lang.XTypeProvider>"); + } + + tRes.tested("getTypes()", result); + + } // end getTypes() + +} + |