bump product version to 5.0.4.1
[LibreOffice.git] / qadevOOo / tests / java / mod / _sw / SwXAutoTextContainer.java
blobeac6e2131171ed03cb49008250d1b23fddfba698
1 /*
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 .
19 package mod._sw;
21 import java.io.PrintWriter;
23 import lib.StatusException;
24 import lib.TestCase;
25 import lib.TestEnvironment;
26 import lib.TestParameters;
28 import com.sun.star.lang.XMultiServiceFactory;
29 import com.sun.star.text.XAutoTextContainer;
30 import com.sun.star.uno.UnoRuntime;
32 /**
33 * Test for object which is represented by service
34 * <code>com.sun.star.text.AutoTextContainer</code>.<p>
35 * Object implements the following interfaces :
36 * <ul>
37 * <li> <code>com::sun::star::container::XNameAccess</code></li>
38 * <li> <code>com::sun::star::container::XElementAccess</code></li>
39 * <li> <code>com::sun::star::text::XAutoTextContainer</code></li>
40 * </ul>
41 * @see com.sun.star.container.XNameAccess
42 * @see com.sun.star.container.XElementAccess
43 * @see com.sun.star.text.XAutoTextContainer
44 * @see com.sun.star.text.AutoTextContainer
45 * @see ifc.container._XNameAccess
46 * @see ifc.container._XElementAccess
47 * @see ifc.text._XAutoTextContainer
49 public class SwXAutoTextContainer extends TestCase {
51 /**
52 * Creating a Testenvironment for the interfaces to be tested.
53 * Creates an instance of the service
54 * <code>com.sun.star.text.AutoTextContainer</code>.<p>
56 @Override
57 public synchronized TestEnvironment createTestEnvironment(
58 TestParameters Param, PrintWriter log ) throws StatusException {
59 XAutoTextContainer oContainer = null;
61 // creation of testobject here
62 // first we write what we are intend to do to log file
63 log.println("creating a AutoTextContainer");
64 try {
65 XMultiServiceFactory myMSF = Param.getMSF();
66 Object oInst = myMSF.createInstance
67 ("com.sun.star.text.AutoTextContainer");
68 oContainer = UnoRuntime.queryInterface
69 (XAutoTextContainer.class,oInst);
70 } catch (com.sun.star.uno.Exception e) {
71 e.printStackTrace(log);
72 throw new StatusException("Couldn't create AutoTextContainer", e);
75 TestEnvironment tEnv = new TestEnvironment(oContainer);
77 return tEnv;
80 } // finish class SwXAutoTextcontainer