blob: 2c617b18b26fa5d705efeb5324d117ffa2424723 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="task_XJob" script:language="StarBasic">
'*************************************************************************
'
' Licensed to the Apache Software Foundation (ASF) under one
' or more contributor license agreements. See the NOTICE file
' distributed with this work for additional information
' regarding copyright ownership. The ASF licenses this file
' to you under the Apache License, Version 2.0 (the
' "License"); you may not use this file except in compliance
' with the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing,
' software distributed under the License is distributed on an
' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
' KIND, either express or implied. See the License for the
' specific language governing permissions and limitations
' under the License.
'
'*************************************************************************
'*************************************************************************
' This Interface/Service test depends on the following GLOBAL variables,
' which must be specified in the object creation:
' Global vXJobArgs(0 to n) as Variant
' Example:
' Dim vXJobArg0(0 to 0) as new com.sun.star.beans.NamedValue
' Dim vXJobArg1(0 to 0) as new com.sun.star.beans.NamedValue
' vXJobArgs0(0).Name = "MyProperty": vXJobArg0(0).Vaue = "MyValue"
' vXJobArgs1(0).Name = "MyProperty": vXJobArg0(0).Vaue = "My2ndValue"
' vXJobArgs(0) = vXJobArg0()
' vXJobArgs(1) = vXJobArg1()
'*************************************************************************
' Be sure that all variables are dimensioned:
option explicit
Sub RunTest()
'*************************************************************************
' INTERFACE:
' com.sun.star.task.XJob
'*************************************************************************
On Error Goto ErrHndl
Dim bOK As Boolean
Dim bRun as Boolean
Dim n as Integer
out.dbg("Start tests of com.sun.star.task.XJob #########")
ReCreateObj()
Test.StartMethod("execute()")
bOK = TRUE
for n = 0 to uBound(vXJobArgs())
bRun = FALSE
out.dbg("running vXJobArgs(" + n + ")")
bRun = oObj.execute(vXJobArgs(n))
bOK = bOK AND bRun
out.dbg("Result: " + bRun)
next n
Test.MethodTested("execute()", bOK)
Exit Sub
ErrHndl:
Test.Exception()
bOK = false
resume next
End Sub
</script:module>