Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / mod / _dbaccess / ODatasourceAdministrationDialog.java
blob2f9cd51e843b56ce3e5eae4a53949c7b8051134a
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._dbaccess;
21 import java.io.PrintWriter;
23 import lib.Status;
24 import lib.StatusException;
25 import lib.TestCase;
26 import lib.TestEnvironment;
27 import lib.TestParameters;
29 import com.sun.star.uno.XInterface;
31 /**
32 * Test for object which is represented by service
33 * <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>. <p>
35 * Object implements the following interfaces :
36 * <ul>
37 * <li> <code>com::sun::star::lang::XInitialization</code></li>
38 * <li> <code>com::sun::star::ui::dialogs::XExecutableDialog</code></li>
39 * <li> <code>com::sun::star::sdb::DatasourceAdministrationDialog</code></li>
40 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
41 * </ul> <p>
43 * This object test <b> is NOT </b> designed to be run in several
44 * threads concurently.
46 * @see com.sun.star.lang.XInitialization
47 * @see com.sun.star.ui.dialogs.XExecutableDialog
48 * @see com.sun.star.sdb.DatasourceAdministrationDialog
49 * @see com.sun.star.beans.XPropertySet
50 * @see ifc.lang._XInitialization
51 * @see ifc.ui.dialogs._XExecutableDialog
52 * @see ifc.sdb._DatasourceAdministrationDialog
53 * @see ifc.beans._XPropertySet
55 public class ODatasourceAdministrationDialog extends TestCase {
57 /**
58 * Creating a Testenvironment for the interfaces to be tested.
59 * Creates an instance of the service
60 * <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>.
62 @Override
63 public TestEnvironment createTestEnvironment( TestParameters Param,
64 PrintWriter log )
65 throws StatusException {
66 XInterface oObj = null;
67 Object oInterface = null;
69 try {
70 oInterface = Param.getMSF().createInstance
71 ("com.sun.star.sdb.DatasourceAdministrationDialog" );
72 } catch( com.sun.star.uno.Exception e ) {
73 log.println("Service not available" );
74 throw new StatusException("Service not available", e) ;
77 if (oInterface == null) {
78 log.println("Service wasn't created") ;
79 throw new StatusException(Status.failed("Service wasn't created")) ;
82 oObj = (XInterface) oInterface;
84 log.println( " creating a new environment for object" );
85 TestEnvironment tEnv = new TestEnvironment( oObj );
87 return tEnv;
88 } // finish method getTestEnvironment
90 } // finish class ODataSourceAdministrationDialog