1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="frame_XDesktop" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9'
10' Copyright 2000, 2010 Oracle and/or its affiliates.
11'
12' OpenOffice.org - a multi-platform office productivity suite
13'
14' This file is part of OpenOffice.org.
15'
16' OpenOffice.org is free software: you can redistribute it and/or modify
17' it under the terms of the GNU Lesser General Public License version 3
18' only, as published by the Free Software Foundation.
19'
20' OpenOffice.org is distributed in the hope that it will be useful,
21' but WITHOUT ANY WARRANTY; without even the implied warranty of
22' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23' GNU Lesser General Public License version 3 for more details
24' (a copy is included in the LICENSE file that accompanied this code).
25'
26' You should have received a copy of the GNU Lesser General Public License
27' version 3 along with OpenOffice.org.  If not, see
28' <http://www.openoffice.org/license.html>
29' for a copy of the LGPLv3 License.
30'
31'*************************************************************************
32*****
33'*************************************************************************
34
35
36
37' Be sure that all variables are dimensioned:
38option explicit
39
40
41
42
43Sub RunTest()
44
45'*************************************************************************
46' INTERFACE:
47' com.sun.star.frame.XDesktop
48'*************************************************************************
49On Error Goto ErrHndl
50    Dim bOK As Boolean
51    Test.StartMethod("getComponents()")
52    bOK = true
53    Dim components As Object
54    components = oObj.getComponents()
55    if (Not isNull(components)) then
56        Dim enum As Object
57        enum = components.createEnumeration()
58        while(enum.hasMoreElements())
59            enum.nextElement()
60        wend
61        bOK = true
62    else
63        bOK = false
64    end if
65    Test.MethodTested("getComponents()", bOK)
66
67    Test.StartMethod("terminate()")
68    bOK = true
69    Test.MethodTested("terminate()", bOK)
70
71    Test.StartMethod("addTerminateListener()")
72    bOK = true
73    Test.MethodTested("addTerminateListener()", bOK)
74
75    Test.StartMethod("removeTerminateListener()")
76    bOK = true
77    Test.MethodTested("removeTerminateListener()", bOK)
78
79    Test.StartMethod("getCurrentComponent()")
80    bOK = true
81    Dim curComp As Object
82    curComp = oObj.getCurrentComponent()
83    bOK = Not isNull(curComp)
84    Test.MethodTested("getCurrentComponent()", bOK)
85
86    Test.StartMethod("getCurrentFrame()")
87    bOK = true
88    Dim curFrame As Object
89    curFrame = oObj.getCurrentFrame()
90    bOK = Not isNull(curFrame)
91    Test.MethodTested("getCurrentFrame()", bOK)
92Exit Sub
93ErrHndl:
94    Test.Exception()
95    bOK = false
96    resume next
97End Sub
98</script:module>
99