merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / basic / ifc / awt / XDateField / awt_XDateField.xba
blob39518f4437b604a0f0b868bcd09fa00f688efbb3
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">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 '
10 ' Copyright 2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: awt_XDateField.xba,v $
16 ' $Revision: 1.3 $
18 ' This file is part of OpenOffice.org.
20 ' OpenOffice.org is free software: you can redistribute it and/or modify
21 ' it under the terms of the GNU Lesser General Public License version 3
22 ' only, as published by the Free Software Foundation.
24 ' OpenOffice.org is distributed in the hope that it will be useful,
25 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ' GNU Lesser General Public License version 3 for more details
28 ' (a copy is included in the LICENSE file that accompanied this code).
30 ' You should have received a copy of the GNU Lesser General Public License
31 ' version 3 along with OpenOffice.org. If not, see
32 ' <http://www.openoffice.org/license.html>
33 ' for a copy of the LGPLv3 License.
35 '*************************************************************************
36 '*************************************************************************
42 Sub RunTest()
44 '*************************************************************************
45 ' INTERFACE:
46 ' com.sun.star.awt.XDateField
47 '*************************************************************************
48 On Error Goto ErrHndl
49 Dim bOK As Boolean
52 Test.StartMethod("setDate()")
53 bOK = true
54 oObj.setDate(5087)
55 Test.StartMethod("getDate()")
56 bOK = bOK AND (oObj.getDate() = 5087)
57 Test.MethodTested("setDate()", bOK)
58 Test.MethodTested("getDate()", bOK)
60 Test.StartMethod("setMin()")
61 bOK = true
62 oObj.setMin(4978)
63 Test.StartMethod("getMin()")
64 bOK = bOK AND (oObj.getMin() = 4978)
65 Test.MethodTested("setMin()", bOK)
66 Test.MethodTested("getMin()", bOK)
68 Test.StartMethod("setMax()")
69 bOK = true
70 oObj.setMax(27856)
71 Test.StartMethod("getMax()")
72 bOK = bOK AND (oObj.getMax() = 27856)
73 Test.MethodTested("setMax()", bOK)
74 Test.MethodTested("getMax()", bOK)
76 Test.StartMethod("setFirst()")
77 bOK = true
78 oObj.setFirst(5118)
79 Test.StartMethod("getFirst()")
80 bOK = bOK AND (oObj.getfirst() = 5118)
81 Test.MethodTested("setFirst()", bOK)
82 Test.MethodTested("getFirst()", bOK)
84 Test.StartMethod("setLast()")
85 bOK = true
86 oObj.setLast(23450)
87 Test.StartMethod("getLast()")
88 bOK = bOK AND (oObj.getLast() = 23450)
89 Test.MethodTested("setLast()", bOK)
90 Test.MethodTested("getLast()", bOK)
92 Test.StartMethod("setLongFormat()")
93 bOK = true
94 oObj.setLongFormat(true)
95 Test.StartMethod("isLongFormat()")
96 bOK = bOK AND oObj.isLongFormat()
97 oObj.setLongFormat(false)
98 bOK = bOK AND NOT oObj.isLongFormat()
99 Test.MethodTested("setLongFormat()", bOK)
100 Test.MethodTested("isLongFormat()", bOK)
102 Test.StartMethod("isEmpty()")
103 bOK = true
104 oObj.setDate(6321)
105 bOK = bOK AND NOT oObj.isEmpty()
106 Test.StartMethod("setEmpty()")
107 oObj.setEmpty()
108 Test.MethodTested("setEmpty()", bOK)
109 Test.MethodTested("isEmpty()", bOK)
111 Test.StartMethod("setStrictFormat()")
112 bOK = true
113 oObj.setStrictFormat(true)
114 Test.StartMethod("isStrictFormat()")
115 bOK = bOK AND oObj.isStrictFormat()
116 oObj.setStrictFormat(false)
117 bOK = bOK AND NOT oObj.isStrictFormat()
118 Test.MethodTested("setStrictFormat()", bOK)
119 Test.MethodTested("isStrictFormat()", bOK)
121 Exit Sub
122 ErrHndl:
123 Test.Exception()
124 bOK = false
125 resume next
126 End Sub
127 </script:module>