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