1ef39d40dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3ef39d40dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4ef39d40dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5ef39d40dSAndrew Rist  * distributed with this work for additional information
6ef39d40dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7ef39d40dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8ef39d40dSAndrew Rist  * "License"); you may not use this file except in compliance
9ef39d40dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10ef39d40dSAndrew Rist  *
11ef39d40dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12ef39d40dSAndrew Rist  *
13ef39d40dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14ef39d40dSAndrew Rist  * software distributed under the License is distributed on an
15ef39d40dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ef39d40dSAndrew Rist  * KIND, either express or implied.  See the License for the
17ef39d40dSAndrew Rist  * specific language governing permissions and limitations
18ef39d40dSAndrew Rist  * under the License.
19ef39d40dSAndrew Rist  *
20ef39d40dSAndrew Rist  *************************************************************/
21ef39d40dSAndrew Rist 
22ef39d40dSAndrew Rist 
23cdf0e10cSrcweir package mod._sc;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import com.sun.star.beans.XPropertySet;
26cdf0e10cSrcweir import com.sun.star.container.XIndexAccess;
27cdf0e10cSrcweir import com.sun.star.container.XNameAccess;
28cdf0e10cSrcweir import com.sun.star.container.XNamed;
29cdf0e10cSrcweir import com.sun.star.lang.XComponent;
30cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory;
31cdf0e10cSrcweir import com.sun.star.sheet.DataPilotFieldGroupInfo;
32cdf0e10cSrcweir import com.sun.star.sheet.XDataPilotDescriptor;
33cdf0e10cSrcweir import com.sun.star.sheet.XDataPilotFieldGrouping;
34cdf0e10cSrcweir import com.sun.star.sheet.XDataPilotTables;
35cdf0e10cSrcweir import com.sun.star.sheet.XDataPilotTablesSupplier;
36cdf0e10cSrcweir import com.sun.star.sheet.XSpreadsheet;
37cdf0e10cSrcweir import com.sun.star.sheet.XSpreadsheetDocument;
38cdf0e10cSrcweir import com.sun.star.sheet.XSpreadsheets;
39cdf0e10cSrcweir import com.sun.star.table.CellAddress;
40cdf0e10cSrcweir import com.sun.star.table.CellRangeAddress;
41cdf0e10cSrcweir import com.sun.star.uno.AnyConverter;
42cdf0e10cSrcweir import com.sun.star.uno.Type;
43cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
44cdf0e10cSrcweir import com.sun.star.uno.XInterface;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir import java.io.PrintWriter;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir import lib.StatusException;
49cdf0e10cSrcweir import lib.TestCase;
50cdf0e10cSrcweir import lib.TestEnvironment;
51cdf0e10cSrcweir import lib.TestParameters;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir import util.SOfficeFactory;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 
57cdf0e10cSrcweir public class ScDataPilotFieldGroupItemObj extends TestCase
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     static XSpreadsheetDocument xSheetDoc = null;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     /**
62cdf0e10cSrcweir      * A field is filled some values. This integer determines the size of the
63cdf0e10cSrcweir      * field in x and y direction.
64cdf0e10cSrcweir      */
65cdf0e10cSrcweir     private int mMaxFieldIndex = 6;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     /**
68cdf0e10cSrcweir      * Creates Spreadsheet document.
69cdf0e10cSrcweir      */
initialize(TestParameters tParam, PrintWriter log)70cdf0e10cSrcweir     protected void initialize (TestParameters tParam, PrintWriter log)
71cdf0e10cSrcweir     {
72cdf0e10cSrcweir         SOfficeFactory SOF = SOfficeFactory.getFactory (
73cdf0e10cSrcweir             (XMultiServiceFactory) tParam.getMSF ());
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         try
76cdf0e10cSrcweir         {
77cdf0e10cSrcweir             log.println ("creating a Spreadsheet document");
78cdf0e10cSrcweir             xSheetDoc = SOF.createCalcDoc (null);
79cdf0e10cSrcweir         }
80cdf0e10cSrcweir         catch (com.sun.star.uno.Exception e)
81cdf0e10cSrcweir         {
82*30acf5e8Spfg             // Some exception occured.FAILED
83cdf0e10cSrcweir             e.printStackTrace (log);
84cdf0e10cSrcweir             throw new StatusException ("Couldn't create document", e);
85cdf0e10cSrcweir         }
86cdf0e10cSrcweir     }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     /**
89cdf0e10cSrcweir      * Disposes Spreadsheet document.
90cdf0e10cSrcweir      */
cleanup(TestParameters tParam, PrintWriter log)91cdf0e10cSrcweir     protected void cleanup (TestParameters tParam, PrintWriter log)
92cdf0e10cSrcweir     {
93cdf0e10cSrcweir         log.println ("    disposing xSheetDoc ");
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         XComponent oComp = (XComponent) UnoRuntime.queryInterface (
96cdf0e10cSrcweir             XComponent.class, xSheetDoc);
97cdf0e10cSrcweir         util.DesktopTools.closeDoc (oComp);
98cdf0e10cSrcweir     }
99cdf0e10cSrcweir 
createTestEnvironment(TestParameters Param, PrintWriter log)100cdf0e10cSrcweir     protected synchronized TestEnvironment createTestEnvironment (TestParameters Param,
101cdf0e10cSrcweir         PrintWriter log)
102cdf0e10cSrcweir     {
103cdf0e10cSrcweir         XInterface oObj = null;
104cdf0e10cSrcweir         XInterface datapilotfield = null;
105cdf0e10cSrcweir         XInterface groups = null;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         // creation of testobject here
108cdf0e10cSrcweir         // first we write what we are intend to do to log file
109cdf0e10cSrcweir         log.println ("Creating a test environment");
110cdf0e10cSrcweir 
111cdf0e10cSrcweir         // the cell range
112cdf0e10cSrcweir         CellRangeAddress sCellRangeAdress = new CellRangeAddress ();
113cdf0e10cSrcweir         sCellRangeAdress.Sheet = 0;
114cdf0e10cSrcweir         sCellRangeAdress.StartColumn = 1;
115cdf0e10cSrcweir         sCellRangeAdress.StartRow = 0;
116cdf0e10cSrcweir         sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
117cdf0e10cSrcweir         sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         // position of the data pilot table
120cdf0e10cSrcweir         CellAddress sCellAdress = new CellAddress ();
121cdf0e10cSrcweir         sCellAdress.Sheet = 0;
122cdf0e10cSrcweir         sCellAdress.Column = 7;
123cdf0e10cSrcweir         sCellAdress.Row = 8;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir         log.println ("Getting a sheet");
126cdf0e10cSrcweir 
127cdf0e10cSrcweir         XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets ();
128cdf0e10cSrcweir         XSpreadsheet oSheet = null;
129cdf0e10cSrcweir         XSpreadsheet oSheet2 = null;
130cdf0e10cSrcweir         XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface (
131cdf0e10cSrcweir             XIndexAccess.class, xSpreadsheets);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         try
134cdf0e10cSrcweir         {
135cdf0e10cSrcweir             oSheet = (XSpreadsheet) AnyConverter.toObject (
136cdf0e10cSrcweir                 new Type (XSpreadsheet.class),
137cdf0e10cSrcweir                 oIndexAccess.getByIndex (0));
138cdf0e10cSrcweir             oSheet2 = (XSpreadsheet) AnyConverter.toObject (
139cdf0e10cSrcweir                 new Type (XSpreadsheet.class),
140cdf0e10cSrcweir                 oIndexAccess.getByIndex (1));
141cdf0e10cSrcweir         }
142cdf0e10cSrcweir         catch (com.sun.star.lang.WrappedTargetException e)
143cdf0e10cSrcweir         {
144cdf0e10cSrcweir             e.printStackTrace ();
145cdf0e10cSrcweir             throw new StatusException ("Couldn't get a spreadsheet", e);
146cdf0e10cSrcweir         }
147cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
148cdf0e10cSrcweir         {
149cdf0e10cSrcweir             e.printStackTrace ();
150cdf0e10cSrcweir             throw new StatusException ("Couldn't get a spreadsheet", e);
151cdf0e10cSrcweir         }
152cdf0e10cSrcweir         catch (com.sun.star.lang.IllegalArgumentException e)
153cdf0e10cSrcweir         {
154cdf0e10cSrcweir             e.printStackTrace ();
155cdf0e10cSrcweir             throw new StatusException ("Couldn't get a spreadsheet", e);
156cdf0e10cSrcweir         }
157cdf0e10cSrcweir 
158cdf0e10cSrcweir         try
159cdf0e10cSrcweir         {
160cdf0e10cSrcweir             log.println ("Filling a table");
161cdf0e10cSrcweir 
162cdf0e10cSrcweir             for (int i = 1; i < mMaxFieldIndex; i++)
163cdf0e10cSrcweir             {
164cdf0e10cSrcweir                 oSheet.getCellByPosition (i, 0).setFormula ("Col" + i);
165cdf0e10cSrcweir                 oSheet.getCellByPosition (0, i).setFormula ("Row" + i);
166cdf0e10cSrcweir                 oSheet2.getCellByPosition (i, 0).setFormula ("Col" + i);
167cdf0e10cSrcweir                 oSheet2.getCellByPosition (0, i).setFormula ("Row" + i);
168cdf0e10cSrcweir             }
169cdf0e10cSrcweir 
170cdf0e10cSrcweir             for (int i = 1; i < mMaxFieldIndex; i++)
171cdf0e10cSrcweir             {
172cdf0e10cSrcweir                 for (int j = 1; j < mMaxFieldIndex; j++)
173cdf0e10cSrcweir                 {
174cdf0e10cSrcweir                     oSheet.getCellByPosition (i, j).setValue (i * (j + 1));
175cdf0e10cSrcweir                     oSheet2.getCellByPosition (i, j).setValue (i * (j + 2));
176cdf0e10cSrcweir                 }
177cdf0e10cSrcweir             }
178cdf0e10cSrcweir 
179cdf0e10cSrcweir             oSheet.getCellByPosition (1, 1).setFormula ("aName");
180cdf0e10cSrcweir             oSheet.getCellByPosition (1, 2).setFormula ("otherName");
181cdf0e10cSrcweir             oSheet.getCellByPosition (1, 3).setFormula ("una");
182cdf0e10cSrcweir             oSheet.getCellByPosition (1, 4).setFormula ("otherName");
183cdf0e10cSrcweir             oSheet.getCellByPosition (1, 5).setFormula ("somethingelse");
184cdf0e10cSrcweir 
185cdf0e10cSrcweir         }
186cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
187cdf0e10cSrcweir         {
188cdf0e10cSrcweir             e.printStackTrace ();
189cdf0e10cSrcweir             throw new StatusException ("Couldn't fill some cells", e);
190cdf0e10cSrcweir         }
191cdf0e10cSrcweir 
192cdf0e10cSrcweir         // change a value of a cell and check the change in the data pilot
193cdf0e10cSrcweir         // (for the XDataPilotTable.refresh() test)
194cdf0e10cSrcweir         Object oChangeCell = null;
195cdf0e10cSrcweir         Object oCheckCell = null;
196cdf0e10cSrcweir         Integer aChangeValue = null;
197cdf0e10cSrcweir 
198cdf0e10cSrcweir         try
199cdf0e10cSrcweir         {
200cdf0e10cSrcweir             // cell of data
201cdf0e10cSrcweir             oChangeCell = oSheet.getCellByPosition (1, 5);
202cdf0e10cSrcweir 
203cdf0e10cSrcweir             int x = sCellAdress.Column;
204cdf0e10cSrcweir             int y = sCellAdress.Row + 3;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 
207cdf0e10cSrcweir             // cell of the data pilot output
208cdf0e10cSrcweir             oCheckCell = oSheet.getCellByPosition (x, y);
209cdf0e10cSrcweir             aChangeValue = new Integer (27);
210cdf0e10cSrcweir         }
211cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
212cdf0e10cSrcweir         {
213cdf0e10cSrcweir             e.printStackTrace ();
214cdf0e10cSrcweir             throw new StatusException ("Couldn't get cells for changeing.", e);
215cdf0e10cSrcweir         }
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 
218cdf0e10cSrcweir         // create the test objects
219cdf0e10cSrcweir         log.println ("Getting test objects");
220cdf0e10cSrcweir 
221cdf0e10cSrcweir         XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface (
222cdf0e10cSrcweir             XDataPilotTablesSupplier.class,
223cdf0e10cSrcweir             oSheet);
224cdf0e10cSrcweir         XDataPilotTables DPT = DPTS.getDataPilotTables ();
225cdf0e10cSrcweir         XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor ();
226cdf0e10cSrcweir         DPDsc.setSourceRange (sCellRangeAdress);
227cdf0e10cSrcweir 
228cdf0e10cSrcweir         XPropertySet fieldPropSet = null;
229cdf0e10cSrcweir 
230cdf0e10cSrcweir         try
231cdf0e10cSrcweir         {
232cdf0e10cSrcweir             Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0);
233cdf0e10cSrcweir             fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
234cdf0e10cSrcweir                 XPropertySet.class, oDataPilotField);
235cdf0e10cSrcweir             fieldPropSet.setPropertyValue ("Orientation",
236cdf0e10cSrcweir                 com.sun.star.sheet.DataPilotFieldOrientation.ROW);
237cdf0e10cSrcweir             oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1);
238cdf0e10cSrcweir             fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
239cdf0e10cSrcweir                 XPropertySet.class, oDataPilotField);
240cdf0e10cSrcweir             fieldPropSet.setPropertyValue ("Function",
241cdf0e10cSrcweir                 com.sun.star.sheet.GeneralFunction.SUM);
242cdf0e10cSrcweir             fieldPropSet.setPropertyValue ("Orientation",
243cdf0e10cSrcweir                 com.sun.star.sheet.DataPilotFieldOrientation.DATA);
244cdf0e10cSrcweir             oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2);
245cdf0e10cSrcweir             fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
246cdf0e10cSrcweir                 XPropertySet.class, oDataPilotField);
247cdf0e10cSrcweir             fieldPropSet.setPropertyValue ("Orientation",
248cdf0e10cSrcweir                 com.sun.star.sheet.DataPilotFieldOrientation.COLUMN);
249cdf0e10cSrcweir         }
250cdf0e10cSrcweir         catch (com.sun.star.lang.WrappedTargetException e)
251cdf0e10cSrcweir         {
252cdf0e10cSrcweir             e.printStackTrace ();
253cdf0e10cSrcweir             throw new StatusException ("Couldn't create a test environment", e);
254cdf0e10cSrcweir         }
255cdf0e10cSrcweir         catch (com.sun.star.lang.IllegalArgumentException e)
256cdf0e10cSrcweir         {
257cdf0e10cSrcweir             e.printStackTrace ();
258cdf0e10cSrcweir             throw new StatusException ("Couldn't create a test environment", e);
259cdf0e10cSrcweir         }
260cdf0e10cSrcweir         catch (com.sun.star.beans.PropertyVetoException e)
261cdf0e10cSrcweir         {
262cdf0e10cSrcweir             e.printStackTrace ();
263cdf0e10cSrcweir             throw new StatusException ("Couldn't create a test environment", e);
264cdf0e10cSrcweir         }
265cdf0e10cSrcweir         catch (com.sun.star.beans.UnknownPropertyException e)
266cdf0e10cSrcweir         {
267cdf0e10cSrcweir             e.printStackTrace ();
268cdf0e10cSrcweir             throw new StatusException ("Couldn't create a test environment", e);
269cdf0e10cSrcweir         }
270cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
271cdf0e10cSrcweir         {
272cdf0e10cSrcweir             e.printStackTrace ();
273cdf0e10cSrcweir             throw new StatusException ("Couldn't create a test environment", e);
274cdf0e10cSrcweir         }
275cdf0e10cSrcweir 
276cdf0e10cSrcweir         log.println ("Insert the DataPilotTable");
277cdf0e10cSrcweir 
278cdf0e10cSrcweir         if (DPT.hasByName ("DataPilotTable"))
279cdf0e10cSrcweir         {
280cdf0e10cSrcweir             DPT.removeByName ("DataPilotTable");
281cdf0e10cSrcweir         }
282cdf0e10cSrcweir 
283cdf0e10cSrcweir         DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc);
284cdf0e10cSrcweir         XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
285cdf0e10cSrcweir         XIndexAccess IA = null;
286cdf0e10cSrcweir         try
287cdf0e10cSrcweir         {
288cdf0e10cSrcweir             XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
289cdf0e10cSrcweir             IA = xDPT.getRowFields ();
290cdf0e10cSrcweir             //getSRange(IA);
291cdf0e10cSrcweir             System.out.println ("COUNT: "+IA.getCount ());
292cdf0e10cSrcweir             datapilotfield = (XInterface) AnyConverter.toObject (
293cdf0e10cSrcweir                 new Type (XInterface.class), IA.getByIndex (0));
294cdf0e10cSrcweir         }
295cdf0e10cSrcweir         catch (com.sun.star.lang.WrappedTargetException e)
296cdf0e10cSrcweir         {
297cdf0e10cSrcweir             e.printStackTrace ();
298cdf0e10cSrcweir             throw new StatusException ("Couldn't get data pilot field", e);
299cdf0e10cSrcweir         }
300cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
301cdf0e10cSrcweir         {
302cdf0e10cSrcweir             e.printStackTrace ();
303cdf0e10cSrcweir             throw new StatusException ("Couldn't get data pilot field", e);
304cdf0e10cSrcweir         }
305cdf0e10cSrcweir         catch (com.sun.star.lang.IllegalArgumentException e)
306cdf0e10cSrcweir         {
307cdf0e10cSrcweir             e.printStackTrace ();
308cdf0e10cSrcweir             throw new StatusException ("Couldn't get data pilot field", e);
309cdf0e10cSrcweir         }
310cdf0e10cSrcweir 
311cdf0e10cSrcweir         try
312cdf0e10cSrcweir         {
313cdf0e10cSrcweir             XDataPilotFieldGrouping  dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield);
314cdf0e10cSrcweir             String[] elements = new String[]{"aName","otherName"};
315cdf0e10cSrcweir             dpfg.createNameGroup (elements);
316cdf0e10cSrcweir             DataPilotFieldGroupInfo dpgi=null;
317cdf0e10cSrcweir             xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
318cdf0e10cSrcweir         try
319cdf0e10cSrcweir         {
320cdf0e10cSrcweir             XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
321cdf0e10cSrcweir             IA = xDPT.getRowFields ();
322cdf0e10cSrcweir         }
323cdf0e10cSrcweir         catch (com.sun.star.lang.WrappedTargetException e)
324cdf0e10cSrcweir         {
325cdf0e10cSrcweir             e.printStackTrace ();
326cdf0e10cSrcweir             throw new StatusException ("Couldn't get data pilot field", e);
327cdf0e10cSrcweir         }
328cdf0e10cSrcweir         catch (com.sun.star.lang.IndexOutOfBoundsException e)
329cdf0e10cSrcweir         {
330cdf0e10cSrcweir             e.printStackTrace ();
331cdf0e10cSrcweir             throw new StatusException ("Couldn't get data pilot field", e);
332cdf0e10cSrcweir         }
333cdf0e10cSrcweir             for (int i=0;i<IA.getCount ();i++)
334cdf0e10cSrcweir             {
335cdf0e10cSrcweir                 datapilotfield = (XInterface) AnyConverter.toObject (
336cdf0e10cSrcweir                     new Type (XInterface.class), IA.getByIndex (i));
337cdf0e10cSrcweir                 XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i));
338cdf0e10cSrcweir                 if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ())
339cdf0e10cSrcweir                 {
340cdf0e10cSrcweir                     xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield);
341cdf0e10cSrcweir                     XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i));
342cdf0e10cSrcweir                     System.out.println ("name: "+xNamed.getName ());
343cdf0e10cSrcweir                     dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo");
344cdf0e10cSrcweir                 }
345cdf0e10cSrcweir             }
346cdf0e10cSrcweir             groups = dpgi.Groups;
347cdf0e10cSrcweir             XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups);
348cdf0e10cSrcweir             XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0));
349cdf0e10cSrcweir             oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName"));
350cdf0e10cSrcweir         }
351cdf0e10cSrcweir         catch (Exception e)
352cdf0e10cSrcweir         {
353cdf0e10cSrcweir             e.printStackTrace ();
354cdf0e10cSrcweir         }
355cdf0e10cSrcweir 
356cdf0e10cSrcweir         log.println ("Creating object - " +
357cdf0e10cSrcweir             ((oObj == null) ? "FAILED" : "OK"));
358cdf0e10cSrcweir 
359cdf0e10cSrcweir         TestEnvironment tEnv = new TestEnvironment (oObj);
360cdf0e10cSrcweir 
361cdf0e10cSrcweir         log.println ("Implementationname: " + util.utils.getImplName (oObj));
362cdf0e10cSrcweir 
363cdf0e10cSrcweir         // Other parameters required for interface tests
364cdf0e10cSrcweir         return tEnv;
365cdf0e10cSrcweir     }
366cdf0e10cSrcweir 
367cdf0e10cSrcweir }
368