1*1b0aaa91SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1b0aaa91SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1b0aaa91SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1b0aaa91SAndrew Rist  * distributed with this work for additional information
6*1b0aaa91SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1b0aaa91SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1b0aaa91SAndrew Rist  * "License"); you may not use this file except in compliance
9*1b0aaa91SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1b0aaa91SAndrew Rist  *
11*1b0aaa91SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1b0aaa91SAndrew Rist  *
13*1b0aaa91SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1b0aaa91SAndrew Rist  * software distributed under the License is distributed on an
15*1b0aaa91SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1b0aaa91SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1b0aaa91SAndrew Rist  * specific language governing permissions and limitations
18*1b0aaa91SAndrew Rist  * under the License.
19*1b0aaa91SAndrew Rist  *
20*1b0aaa91SAndrew Rist  *************************************************************/
21*1b0aaa91SAndrew Rist 
22*1b0aaa91SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package complex.toolkit;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import java.util.logging.Logger;
27cdf0e10cSrcweir import java.util.logging.Level;
28cdf0e10cSrcweir import complex.toolkit.accessibility._XAccessibleEventBroadcaster;
29cdf0e10cSrcweir import complex.toolkit.accessibility._XAccessibleExtendedComponent;
30cdf0e10cSrcweir import complex.toolkit.accessibility._XAccessibleText;
31cdf0e10cSrcweir import complex.toolkit.accessibility._XAccessibleComponent;
32cdf0e10cSrcweir import complex.toolkit.accessibility._XAccessibleContext;
33cdf0e10cSrcweir import util.SOfficeFactory;
34cdf0e10cSrcweir import util.AccessibilityTools;
35cdf0e10cSrcweir import com.sun.star.awt.XWindow;
36cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory;
37cdf0e10cSrcweir import com.sun.star.lang.XComponent;
38cdf0e10cSrcweir import com.sun.star.lang.XServiceInfo;
39cdf0e10cSrcweir import com.sun.star.sheet.XSpreadsheetDocument;
40cdf0e10cSrcweir import com.sun.star.text.XTextDocument;
41cdf0e10cSrcweir import com.sun.star.uno.XInterface;
42cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
43cdf0e10cSrcweir import com.sun.star.util.XCloseable;
44cdf0e10cSrcweir import com.sun.star.accessibility.AccessibleRole;
45cdf0e10cSrcweir import com.sun.star.accessibility.XAccessible;
46cdf0e10cSrcweir import com.sun.star.accessibility.XAccessibleContext;
47cdf0e10cSrcweir import com.sun.star.awt.XExtendedToolkit;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
50cdf0e10cSrcweir import org.junit.AfterClass;
51cdf0e10cSrcweir import org.junit.BeforeClass;
52cdf0e10cSrcweir import org.junit.Test;
53cdf0e10cSrcweir import org.openoffice.test.OfficeConnection;
54cdf0e10cSrcweir import static org.junit.Assert.*;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /**
57cdf0e10cSrcweir  *
58cdf0e10cSrcweir  */
59cdf0e10cSrcweir public class AccessibleStatusBarItem {
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     XMultiServiceFactory xMSF = null;
62cdf0e10cSrcweir     XAccessibleContext testObject = null;
63cdf0e10cSrcweir     XWindow xWindow = null;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     /**
66cdf0e10cSrcweir     * Sleeps for a certain time.
67cdf0e10cSrcweir     * @param Thread is sleeping for this time in milliseconds.
68cdf0e10cSrcweir     */
shortWait()69cdf0e10cSrcweir     private void shortWait() {
70cdf0e10cSrcweir         try {
71cdf0e10cSrcweir             Thread.sleep(500);
72cdf0e10cSrcweir         } catch (InterruptedException e) {
73cdf0e10cSrcweir             System.out.println("While waiting :" + e) ;
74cdf0e10cSrcweir         }
75cdf0e10cSrcweir     }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     /**
78cdf0e10cSrcweir      * Check document types
79cdf0e10cSrcweir      */
80cdf0e10cSrcweir     @Test
checkDocs()81cdf0e10cSrcweir     public void checkDocs()
82cdf0e10cSrcweir     {
83cdf0e10cSrcweir         checkWriterDoc();
84cdf0e10cSrcweir         checkMathDoc();
85cdf0e10cSrcweir         checkDrawDoc();
86cdf0e10cSrcweir         checkImpressDoc();
87cdf0e10cSrcweir         checkCalcDoc();
88cdf0e10cSrcweir     }
89cdf0e10cSrcweir 
getMSF()90cdf0e10cSrcweir     private XMultiServiceFactory getMSF()
91cdf0e10cSrcweir     {
92cdf0e10cSrcweir         final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
93cdf0e10cSrcweir         return xMSF1;
94cdf0e10cSrcweir     }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     /**
97cdf0e10cSrcweir      * Test the interfaces on a writer document
98cdf0e10cSrcweir      */
checkWriterDoc()99cdf0e10cSrcweir     private void checkWriterDoc() {
100cdf0e10cSrcweir         xMSF = getMSF();
101cdf0e10cSrcweir         SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
102cdf0e10cSrcweir         XTextDocument xTextDoc = null;
103cdf0e10cSrcweir         try {
104cdf0e10cSrcweir             System.out.println("****** Open a new writer document");
105cdf0e10cSrcweir             xTextDoc = xSOF.createTextDoc("_blank");
106cdf0e10cSrcweir             getTestObject();
107cdf0e10cSrcweir         }
108cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
109cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
110cdf0e10cSrcweir         }
111cdf0e10cSrcweir         runAllInterfaceTests();
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         if (xTextDoc != null) {
114cdf0e10cSrcweir             XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
115cdf0e10cSrcweir             try {
116cdf0e10cSrcweir                 xClose.close(false);
117cdf0e10cSrcweir             }
118cdf0e10cSrcweir             catch(com.sun.star.util.CloseVetoException e) {
119cdf0e10cSrcweir                 Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
120cdf0e10cSrcweir             }
121cdf0e10cSrcweir         }
122cdf0e10cSrcweir     }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     /**
125cdf0e10cSrcweir      * Test the interfaces on a math document
126cdf0e10cSrcweir      */
checkMathDoc()127cdf0e10cSrcweir     public void checkMathDoc() {
128cdf0e10cSrcweir         xMSF = getMSF();
129cdf0e10cSrcweir         SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
130cdf0e10cSrcweir         XComponent xMathDoc = null;
131cdf0e10cSrcweir         try {
132cdf0e10cSrcweir             System.out.println("****** Open a new math document");
133cdf0e10cSrcweir             xMathDoc = xSOF.createMathDoc("_blank");
134cdf0e10cSrcweir             getTestObject();
135cdf0e10cSrcweir         }
136cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
137cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
138cdf0e10cSrcweir         }
139cdf0e10cSrcweir         runAllInterfaceTests();
140cdf0e10cSrcweir 
141cdf0e10cSrcweir         if (xMathDoc != null) {
142cdf0e10cSrcweir             XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
143cdf0e10cSrcweir             try {
144cdf0e10cSrcweir                 xClose.close(false);
145cdf0e10cSrcweir             }
146cdf0e10cSrcweir             catch(com.sun.star.util.CloseVetoException e) {
147cdf0e10cSrcweir                 Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
148cdf0e10cSrcweir             }
149cdf0e10cSrcweir         }
150cdf0e10cSrcweir     }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     /**
153cdf0e10cSrcweir      * Test the interfaces on a draw document
154cdf0e10cSrcweir      */
checkDrawDoc()155cdf0e10cSrcweir     public void checkDrawDoc() {
156cdf0e10cSrcweir         xMSF = getMSF();
157cdf0e10cSrcweir         SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
158cdf0e10cSrcweir         XComponent xDrawDoc = null;
159cdf0e10cSrcweir         try {
160cdf0e10cSrcweir             System.out.println("****** Open a new draw document");
161cdf0e10cSrcweir             xDrawDoc = xSOF.createDrawDoc("_blank");
162cdf0e10cSrcweir             getTestObject();
163cdf0e10cSrcweir         }
164cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
165cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
166cdf0e10cSrcweir         }
167cdf0e10cSrcweir         runAllInterfaceTests();
168cdf0e10cSrcweir 
169cdf0e10cSrcweir         if (xDrawDoc != null) {
170cdf0e10cSrcweir             XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
171cdf0e10cSrcweir             try {
172cdf0e10cSrcweir                 xClose.close(false);
173cdf0e10cSrcweir             }
174cdf0e10cSrcweir             catch(com.sun.star.util.CloseVetoException e) {
175cdf0e10cSrcweir                 Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
176cdf0e10cSrcweir             }
177cdf0e10cSrcweir         }
178cdf0e10cSrcweir     }
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     /**
181cdf0e10cSrcweir      * Test the interfaces on an impress document
182cdf0e10cSrcweir      */
checkImpressDoc()183cdf0e10cSrcweir     public void checkImpressDoc() {
184cdf0e10cSrcweir         xMSF = getMSF();
185cdf0e10cSrcweir         SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
186cdf0e10cSrcweir         XComponent xImpressDoc = null;
187cdf0e10cSrcweir         try {
188cdf0e10cSrcweir             System.out.println("****** Open a new impress document");
189cdf0e10cSrcweir             xImpressDoc = xSOF.createImpressDoc("_blank");
190cdf0e10cSrcweir             getTestObject();
191cdf0e10cSrcweir         }
192cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
193cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
194cdf0e10cSrcweir         }
195cdf0e10cSrcweir         runAllInterfaceTests();
196cdf0e10cSrcweir 
197cdf0e10cSrcweir         if (xImpressDoc != null) {
198cdf0e10cSrcweir             XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
199cdf0e10cSrcweir             try {
200cdf0e10cSrcweir                 xClose.close(false);
201cdf0e10cSrcweir             }
202cdf0e10cSrcweir             catch(com.sun.star.util.CloseVetoException e) {
203cdf0e10cSrcweir                 Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
204cdf0e10cSrcweir             }
205cdf0e10cSrcweir         }
206cdf0e10cSrcweir     }
207cdf0e10cSrcweir     /**
208cdf0e10cSrcweir      * Test the interfaces on an calc document
209cdf0e10cSrcweir      */
checkCalcDoc()210cdf0e10cSrcweir     public void checkCalcDoc() {
211cdf0e10cSrcweir         xMSF = getMSF();
212cdf0e10cSrcweir         SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
213cdf0e10cSrcweir         XSpreadsheetDocument xSpreadsheetDoc = null;
214cdf0e10cSrcweir         try {
215cdf0e10cSrcweir             System.out.println("****** Open a new calc document");
216cdf0e10cSrcweir             xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
217cdf0e10cSrcweir             shortWait();
218cdf0e10cSrcweir             getTestObject();
219cdf0e10cSrcweir         }
220cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
221cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
222cdf0e10cSrcweir         }
223cdf0e10cSrcweir         runAllInterfaceTests();
224cdf0e10cSrcweir 
225cdf0e10cSrcweir         if (xSpreadsheetDoc != null) {
226cdf0e10cSrcweir             XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
227cdf0e10cSrcweir             try {
228cdf0e10cSrcweir                 xClose.close(false);
229cdf0e10cSrcweir             }
230cdf0e10cSrcweir             catch(com.sun.star.util.CloseVetoException e) {
231cdf0e10cSrcweir                 Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
232cdf0e10cSrcweir             }
233cdf0e10cSrcweir         }
234cdf0e10cSrcweir     }
235cdf0e10cSrcweir 
getTestObject()236cdf0e10cSrcweir     public void getTestObject() {
237cdf0e10cSrcweir         try {
238cdf0e10cSrcweir             XInterface xIfc = (XInterface) xMSF.createInstance(
239cdf0e10cSrcweir                                             "com.sun.star.awt.Toolkit") ;
240cdf0e10cSrcweir             XExtendedToolkit tk =
241cdf0e10cSrcweir                         UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
242cdf0e10cSrcweir 
243cdf0e10cSrcweir             shortWait();
244cdf0e10cSrcweir             xWindow = UnoRuntime.queryInterface(
245cdf0e10cSrcweir                                     XWindow.class,tk.getActiveTopWindow());
246cdf0e10cSrcweir 
247cdf0e10cSrcweir             shortWait();
248cdf0e10cSrcweir             XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
249cdf0e10cSrcweir             XAccessibleContext parentContext = null;
250cdf0e10cSrcweir 
251cdf0e10cSrcweir             System.out.println("Get the accessible status bar.");
252cdf0e10cSrcweir             parentContext = AccessibilityTools.getAccessibleObjectForRole(
253cdf0e10cSrcweir                                         xRoot, AccessibleRole.STATUS_BAR, "");
254cdf0e10cSrcweir             shortWait();
255cdf0e10cSrcweir             if ( parentContext == null ) {
256cdf0e10cSrcweir                 fail("Could not create a test object.");
257cdf0e10cSrcweir             }
258cdf0e10cSrcweir             System.out.println("...OK.");
259cdf0e10cSrcweir 
260cdf0e10cSrcweir             testObject=parentContext;
261cdf0e10cSrcweir         }
262cdf0e10cSrcweir         catch(com.sun.star.uno.Exception e) {
263cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
264cdf0e10cSrcweir         }
265cdf0e10cSrcweir         catch(Throwable t) {
266cdf0e10cSrcweir             Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", t );
267cdf0e10cSrcweir         }
268cdf0e10cSrcweir     }
269cdf0e10cSrcweir 
runAllInterfaceTests()270cdf0e10cSrcweir     public void runAllInterfaceTests() {
271cdf0e10cSrcweir         int count = testObject.getAccessibleChildCount();
272cdf0e10cSrcweir         System.out.println("*****");
273cdf0e10cSrcweir         System.out.println("**** Found items to test: " + count);
274cdf0e10cSrcweir         for (int i=0;i<count;i++){
275cdf0e10cSrcweir             System.out.println("**** Now testing StatusBarItem " + i + ".");
276cdf0e10cSrcweir             XAccessible object = null;
277cdf0e10cSrcweir             try {
278cdf0e10cSrcweir                 object = testObject.getAccessibleChild(i);
279cdf0e10cSrcweir             }
280cdf0e10cSrcweir             catch(com.sun.star.lang.IndexOutOfBoundsException e) {
281cdf0e10cSrcweir                 System.out.println("* Cannot get item Nr: " + i);
282cdf0e10cSrcweir                 continue;
283cdf0e10cSrcweir             }
284cdf0e10cSrcweir             XServiceInfo xSI = UnoRuntime.queryInterface(
285cdf0e10cSrcweir                                         XServiceInfo.class,object);
286cdf0e10cSrcweir             String[] services = xSI.getSupportedServiceNames();
287cdf0e10cSrcweir             System.out.println("* Implementation Name: " + xSI.getImplementationName());
288cdf0e10cSrcweir             String accName = object.getAccessibleContext().getAccessibleName();
289cdf0e10cSrcweir             System.out.println("* Accessible Name: " + accName);
290cdf0e10cSrcweir             for (int j=0; i<services.length; i++)
291cdf0e10cSrcweir             {
292cdf0e10cSrcweir                 System.out.println("* ServiceName "+i+": "+ services[j]);
293cdf0e10cSrcweir             }
294cdf0e10cSrcweir             System.out.println("*****");
295cdf0e10cSrcweir 
296cdf0e10cSrcweir             System.out.println("*** Now testing XAccessibleComponent ***");
297cdf0e10cSrcweir             _XAccessibleComponent _xAccCompTest =
298cdf0e10cSrcweir                                     new _XAccessibleComponent(object);
299cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
300cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::contains", _xAccCompTest._containsPoint());
301cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
302cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
303cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
304cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
305cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
306cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::getSize", _xAccCompTest._getSize());
307cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
308cdf0e10cSrcweir 
309cdf0e10cSrcweir             System.out.println("*** Now testing XAccessibleContext ***");
310cdf0e10cSrcweir             _XAccessibleContext _xAccContext =
311cdf0e10cSrcweir                                     new _XAccessibleContext(object);
312cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
313cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
314cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
315cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
316cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
317cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
318cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
319cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
320cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
321cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleContext::getLocale", _xAccContext._getLocale());
322cdf0e10cSrcweir 
323cdf0e10cSrcweir             System.out.println("*** Now testing XAccessibleExtendedComponent ***");
324cdf0e10cSrcweir             _XAccessibleExtendedComponent _xAccExtComp =
325cdf0e10cSrcweir                                     new _XAccessibleExtendedComponent(object);
326cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
327cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
328cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
329cdf0e10cSrcweir 
330cdf0e10cSrcweir             System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
331cdf0e10cSrcweir             _XAccessibleEventBroadcaster _xAccEvBcast =
332cdf0e10cSrcweir                                     new _XAccessibleEventBroadcaster(object, xWindow);
333cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
334cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
335cdf0e10cSrcweir 
336cdf0e10cSrcweir             System.out.println("*** Now testing XAccessibleText ***");
337cdf0e10cSrcweir             _XAccessibleText _xAccText =
338cdf0e10cSrcweir                                     new _XAccessibleText(object, xMSF, "true");
339cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getText", _xAccText._getText());
340cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getCharacterCount", _xAccText._getCharacterCount());
341cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getCharacterBounds", _xAccText._getCharacterBounds());
342cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::setSelection", _xAccText._setSelection());
343cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::copyText", _xAccText._copyText());
344cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getCharacter", _xAccText._getCharacter());
345cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getCharacterAttributes", _xAccText._getCharacterAttributes());
346cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getIndexAtPoint", _xAccText._getIndexAtPoint());
347cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getSelectedText", _xAccText._getSelectedText());
348cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getSelectionEnd", _xAccText._getSelectionEnd());
349cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getSelectionStart", _xAccText._getSelectionStart());
350cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getTextAtIndex", _xAccText._getTextAtIndex());
351cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getTextBeforeIndex", _xAccText._getTextBeforeIndex());
352cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getBehindIndex", _xAccText._getTextBehindIndex());
353cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getTextRange", _xAccText._getTextRange());
354cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::setCaretPosition", _xAccText._setCaretPosition());
355cdf0e10cSrcweir             assertTrue("failed: "+accName+" - XAccessibleText::getCaretPosition", _xAccText._getCaretPosition());
356cdf0e10cSrcweir         }
357cdf0e10cSrcweir     }
358cdf0e10cSrcweir 
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 
setUpConnection()362cdf0e10cSrcweir     @BeforeClass public static void setUpConnection() throws Exception {
363cdf0e10cSrcweir         System.out.println("setUpConnection()");
364cdf0e10cSrcweir         connection.setUp();
365cdf0e10cSrcweir     }
366cdf0e10cSrcweir 
tearDownConnection()367cdf0e10cSrcweir     @AfterClass public static void tearDownConnection()
368cdf0e10cSrcweir         throws InterruptedException, com.sun.star.uno.Exception
369cdf0e10cSrcweir     {
370cdf0e10cSrcweir         System.out.println("tearDownConnection()");
371cdf0e10cSrcweir         connection.tearDown();
372cdf0e10cSrcweir     }
373cdf0e10cSrcweir 
374cdf0e10cSrcweir     private static final OfficeConnection connection = new OfficeConnection();
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 
377cdf0e10cSrcweir }
378