2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 import com
.sun
.star
.beans
.NamedValue
;
22 import java
.io
.PrintWriter
;
25 import lib
.StatusException
;
27 import lib
.TestEnvironment
;
28 import lib
.TestParameters
;
31 import com
.sun
.star
.container
.XNameAccess
;
32 import com
.sun
.star
.uno
.UnoRuntime
;
33 import com
.sun
.star
.uno
.XInterface
;
36 * Test for object which is represented by service
37 * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
39 * Object implements the following interfaces :
41 * <li> <code>com::sun::star::container::XNameAccess</code></li>
42 * <li> <code>com::sun::star::container::XElementAccess</code></li>
43 * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
46 * @see com.sun.star.container.XNameAccess
47 * @see com.sun.star.container.XElementAccess
48 * @see com.sun.star.lang.XMultiServiceFactory
49 * @see ifc.container._XNameAccess
50 * @see ifc.container._XElementAccess
51 * @see ifc.lang._XMultiServiceFactory
53 public class FrameLoaderFactory
extends TestCase
{
56 * Creating a Testenvironment for the interfaces to be tested.
57 * Creates an instance of the service
58 * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
61 protected TestEnvironment createTestEnvironment
62 (TestParameters Param
, PrintWriter log
) {
63 XInterface oObj
= null;
64 Object oInterface
= null ;
67 oInterface
= Param
.getMSF().createInstance
68 ("com.sun.star.frame.FrameLoaderFactory") ;
69 } catch (com
.sun
.star
.uno
.Exception e
) {
70 log
.println("Couldn't get service");
71 e
.printStackTrace(log
);
72 throw new StatusException("Couldn't get FrameLoaderFactory", e
);
75 if (oInterface
== null) {
76 log
.println("Service wasn't created") ;
77 throw new StatusException(Status
.failed("Service wasn't created")) ;
80 oObj
= (XInterface
) oInterface
;
81 log
.println("ImplName: "+utils
.getImplName(oObj
));
83 log
.println( "creating a new environment for object" );
84 TestEnvironment tEnv
= new TestEnvironment( oObj
);
86 XNameAccess xNA
= UnoRuntime
.queryInterface
87 (XNameAccess
.class, oObj
);
88 tEnv
.addObjRelation("XMSF.serviceNames", xNA
.getElementNames());
90 // com.sun.star.container.XContainerQuery
91 NamedValue
[] querySequenze
= new NamedValue
[1];
92 NamedValue query
= new NamedValue();
94 query
.Value
= "com.sun.star.frame.Bibliography";
95 querySequenze
[0] = query
;
97 tEnv
.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties",
101 } // finish method getTestEnvironment