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="awt_XDateField" script:language="StarBasic"> 4 5 6'************************************************************************* 7' 8' Licensed to the Apache Software Foundation (ASF) under one 9' or more contributor license agreements. See the NOTICE file 10' distributed with this work for additional information 11' regarding copyright ownership. The ASF licenses this file 12' to you under the Apache License, Version 2.0 (the 13' "License"); you may not use this file except in compliance 14' with the License. You may obtain a copy of the License at 15' 16' http://www.apache.org/licenses/LICENSE-2.0 17' 18' Unless required by applicable law or agreed to in writing, 19' software distributed under the License is distributed on an 20' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21' KIND, either express or implied. See the License for the 22' specific language governing permissions and limitations 23' under the License. 24' 25'************************************************************************* 26 27 28 29 30 31 32 33Sub RunTest() 34 35'************************************************************************* 36' INTERFACE: 37' com.sun.star.awt.XDateField 38'************************************************************************* 39On Error Goto ErrHndl 40 Dim bOK As Boolean 41 42 43 Test.StartMethod("setDate()") 44 bOK = true 45 oObj.setDate(5087) 46 Test.StartMethod("getDate()") 47 bOK = bOK AND (oObj.getDate() = 5087) 48 Test.MethodTested("setDate()", bOK) 49 Test.MethodTested("getDate()", bOK) 50 51 Test.StartMethod("setMin()") 52 bOK = true 53 oObj.setMin(4978) 54 Test.StartMethod("getMin()") 55 bOK = bOK AND (oObj.getMin() = 4978) 56 Test.MethodTested("setMin()", bOK) 57 Test.MethodTested("getMin()", bOK) 58 59 Test.StartMethod("setMax()") 60 bOK = true 61 oObj.setMax(27856) 62 Test.StartMethod("getMax()") 63 bOK = bOK AND (oObj.getMax() = 27856) 64 Test.MethodTested("setMax()", bOK) 65 Test.MethodTested("getMax()", bOK) 66 67 Test.StartMethod("setFirst()") 68 bOK = true 69 oObj.setFirst(5118) 70 Test.StartMethod("getFirst()") 71 bOK = bOK AND (oObj.getfirst() = 5118) 72 Test.MethodTested("setFirst()", bOK) 73 Test.MethodTested("getFirst()", bOK) 74 75 Test.StartMethod("setLast()") 76 bOK = true 77 oObj.setLast(23450) 78 Test.StartMethod("getLast()") 79 bOK = bOK AND (oObj.getLast() = 23450) 80 Test.MethodTested("setLast()", bOK) 81 Test.MethodTested("getLast()", bOK) 82 83 Test.StartMethod("setLongFormat()") 84 bOK = true 85 oObj.setLongFormat(true) 86 Test.StartMethod("isLongFormat()") 87 bOK = bOK AND oObj.isLongFormat() 88 oObj.setLongFormat(false) 89 bOK = bOK AND NOT oObj.isLongFormat() 90 Test.MethodTested("setLongFormat()", bOK) 91 Test.MethodTested("isLongFormat()", bOK) 92 93 Test.StartMethod("isEmpty()") 94 bOK = true 95 oObj.setDate(6321) 96 bOK = bOK AND NOT oObj.isEmpty() 97 Test.StartMethod("setEmpty()") 98 oObj.setEmpty() 99 Test.MethodTested("setEmpty()", bOK) 100 Test.MethodTested("isEmpty()", bOK) 101 102 Test.StartMethod("setStrictFormat()") 103 bOK = true 104 oObj.setStrictFormat(true) 105 Test.StartMethod("isStrictFormat()") 106 bOK = bOK AND oObj.isStrictFormat() 107 oObj.setStrictFormat(false) 108 bOK = bOK AND NOT oObj.isStrictFormat() 109 Test.MethodTested("setStrictFormat()", bOK) 110 Test.MethodTested("isStrictFormat()", bOK) 111 112Exit Sub 113ErrHndl: 114 Test.Exception() 115 bOK = false 116 resume next 117End Sub 118</script:module> 119