diff options
Diffstat (limited to 'qadevOOo/tests/basic/ifc/lang')
20 files changed, 889 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.xba b/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.xba new file mode 100644 index 000000000000..39894b9ea349 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.xba @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_ServiceManager" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.lang.ServiceManager +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("DefaultContext") + + 'test the RTL function getDefaultcontext() + Test.MethodTested("DefaultContext", isObject(getDefaultContext())) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/ServiceManager/script.xlb b/qadevOOo/tests/basic/ifc/lang/ServiceManager/script.xlb new file mode 100644 index 000000000000..7f4958ace7ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/ServiceManager/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_ServiceManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_ServiceManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.xba b/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.xba new file mode 100644 index 000000000000..6d429bed4c7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.xba @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XComponent" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oComponentInstance As Object it will be disposed + +'************************************************************************* + + +Dim bCB1 As Boolean, bCB2 As Boolean + +' Be sure that all variables are dimensioned: +option explicit + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XEventListener + +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 as Object, oListener2 As Object + + If isNull(oComponentInstance) Then Out.Log("oComponentInstance is not initialized") + + bCB1 = false + bCB2 = false + + Out.Log("create two listeners") + oListener1 = createUNOListener("CB1_", "com.sun.star.lang.XEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.lang.XEventListener") + + ' add listeners to object if initialized + if NOT(isNull(oListener2)) then + oComponentInstance.addEventListener(oListener2) + end if + if NOT(isNull(oListener1)) then + oComponentInstance.addEventListener(oListener1) + end if + + Out.Log("remove Listener2") + oComponentInstance.removeEventListener(oListener2) + + ' dispose object and check the count + Test.StartMethod("dispose()") + bOK = true + oComponentInstance.dispose() + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("dispose()", bOK) + + ' check if only one eventlistener-callback was executed + Test.StartMethod("addEventListener()") + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("addEventListener()", bOK) + + ' check if there was only one of the listener callbacks executed + Test.StartMethod("removeEventListener()") + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("removeEventListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_disposing + Out.Log("CallBack for Listener1 disposing was called.") + bCB1 = true +End Sub +Sub CB2_disposing + Out.Log("CallBack for Listener2 disposing was called.") + bCB2 = true +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XComponent/script.xlb b/qadevOOo/tests/basic/ifc/lang/XComponent/script.xlb new file mode 100644 index 000000000000..6868484b6179 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XComponent/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba b/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba new file mode 100644 index 000000000000..bc98741e7b98 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XEventListener" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XEventListener +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("disposing()") + bOK = true + Out.Log("The method 'disposing'") + Out.Log("gets called when the broadcaster is about to be disposed.") + Out.Log("All listeners and all other objects which reference the broadcaster should release the references.") + Out.Log("So there is nothing to test here") + Test.MethodTested("disposing()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XEventListener/script.xlb b/qadevOOo/tests/basic/ifc/lang/XEventListener/script.xlb new file mode 100644 index 000000000000..41dd6886e66c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XEventListener/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XEventListener" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XEventListener"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba b/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba new file mode 100644 index 000000000000..bd57e0d44942 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XInitialization" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global aInitArgs() As Variant +' Global aNoInit() As Variant [optional] +' if the variable defined as Array the method initialize() isnt called. + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XInitialization +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bInit As Boolean + + bInit = true + + Test.StartMethod("initialize()") + bOK = true + + if NOT isArray(aNoInit) then + if NOT isArray(aInitArgs) then + Out.Log("aInitArgs is NULL ... trying with no arguments") + oObj.initialize(DimArray()) + else + oObj.initialize(aInitArgs()) + end if + else + Out.Log("The object already initialized ... OK") + end if + + Test.MethodTested("initialize()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XInitialization/script.xlb b/qadevOOo/tests/basic/ifc/lang/XInitialization/script.xlb new file mode 100644 index 000000000000..25601d809973 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XInitialization/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XInitialization" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XInitialization"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba new file mode 100644 index 000000000000..2d56d6f2184d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XMultiComponentFactory" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cServiceName As String ie. 'com.sun.star.drawing.RectangleShape' +' - Global aContext() As Variant +' - Global aArguments() As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XMultiComponentFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oInstance1 As Object + Dim oInstance2 As Object + + Test.StartMethod("getAvailableServiceNames()") + bOK = true + Names = oObj.getAvailableServiceNames() + Dim bFound As Boolean + bFound = false + for i = 0 to ubound(Names) + if Names(i) = cServiceName then bFound = true + next i + if (NOT bFound) then Out.Log("Can't find '" & cServiceName & "' in returned array.") + bOK = bOK AND bFound + Test.MethodTested("getAvailableServiceNames()", bOK) + + Test.StartMethod("createInstanceWithContext()") + bOK = true + oInstance1 = oObj.createInstanceWithContext(cServiceName, aContext()) + bOK = bOK AND NOT isNULL(oInstance1) + Test.MethodTested("createInstanceWithContext()", bOK) + + Test.StartMethod("createInstanceWithArgumentsAndContext()") + bOK = true + oInstance2 = oObj.createInstanceWithArgumentsAndContext(cServiceName, aArguments(), aContext()) + bOK = bOK AND NOT isNULL(oInstance2) + Test.MethodTested("createInstanceWithArgumentsAndContext()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/script.xlb new file mode 100644 index 000000000000..3ed4be77bbe1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XMultiComponentFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XMultiComponentFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba new file mode 100644 index 000000000000..e7ee9543a28e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XMultiServiceFactory" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cServiceName As String ie. "com.sun.star.drawing.RectangleShape" +' - Global bCreateInstanceWithoutArguments As Boolean +' - Global aArguments() As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XMultiServiceFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oInstance1, oInstance2 As Object + Dim Names + + Test.StartMethod("getAvailableServiceNames()") + bOK = true + Names = oObj.getAvailableServiceNames() + Dim bFound As Boolean + bFound = false + for i = 0 to ubound(Names) + if Names(i) = cServiceName then bFound = true + next i + if (NOT bFound) then Out.Log("Can't find '" & cServiceName & "' in returned array.") + bOK = bOK AND bFound + Test.MethodTested("getAvailableServiceNames()", bOK) + + Test.StartMethod("createInstance()") + bOK = true + if bCreateInstanceWithoutArguments then + oInstance1 = oObj.createInstance(cServiceName) + bOK = bOK AND NOT isNull(oInstance1) + else + Out.Log("createInstance() skipped for this object.") + end if + Test.MethodTested("createInstance()", bOK) + + Test.StartMethod("createInstanceWithArguments()") + bOK = true + if (cObjectName = "sd.SdXImpressDocument") then + Out.Log("Object SdXImpressDocument doesn't suppotr createInstanceWithArguments().") + else + oInstance2 = oObj.createInstanceWithArguments(cServiceName, aArguments()) + bOK = bOK AND NOT isNULL(oInstance2) + end if + Test.MethodTested("createInstanceWithArguments()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/script.xlb new file mode 100644 index 000000000000..ebca38bedb29 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XMultiServiceFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XMultiServiceFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba new file mode 100644 index 000000000000..2d79fd5e6fcc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XServiceDisplayName" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XServiceDisplayName +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocale As new com.sun.star.lang.Locale + Dim cName As String + + vLocale.Language = "en" + vLocale.Country = "US" + + Test.StartMethod("getServiceDisplayName()") + bOK = true + cName = oObj.getServiceDisplayName(vLocale) + bOK = bOK AND (cName <> "") + Test.MethodTested("getServiceDisplayName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/script.xlb b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/script.xlb new file mode 100644 index 000000000000..d133ba6703cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XServiceDisplayName" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XServiceDisplayName"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba new file mode 100644 index 000000000000..90691ddbedfe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XServiceInfo" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XServiceInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getImplementationName()") + bOK = VarType(oObj.getImplementationName()) = 8 + Test.MethodTested("getImplementationName()", bOK) + + Test.StartMethod("supportsService()") + bOK = true + vServices = oObj.getSupportedServiceNames() + bOK = bOK AND uBound(vServices()) >= 0 + Test.MethodTested("supportsService()", bOK) + + Test.StartMethod("getSupportedServiceNames()") + bOK = oObj.supportsService(vServices(0)) + Test.MethodTested("getSupportedServiceNames()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceInfo/script.xlb b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/script.xlb new file mode 100644 index 000000000000..1fb4bfa6401a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XServiceInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XServiceInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba new file mode 100644 index 000000000000..77ad0a8c79b1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XSingleServiceFactory" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global aArguments As Variant [optional] +' Array of arguments for createInstanceWithArguments() +' Global aMustSupportInterface As Variant [optional] +' Array of Strings with names of interfaces which must be supported by created instance. + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XSingleServiceFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aArgs() + Dim inst As Object + Dim i As Integer + + Test.StartMethod("createInstance()") + bOK = true + if (cObjectName = "inv.Invocation") then + Out.Log("createInstance() not available in " + cObjectName + " - SKIPPED") + else + bOK = bOK AND isObject(oObj.createInstance()) + end if + Test.MethodTested("createInstance()", bOK) + + Test.StartMethod("createInstanceWithArguments()") + bOK = true + if isArray(aArguments) then + inst = oObj.createInstanceWithArguments(aArguments()) + else + inst = oObj.createInstanceWithArguments(aArgs()) + end if + + if NOT isObject(inst) then + bOK = false + Out.Log("The returned instance is not object : FAILED.") + end if + + if isArray(aMustSupportInterface) AND bOK then + Out.Log("Checking supported interfaces ...") + for i = 0 to ubound(aMustSupportInterface()) + if NOT hasUnoInterfaces(inst, aMustSupportInterface(i)) then + Out.Log("The created instance doesn't support '" + aMustSupportInterface(i) + "'") + bOK = false + end if + next i + end if + + Test.MethodTested("createInstanceWithArguments()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/script.xlb new file mode 100644 index 000000000000..acff5b4a09b2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XSingleServiceFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XSingleServiceFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba new file mode 100644 index 000000000000..8422f4574e0e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XTypeProvider" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XTypeProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim n As Integer + Dim vTypes As Variant + Dim IDs1(15) As Integer + Dim IDs2(15) As Integer + + Test.StartMethod("getTypes()") + bOK = false + vTypes = oObj.getTypes() + For n = lBound(vTypes()) to UBound(vTypes()) + If vTypes(n).Name = cIfcLongName Then + Out.Log("Type of Object " & n & " is " & vTypes(n).Name & ". Same as Interface => ok!" + bOK = true + Else + Out.Log("Type of Object " & n & " is " & vTypes(n).Name + End If + Next n + Test.MethodTested("getTypes()", bOK) + + Test.StartMethod("getImplementationId()") + bOK = true + IDs1() = oObj.getImplementationId() + IDs2() = oObj.getImplementationId() + + bOK = bOK AND ubound(IDs1()) = ubound(IDs2()) + bOK = bOK AND ubound(IDs1()) = 15 + if (bOK) then + for n = lBound(IDs1()) to lBound(IDs2()) + bOK = bOK AND IDs1(n) = IDs2(n) + Next n + end if + + if (NOT bOK) then + Out.Log("Returned IDs are NOT identical!") + end if + Test.MethodTested("getImplementationId()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XTypeProvider/script.xlb b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/script.xlb new file mode 100644 index 000000000000..ef09fbba13a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="lang_XTypeProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XTypeProvider"/> +"</library:library> |