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
.awt
.AsyncCallback
;
22 import com
.sun
.star
.awt
.Rectangle
;
23 import com
.sun
.star
.awt
.XCallback
;
24 import com
.sun
.star
.awt
.XMessageBox
;
25 import com
.sun
.star
.awt
.XMessageBoxFactory
;
26 import com
.sun
.star
.awt
.XRequestCallback
;
27 import com
.sun
.star
.awt
.XWindow
;
28 import com
.sun
.star
.awt
.XWindowPeer
;
29 import com
.sun
.star
.lang
.XMultiServiceFactory
;
30 import com
.sun
.star
.uno
.Any
;
31 import com
.sun
.star
.uno
.UnoRuntime
;
32 import lib
.MultiMethodTest
;
36 * Testing <code>com.sun.star.awt.XMessageBoxFactory</code>
39 * <li><code> </code>createMessageBox()</li>
41 * Test is <b> NOT </b> multithread compilant. <p>
42 * @see com.sun.star.awt.XMessageBoxFactory
44 public class _XMessageBoxFactory
extends MultiMethodTest
{
45 public XMessageBoxFactory oObj
= null;
47 public void _createMessageBox() {
48 final XMessageBox mb
= oObj
.createMessageBox(
49 (XWindowPeer
) tEnv
.getObjRelation("WINPEER"),
50 com
.sun
.star
.awt
.MessageBoxType
.ERRORBOX
, 1, "The Title",
52 final UITools tools
= new UITools(
53 (XMultiServiceFactory
) tParam
.getMSF(),
54 UnoRuntime
.queryInterface(XWindow
.class, mb
));
55 final boolean[] done
= new boolean[] { false };
56 final boolean[] good
= new boolean[] { false };
57 XRequestCallback async
= AsyncCallback
.create(
58 tParam
.getComponentContext());
61 public void notify(Object aData
) {
72 public void notify(Object aData
) {
74 tools
.clickButton("OK");
75 } catch (RuntimeException e
) {
77 } catch (Exception e
) {
78 throw new RuntimeException(e
);
90 } catch (InterruptedException e
) {
91 throw new RuntimeException(e
);
99 tRes
.tested("createMessageBox()", ok
);