1<?xml version="1.0" encoding="UTF-8"?>
2<script:module xmlns:script="http://openoffice.org/2000/script" script:name="XExactName" script:language="StarBasic">
3
4'*************************************************************************
5'
6'  Licensed to the Apache Software Foundation (ASF) under one
7'  or more contributor license agreements.  See the NOTICE file
8'  distributed with this work for additional information
9'  regarding copyright ownership.  The ASF licenses this file
10'  to you under the Apache License, Version 2.0 (the
11'  "License"); you may not use this file except in compliance
12'  with the License.  You may obtain a copy of the License at
13'
14'    http://www.apache.org/licenses/LICENSE-2.0
15'
16'  Unless required by applicable law or agreed to in writing,
17'  software distributed under the License is distributed on an
18'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19'  KIND, either express or implied.  See the License for the
20'  specific language governing permissions and limitations
21'  under the License.
22'
23'*************************************************************************
24
25
26
27'*************************************************************************
28' This Interface/Service test depends on the following object relations
29' variables, which must be specified in the object creation:
30
31'      ObjectRelation: oObjRelation(0).Name = "expectedName"
32'      ObjectRelation: oObjRelation(0).Value = "MyExpectedName"
33
34'*************************************************************************
35
36' Be sure that all variables are dimensioned:
37option explicit
38
39Sub RunTest()
40
41'*************************************************************************
42' INTERFACE:
43' com.sun.star.beans.XExactName
44'*************************************************************************
45On Error Goto ErrHndl
46    Dim bOK As Boolean
47
48    Dim cExpectedName as Variant
49    cExpectedName = utils.getObjectRelation("expectedName")
50    if isNull(cExpectedName) then
51        out.log("Object relation 'expectedName' is missing")
52    end if
53
54    Test.StartMethod("getExactName()")
55
56    out.log("getting exact name for " + cExpectedName)
57    bOK = TRUE
58    Dim cResult as String
59    cResult = oObj.getExactName(cExpectedName)
60    bOK = bOK AND (cResult = cExpectedName)
61
62    out.log("getting exact name for " + LCase(cExpectedName))
63    bOK = TRUE
64    cResult = oObj.getExactName(LCase(cExpectedName))
65    bOK = bOK AND (cResult = cExpectedName)
66
67    out.log("getting exact name for " + UCase(cExpectedName))
68    bOK = TRUE
69    cResult = oObj.getExactName(UCase(cExpectedName))
70    bOK = bOK AND (cResult = cExpectedName)
71
72    Test.MethodTested("getExactName()", bOK)
73
74Exit Sub
75ErrHndl:
76    Test.Exception()
77    bOK = false
78    resume next
79End Sub
80</script:module>
81