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' 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
38
39Sub RunTest()
40
41'*************************************************************************
42' INTERFACE:
43' com.sun.star.awt.XDateField
44'*************************************************************************
45On Error Goto ErrHndl
46    Dim bOK As Boolean
47
48
49    Test.StartMethod("setDate()")
50    bOK = true
51    oObj.setDate(5087)
52    Test.StartMethod("getDate()")
53    bOK = bOK AND (oObj.getDate() = 5087)
54    Test.MethodTested("setDate()", bOK)
55    Test.MethodTested("getDate()", bOK)
56
57    Test.StartMethod("setMin()")
58    bOK = true
59    oObj.setMin(4978)
60    Test.StartMethod("getMin()")
61    bOK = bOK AND (oObj.getMin() = 4978)
62    Test.MethodTested("setMin()", bOK)
63    Test.MethodTested("getMin()", bOK)
64
65    Test.StartMethod("setMax()")
66    bOK = true
67    oObj.setMax(27856)
68    Test.StartMethod("getMax()")
69    bOK = bOK AND (oObj.getMax() = 27856)
70    Test.MethodTested("setMax()", bOK)
71    Test.MethodTested("getMax()", bOK)
72
73    Test.StartMethod("setFirst()")
74    bOK = true
75    oObj.setFirst(5118)
76    Test.StartMethod("getFirst()")
77    bOK = bOK AND (oObj.getfirst() = 5118)
78    Test.MethodTested("setFirst()", bOK)
79    Test.MethodTested("getFirst()", bOK)
80
81    Test.StartMethod("setLast()")
82    bOK = true
83    oObj.setLast(23450)
84    Test.StartMethod("getLast()")
85    bOK = bOK AND (oObj.getLast() = 23450)
86    Test.MethodTested("setLast()", bOK)
87    Test.MethodTested("getLast()", bOK)
88
89    Test.StartMethod("setLongFormat()")
90    bOK = true
91    oObj.setLongFormat(true)
92    Test.StartMethod("isLongFormat()")
93    bOK = bOK AND oObj.isLongFormat()
94    oObj.setLongFormat(false)
95    bOK = bOK AND NOT oObj.isLongFormat()
96    Test.MethodTested("setLongFormat()", bOK)
97    Test.MethodTested("isLongFormat()", bOK)
98
99    Test.StartMethod("isEmpty()")
100    bOK = true
101    oObj.setDate(6321)
102    bOK = bOK AND NOT oObj.isEmpty()
103    Test.StartMethod("setEmpty()")
104    oObj.setEmpty()
105    Test.MethodTested("setEmpty()", bOK)
106    Test.MethodTested("isEmpty()", bOK)
107
108    Test.StartMethod("setStrictFormat()")
109    bOK = true
110    oObj.setStrictFormat(true)
111    Test.StartMethod("isStrictFormat()")
112    bOK = bOK AND oObj.isStrictFormat()
113    oObj.setStrictFormat(false)
114    bOK = bOK AND NOT oObj.isStrictFormat()
115    Test.MethodTested("setStrictFormat()", bOK)
116    Test.MethodTested("isStrictFormat()", bOK)
117
118Exit Sub
119ErrHndl:
120    Test.Exception()
121    bOK = false
122    resume next
123End Sub
124</script:module>
125