diff options
Diffstat (limited to 'qadevOOo/tests/basic/ifc/frame')
32 files changed, 2187 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba b/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba new file mode 100644 index 000000000000..8c7a29c93f72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="frame_Frame" 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.frame.Frame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("RecorderSupplier") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/Frame/script.xlb b/qadevOOo/tests/basic/ifc/frame/Frame/script.xlb new file mode 100644 index 000000000000..cdac70151a1c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/Frame/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="frame_Frame" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="frame_Frame"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.xba b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.xba new file mode 100644 index 000000000000..d731c3e1a766 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.xba @@ -0,0 +1,109 @@ +<?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="frame_XComponentLoader" 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.frame.XComponentLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim frameName As String + Dim doc As Object + + Test.StartMethod("loadComponentFromURL()") + bOK = true + frameName = "_blank" + + Dim szArgs(0) As new com.sun.star.beans.PropertyValue + szArgs(0).Name = "OpenFlags" + szArgs(0).Value = "S" + szArgs(0).Handle = -1 + szArgs(0).State = com.sun.star.beans.PropertyState.DEFAULT_VALUE + + Out.log("load a blank impress doc") + doc = oObj.loadComponentFromURL("private:factory/simpress", frameName, 0, szArgs()) + bOK = Not isNull(doc) + Out.log("disposing impress doc") + doc.dispose() + + Dim szEmptyArgs() + + Out.log("load a blank writer doc") + doc = oObj.loadComponentFromURL("private:factory/swriter", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing writer doc") + doc.dispose() + + Out.log("load a blank calc doc") + doc = oObj.loadComponentFromURL("private:factory/scalc", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing calc doc") + doc.dispose() + + Out.log("load a blank draw doc") + doc = oObj.loadComponentFromURL("private:factory/sdraw", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing draw doc") + doc.dispose() + + Out.log("load a blank math doc") + oDoc = oObj.loadComponentFromURL("private:factory/smath", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing math doc") + doc.dispose() + + Out.log("load a blank chart doc") + oDoc = oObj.loadComponentFromURL("private:factory/schart", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing schart doc") + doc.dispose() + + Test.MethodTested("loadComponentFromURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XComponentLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/script.xlb new file mode 100644 index 000000000000..47e576eca7ca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/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="frame_XComponentLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XComponentLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba b/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba new file mode 100644 index 000000000000..31c2e434ca73 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba @@ -0,0 +1,134 @@ +<?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="frame_XController" 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 oFrameToAttach As Object +' - Global oModelToAttach As Object +' - Global bHasNoViewData As Boolean +' - Global oObjToSuspend As Object +' - Global bHasNoModel As Boolean + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XController +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getViewData()") + bOK = true + if (bHasNoViewData) then + Out.Log("This object has no ViewData - nothing to test") + else + oViewData = oObj.getViewData() + bOK = bOK AND NOT isNULL(oViewData) + end if + Test.MethodTested("getViewData()", bOK) + + Test.StartMethod("restoreViewData()") + bOK = true + if (bHasNoViewData) then + Out.Log("This object has no ViewData - nothing to test") + else + oObj.restoreViewData(oViewData) + end if + Test.MethodTested("restoreViewData()", bOK) + + Test.StartMethod("getFrame()") + bOK = true + oFrame = oObj.getFrame() + bOK = bOK AND hasUnoInterfaces(oFrame, "com.sun.star.frame.XFrame") + Test.MethodTested("getFrame()", bOK) + + Test.StartMethod("getModel()") + bOK = true + oModel = oObj.getModel() + if (bHasNoModel) then + bOK = bOK AND isNull(oModel) + Out.Log("The object has no Model. Retunrned value must be NULL") + else + bOK = bOK AND NOT isNull(oModel) AND hasUnoInterfaces(oModel, "com.sun.star.frame.XModel") + end if + Test.MethodTested("getModel()", bOK) + + Test.StartMethod("attachFrame()") + bOK = true + Dim attachedFrame As Object + attachedFrame = oObj.getFrame() + oFrameToAttach.Name = "XController" + oObj.attachFrame(oFrameToAttach) + bOK = bOK AND oObj.getFrame.Name = oFrameToAttach.Name + ' return previous frame. + oObj.attachFrame(attachedFrame) + Test.MethodTested("attachFrame()", bOK) + + Test.StartMethod("attachModel()") + bOK = true + if bHasNoModel then + Out.Log("The object has no Model. Nothing to test.") + else + oObj.attachModel(oModelToAttach) + if isNull(oObj.getModel()) then + Out.Log("The model is NULL after setModel() call") + bOK = false + else + bOK = bOK AND oModelToAttach.location = oObj.getModel.location + end if + end if + Test.MethodTested("attachModel()", bOK) + + Test.StartMethod("suspend()") + bOK = true + bOK = bOK AND oObjToSuspend.suspend(true) + Test.MethodTested("suspend()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XController/script.xlb b/qadevOOo/tests/basic/ifc/frame/XController/script.xlb new file mode 100644 index 000000000000..3f34e466dd72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XController/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="frame_XController" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XController"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba b/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba new file mode 100644 index 000000000000..35e5201add01 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba @@ -0,0 +1,97 @@ +<?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="frame_XDesktop" 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.frame.XDesktop +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Test.StartMethod("getComponents()") + bOK = true + Dim components As Object + components = oObj.getComponents() + if (Not isNull(components)) then + Dim enum As Object + enum = components.createEnumeration() + while(enum.hasMoreElements()) + enum.nextElement() + wend + bOK = true + else + bOK = false + end if + Test.MethodTested("getComponents()", bOK) + + Test.StartMethod("terminate()") + bOK = true + Test.MethodTested("terminate()", bOK) + + Test.StartMethod("addTerminateListener()") + bOK = true + Test.MethodTested("addTerminateListener()", bOK) + + Test.StartMethod("removeTerminateListener()") + bOK = true + Test.MethodTested("removeTerminateListener()", bOK) + + Test.StartMethod("getCurrentComponent()") + bOK = true + Dim curComp As Object + curComp = oObj.getCurrentComponent() + bOK = Not isNull(curComp) + Test.MethodTested("getCurrentComponent()", bOK) + + Test.StartMethod("getCurrentFrame()") + bOK = true + Dim curFrame As Object + curFrame = oObj.getCurrentFrame() + bOK = Not isNull(curFrame) + Test.MethodTested("getCurrentFrame()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDesktop/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDesktop/script.xlb new file mode 100644 index 000000000000..8fc67d07830b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDesktop/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="frame_XDesktop" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDesktop"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba b/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba new file mode 100644 index 000000000000..d373311716b8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba @@ -0,0 +1,120 @@ +<?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="frame_XDispatch" 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 dispatchURL As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatch +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim listener1 As Object, listener2 As Object + Dim URL As New com.sun.star.util.URL + + URL.Complete = dispatchURL + + Out.Log("Dispatch URL is '" + dispatchURL + "'") + if isNull(oObj) then Out.Log("Component is NULL !!!!") + + Test.StartMethod("addStatusListener()") + listener1 = createUnoListener("SL1_", "com.sun.star.frame.XStatusListener") + listener2 = createUnoListener("SL2_", "com.sun.star.frame.XStatusListener") + + if NOT(isNull(listener1) OR isNull(listener2)) then + Out.Log("Listeners were created") + else + Out.Log("Listeners were NOT created !!!") + EndIf + + oObj.addStatusListener(listener1, URL) + oObj.addStatusListener(listener2, URL) + Out.Log("Listeners were added") + + Test.StartMethod("removeStatusListener()") + oObj.removeStatusListener(listener1, URL) + + Test.StartMethod("dispatch()") + + SL1Called = false + SL2Called = false + + Out.Log("Dispatching ...") + oObj.dispatch(URL, DimArray()) + wait(500) + Out.Log("Dispatched.") + Test.MethodTested("dispatch()", true) + + bOK = SL2Called + Test.MethodTested("addStatusListener()", bOK) + bOK = bOK AND NOT SL1Called + Test.MethodTested("removeStatusListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim SL1Called As Boolean +Dim SL2Called As Boolean + +Sub SL1_StatusChanged(ev As Variant) + SL1Called = true + Out.Log("SL1_StatusChanged() called.") +End Sub + +Sub SL2_StatusChanged(ev As Variant) + SL2Called = true + Out.Log("SL2_StatusChanged() called.") +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatch/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatch/script.xlb new file mode 100644 index 000000000000..ef87a042701b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatch/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="frame_XDispatch" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatch"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.xba new file mode 100644 index 000000000000..75cdafc27a6d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.xba @@ -0,0 +1,110 @@ +<?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="frame_XDispatchProvider" 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 dispatchUrl As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim url As new com.sun.star.util.URL + Dim dispatcher As Object + Dim descriptors(1) As new com.sun.star.frame.DispatchDescriptor + Dim dispatchers As Variant + + Out.Log("Using Url for dispatch : " + dispatchUrl) + + url.Complete = dispatchUrl + + Dim oURLTransformer As Object + oURLTransformer = createUnoService("com.sun.star.util.URLTransformer") + Dim aUrl As Variant + aUrl = Array(url) + oURLTransformer.parseStrict(aUrl) + + Test.StartMethod("queryDispatch()") + dispatcher = oObj.queryDispatch(aUrl(0), "frame", _ + com.sun.star.frame.FrameSearchFlag.ALL) + bOK = NOT isNull(dispatcher) + Out.Log("Dispatch is null : " + isNull(dispatcher)) + bOK = bOK AND hasUnoInterfaces(dispatcher, "com.sun.star.frame.XDispatch") + Test.MethodTested("queryDispatch()", bOK) + + Test.StartMethod("queryDispatches()") + bOK = true + descriptors(0).FeatureURL = url + descriptors(0).FrameName = "Frame1" + descriptors(0).SearchFlags = com.sun.star.frame.FrameSearchFlag.ALL + descriptors(1).FeatureURL = url + descriptors(1).FrameName = "Frame2" + descriptors(1).SearchFlags = com.sun.star.frame.FrameSearchFlag.ALL + dispatchers = oObj.queryDispatches(descriptors()) + if isArray(dispatchers) then + if ubound(descriptors()) <> ubound(dispatchers()) then + bOK = false + Out.Log("Number of returned dispatchers : " + _ + ubound(dispatchers()) + " - FAILED") + endIf + else + bOK = false + Out.Log("Returned value is not Array") + EndIf + + Test.MethodTested("queryDispatches()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/script.xlb new file mode 100644 index 000000000000..a9c846861c62 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/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="frame_XDispatchProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchProvider"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba new file mode 100644 index 000000000000..cd394226a759 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba @@ -0,0 +1,71 @@ +<?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="frame_XDispatchProviderInterception" 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.frame.XDispatchProviderInterception +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ceptor As Object + + + Test.StartMethod("registerDispatchProviderInterceptor()") + bOK = true + ceptor = createUnoService("basichelper.DispatchProviderInterceptor") + oObj.registerDispatchProviderInterceptor(ceptor) + bOK = bOK AND NOT isNull(ceptor.getMasterDispatchProvider()) + Test.MethodTested("registerDispatchProviderInterceptor()", bOK) + + Test.StartMethod("releaseDispatchProviderInterceptor()") + bOK = true + oObj.releaseDispatchProviderInterceptor(ceptor) + bOK = bOK AND isNull(ceptor.getMasterDispatchProvider()) + Test.MethodTested("releaseDispatchProviderInterceptor()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/script.xlb new file mode 100644 index 000000000000..7a88a6895533 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/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="frame_XDispatchProviderInterception" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchProviderInterception"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba new file mode 100644 index 000000000000..4839ec766dae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba @@ -0,0 +1,154 @@ +<?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="frame_XDispatchRecorder" 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 dispRecFrame As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchRecorder +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("startRecording()") + bOK = true + oObj.startRecording(dispRecFrame) + Test.MethodTested("startRecording()", bOK) + + Test.StartMethod("endRecording()") + bOK = true + Dim dispURL As com.sun.star.util.URL + dispURL = parseURL(".uno:InsertText") + Dim dispArgs(0) As new com.sun.star.beans.PropertyValue + dispArgs(0).Name = "Text" + dispArgs(0).Value = "XDispatchRecorder.endRecording()" + Out.log("Dispatching event for frame ...") + Dim disp As Object + disp = dispRecFrame.queryDispatch(dispURL, "", 0) + disp.dispatch(dispURL, dispArgs()) + wait(2000) + Out.log("Ending record ...") + oObj.endRecording() + Out.log("Getting macro ... :") + Dim macro As String + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("endRecording()", bOK) + + Test.StartMethod("recordDispatch()") + bOK = true + Out.log("Recording dispatch ...") + oObj.recordDispatch(dispURL, dispArgs()) + Out.log("Getting macro ... :") + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("recordDispatch()", bOK) + + Test.StartMethod("recordDispatchAsComment()") + bOK = true + Out.log("Recording dispatch ...") + oObj.recordDispatchAsComment(dispURL, dispArgs()) + Out.log("Getting macro ... :") + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("recordDispatchAsComment()", bOK) + + Test.StartMethod("getRecordedMacro()") + bOK = true + Test.MethodTested("getRecordedMacro()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function parseURL(complURL As String) As com.sun.star.util.URL + Dim url As new com.sun.star.util.URL + url.Complete = complURL + Dim urlTrans As Object + urlTrans = createUnoService("com.sun.star.util.URLTransformer") + urlTrans.parseStrict(url) + parseURL = url +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/script.xlb new file mode 100644 index 000000000000..e88e65a85b50 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/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="frame_XDispatchRecorder" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchRecorder"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.xba new file mode 100644 index 000000000000..e41cd4b49018 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.xba @@ -0,0 +1,109 @@ +<?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="frame_XDispatchRecorderSupplier" 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.frame.XDispatchRecorderSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldRecorder As Object + + Test.StartMethod("getDispatchRecorder()") + oldRecorder = oObj.getDispatchRecorder() + + Test.StartMethod("setDispatchRecorder()") + Dim newRecorder As Object + newRecorder = createUnoService("com.sun.star.comp.framework.DispatchRecorder") + oObj.setDispatchRecorder(newRecorder) + + Test.StartMethod("dispatchAndRecord()") + bOK = true + oDoc = createDocument("swriter", cObjectName) + Dim desktop As Object + desktop = createUnoService("com.sun.star.frame.Desktop") + Dim curFrame As Object + curFrame = desktop.getCurrentFrame() + Dim dispURL As com.sun.star.util.URL + dispURL = parseURL(".uno:InsertText") + Dim disp As Object + disp = curFrame.queryDispatch(dispURL, "", 0) + Dim dispArgs(0) As new com.sun.star.beans.PropertyValue + dispArgs(0).Name = "Text" + dispArgs(0).Value = "XDispatchRecorderSupplier" + Out.log("Dispatching and recording ...") + oObj.dispatchAndRecord(dispURL, dispArgs(), disp) + + Dim macro As String + macro = newRecorder.getRecordedMacro() + Out.log("Recorder macro :" + chr(10) + macro) + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + end if + Test.MethodTested("dispatchAndRecord()", bOK) + + bOK = true + if (isNull(oldRecorder)) then + bOK = true + else + Dim oldMacro As String + oldMacro = oldRecorder.getRecordedMacro() + Out.log("RecordedMacro of previous dispatch recorder: " + chr(10) + oldMacro) + bOK = oldMacro = macro + endif + Test.MethodTested("getDispatchRecorder()", bOK) + Test.MethodTested("setDispatchRecorder()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function parseURL(complURL As String) As com.sun.star.util.URL + Dim url As new com.sun.star.util.URL + url.Complete = complURL + Dim urlTrans As Object + urlTrans = createUnoService("com.sun.star.util.URLTransformer") + urlTrans.parseStrict(url) + parseURL = url +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/script.xlb new file mode 100644 index 000000000000..a50e5693014c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/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="frame_XDispatchRecorderSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchRecorderSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba new file mode 100644 index 000000000000..639af5868d02 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba @@ -0,0 +1,191 @@ +<?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="frame_XDocumentTemplates" 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 oStore As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDocumentTemplates +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim content As Object, groupContent As Object + Dim result as Object, statRes As Object + Dim res As Boolean + + Test.StartMethod("getContent()") + bOK = true + content = oObj.getContent() + Out.Log("Content list :") + Out.Log(getContentList(content)) + + bOK = bOK AND NOT isNull(content) + Test.MethodTested("getContent()", bOK) + + Test.StartMethod("addGroup()") + bOK = true + res = oObj.addGroup("XDocumentTemplatesTemp") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(content, "XDocumentTemplatesTemp")) + Test.MethodTested("addGroup()", bOK) + + Test.StartMethod("renameGroup()") + bOK = true + res = oObj.renameGroup("XDocumentTemplatesTemp", "XDocumentTemplates") + Out.Log("Method returned: " + res) + groupContent = getSubContent(content, "XDocumentTemplates") + bOK = bOK AND res AND isNull(getSubContent(content, "XDocumentTemplatesTemp")) _ + AND NOT isNull(groupContent) + Test.MethodTested("renameGroup()", bOK) + + Test.StartMethod("addTemplate()") + Dim testDoc As String + testDoc = utils.Path2URL(cTestDocsDir) + "report.stw" + Out.Log("Adding template from " + testDoc + + bOK = true + res = oObj.addTemplate("XDocumentTemplates", "ANewTemplateTemp", testDoc) + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(groupContent, "ANewTemplateTemp")) + Test.MethodTested("addTemplate()", bOK) + + Test.StartMethod("renameTemplate()") + bOK = true + res = oObj.renameTemplate("XDocumentTemplates", "ANewTemplateTemp", "ANewTemplate") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(groupContent, "ANewTemplateTemp")) _ + AND NOT isNull(getSubContent(groupContent, "ANewTemplate")) + Test.MethodTested("renameTemplate()", bOK) + + Test.StartMethod("storeTemplate()") + bOK = true + res = oObj.storeTemplate("XDocumentTemplates", "NewStoreTemplate", oStore) + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(groupContent, "NewStoreTemplate")) + Test.MethodTested("storeTemplate()", bOK) + + Test.StartMethod("removeTemplate()") + bOK = true + res = oObj.removeTemplate("XDocumentTemplates", "ANewTemplate") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(groupContent, "ANewTemplate") + Test.MethodTested("removeTemplate()", bOK) + + Test.StartMethod("removeGroup()") + bOK = true + res = oObj.removeGroup("XDocumentTemplates") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(content, "XDocumentTemplatesTemp") + Test.MethodTested("removeGroup()", bOK) + + Test.StartMethod("update()") + bOK = true + oObj.update() + Test.MethodTested("update()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function getDynaResultSet(content As Object) As Object + Dim command as new com.sun.star.ucb.Command + Dim comArg as new com.sun.star.ucb.OpenCommandArgument2 + Dim comProps(0) as new com.sun.star.beans.Property + Dim result as Object, statRes As Object + + comArg.Mode = com.sun.star.ucb.OpenMode.ALL + comProps(0).Name = "Title" + comArg.Properties = comProps() + + command.Name = "open" + command.Handle = -1 + command.Argument = comArg + + getDynaResultSet = content.execute(command, 0, NULL_OBJECT) +End Function + +Function getStatResultSet(content As Object) As Object + getStatResultSet = getDynaResultSet(content).getStaticResultSet() +End Function + +Function getContentList(content As Object) As String + Dim statRes As Object + Dim ret As String + + statRes = getStatResultSet(content) + statRes.first() + ret = "" + while NOT statRes.isAfterLast() + ret = ret + " " + statRes.getString(1) + chr(13) + statRes.next() + wend + getContentList = ret +End Function + +Function getSubContent(content As Object, subName As String) As Object + Dim statRes As Object + Dim ret As Object + + statRes = getStatResultSet(content) + statRes.first() + while NOT statRes.isAfterLast() + if subName = statRes.getString(1) then + ret = statRes.queryContent() + endif + statRes.next() + wend + + getSubContent = ret +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/script.xlb new file mode 100644 index 000000000000..fde55a9f49ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/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="frame_XDocumentTemplates" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDocumentTemplates"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba b/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba new file mode 100644 index 000000000000..2b6f01fccdef --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba @@ -0,0 +1,347 @@ +<?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="frame_XFrame" 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 XFrame As Object optional + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XFrame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getName()") + bOK = true + Dim oldName As String + oldName = oObj.getName() + Out.log("getName(): " + oldName) + bOK = Not isNull(oldName) + Test.MethodTested("getName()", bOK) + + Test.StartMethod("setName()") + bOK = true + Dim sName As String, gName As String + sName = "XFrame" + oObj.setName(sName) + gName = oObj.getName() + bOK = gName = sName + Out.log("setName('" + sName + "'), getName() return '" + gName + "'") + oObj.setName(oldName) + Test.MethodTested("setName()", bOK) + + Test.StartMethod("activate()") + bOK = true + oObj.activate() + Test.MethodTested("activate()", bOK) + + Test.StartMethod("deactivate()") + bOK = true + oObj.deactivate() + Test.MethodTested("deactivate()", bOK) + + Test.StartMethod("isActive()") + bOK = true + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop is always active") + bOK = oObj.isActive() + else + oObj.activate() + bOK = oObj.isActive() + if (Not bOK) then + Out.log("after activate() method call, isActive() returned false") + end if + oObj.deactivate() + bOK = Not oObj.isActive() + if (oObj.isActive()) then + Out.log("after deactivate() method call, isActive() returned true") + end if + end if + Test.MethodTested("isActive()", bOK) + + Test.StartMethod("getCreator()") + bOK = true + Dim creator As Object + creator = oObj.getCreator() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no creator") + else + bOK = Not isNull(creator) + end if + Test.MethodTested("getCreator()", bOK) + + Test.StartMethod("getComponentWindow()") + bOK = true + Dim compWin As Object + compWin = oObj.getComponentWindow() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no component window") + else + bOK = Not isNull(compWin) + end if + Test.MethodTested("getComponentWindow()", bOK) + + Test.StartMethod("getContainerWindow()") + bOK = true + Dim contWin As Object + contWin = oObj.getContainerWindow() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no container window") + else + bOK = Not isNull(contWin) + end if + Test.MethodTested("getContainerWindow()", bOK) + + Test.StartMethod("getController()") + bOK = true + Dim controller As Object + controller = oObj.getController() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no controller") + else + if (isNull(controller)) then + Out.log("getController() returns null") + bOK = false + else + Dim frm As Object + frm = controller.getFrame() + if (frm.getName() <> oObj.getName()) then + Out.log("Frame returned by controller not " + _ + "equals to frame testing") + bOK = false + end if + end if + end if + Test.MethodTested("getController()", bOK) + + Test.StartMethod("isTop()") + bOK = true + Out.log("isTop() = " + oObj.isTop()) + Test.MethodTested("isTop()", bOK) + + Test.StartMethod("findFrame()") + bOK = true + if (Not isNull(XFrame)) then + Out.log("Trying to find a frame with name 'XFrame' ...") + Dim aFrame As Object + aFrame = oObj.findFrame("XFrame", com.sun.star.frame.FrameSearchFlag.GLOBAL) + if (isNull(aFrame)) then + Out.log("findFrame('XFrame',com.sun.star.frame.FrameSearchFlag.GLOBAL) returns null") + bOK = false + elseif (XFrame.getName() <> aFrame.getName()) then + Out.log("findFrame('XFrame',com.sun.star.frame.FrameSearchFlag.GLOBAL)" _ + + " returns frame which is not equal to passed in relation") + bOK = false + end if + end if + Out.log("Trying to find a frame with name '_self' ...") + Dim frame As Object + frame = oObj.findFrame("_self", com.sun.star.frame.FrameSearchFlag.AUTO) + if (isNull(frame)) then + Out.log("findFrame('_self') returns null") + bOK = false + elseif (frame.getName() <> oObj.getName()) then + Out.log("findFrame('_self') returns frame which is not equal to tested") + bOK = false + end if + Test.MethodTested("findFrame()", bOK) + + Test.StartMethod("setCreator()") + bOK = true + oObj.setCreator(NULL_OBJECT) + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no creator") + else + bOK = isNull(oObj.getCreator()) + oObj.setCreator(creator) + end if + Test.MethodTested("setCreator()", bOK) + + Test.StartMethod("setComponent()") + bOK = true + Dim res As Boolean + res = oObj.setComponent(NULL_OBJECT, NULL_OBJECT) + if (res) then + ' component must be changed + bOK = isNull(oObj.getComponentWindow()) + bOK = bOK and isNull(oObj.getController()) + if (Not bOK) then + Out.log("setComponent() returns true, but component is not changed.") + end if + else + Out.log("frame is not allowed to change component") + end if + oObj.setComponent(compWin, controller) + Test.MethodTested("setComponent()", bOK) + + Test.StartMethod("initialize()") + bOK = true + oObj.initialize(contWin) + Test.MethodTested("initialize()", bOK) + + Test.StartMethod("addFrameActionListener()") + bOK = true + Dim listener1 As Object, listener2 As Object + listener1 = createUnoListener("FA1_", "com.sun.star.frame.XFrameActionListener") + listener2 = createUnoListener("FA2_", "com.sun.star.frame.XFrameActionListener") + initListeners() + oObj.activate() + oObj.deactivate() + oObj.activate() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("No actions supported by Desktop") + else + wait(1000) + if (Not listener1Called) then + bOK = false + Out.log("Listener1 wasn't called") + end if + if (Not listener2Called) then + bOK = false + Out.log("Listener2 wasn't called") + end if + if (Not activatedCalled1 or Not activatedCalled2) then + bOK = false + Out.log("Listener was called, FRAME_ACTIVATED was not") + endif + if (Not deactivatedCalled1 or Not deactivatedCalled2) then + bOK = false + Out.log("Listener was called, FRAME_DEACTIVATED was not") + endif + end if + Test.MethodTested("addFrameActionListener()", bOK) + + Test.StartMethod("removeFrameActionListener()") + bOK = true + Out.log("removes listener2") + oObj.removeFrameActionListener(listener2) + initListeners() + oObj.activate() + oObj.deactivate() + oObj.activate() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("No actions supported by Desktop") + else + wait(1000) + if (Not listener1Called) then + bOK = false + Out.log("Listener1 wasn't called") + end if + if (listener2Called) then + bOK = false + Out.log("Listener2 was called, but it was removed") + end if + end if + Test.MethodTested("removeFrameActionListener()", bOK) + + Test.StartMethod("contextChanged()") + bOK = true + oObj.addFrameActionListener(listener1) + initListeners() + oObj.contextChanged() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop cann't change context") + elseif(contextChanged1) then + bOK = true + elseif(listener1Called) then + bOK = false + Out.log("listener was called, but Action != CONTEXT_CHANGED") + else + bOK = false + Out.log("listener was not called on contextChanged() call") + end if + Test.MethodTested("contextChanged()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim listener1Called As Boolean +Dim listener2Called As Boolean +Dim activatedCalled1 As Boolean +Dim deactivatedCalled1 As Boolean +Dim contextChanged1 As Boolean +Dim activatedCalled2 As Boolean +Dim deactivatedCalled2 As Boolean + +Sub initListeners() + listener1Called = false + listener2Called = false + contextChanged1 = false + activatedCalled1 = false + deactivatedCalled1 = false + activatedCalled2 = false + deactivatedCalled2 = false +End Sub + +Sub FA1_frameAction(event As Object) + listener1Called = true + Out.Log("Listener1: frameAction: " + event.Action) + if (event.Action = com.sun.star.frame.FrameAction.FRAME_ACTIVATED) then + activatedCalled1 = true + elseif (event.Action = com.sun.star.frame.FrameAction.FRAME_DEACTIVATING) then + deactivatedCalled1 = true + elseif (event.Action = com.sun.star.frame.FrameAction.CONTEXT_CHANGED) then + contextChanged1 = true + endif +End Sub + +Sub FA2_frameAction(event As Object) + listener2Called = true + Out.Log("Listener2: frameAction: " + event.Action) + if (event.Action = com.sun.star.frame.FrameAction.FRAME_ACTIVATED) then + activatedCalled2 = true + elseif (event.Action = com.sun.star.frame.FrameAction.FRAME_DEACTIVATING) then + deactivatedCalled2 = true + endif +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrame/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFrame/script.xlb new file mode 100644 index 000000000000..6d254d7d6afd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrame/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="frame_XFrame" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFrame"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba new file mode 100644 index 000000000000..713cbbf827dd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba @@ -0,0 +1,127 @@ +<?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="frame_XFrameLoader" 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 FrameLoaderURL As String +'Global FrameLoaderFrame As Object ' optional +'Global FrameLoaderArgs As Variant ' optional + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XFrameLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim frame As Object + Dim args As Variant + Dim listener As Object + + if IsNULL(FrameLoaderFrame) then + Out.log("Frame is NULL") + Dim oDsk As Object + oDsk = createUnoService("com.sun.star.frame.Desktop") + frame = oDsk.getCurrentFrame() + else + frame = FrameLoaderFrame + endif + + if IsArray(FrameLoaderArgs) then + Out.log("Args isn't array") + Dim emptyAr As Variant + args = emptyAr + else + args = FrameLoaderArgs + endif + + listener = createUnoListener("L_", "com.sun.star.frame.XLoadEventListener") + initListener() + + Test.StartMethod("cancel()") + + oObj.load(frame, FrameLoaderURL, args, listener) + oObj.cancel() + wait(200) + + bOK = loadCancelled OR loadFinished + + Test.MethodTested("cancel()", bOK) + + Test.StartMethod("load()") + + initListener() + oObj.load(frame, FrameLoaderURL, args, listener) + wait(200) + bOK = loadFinished AND Not loadCancelled + + Test.MethodTested("load()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub initListener() + loadFinished = false + loadCancelled = false +End Sub + +Dim loadFinished As Boolean +Dim loadCancelled As Boolean + +Sub L_loadFinished() + Out.Log("Listener: loadFinished") + loadFinished = true +End Sub + +Sub L_loadCancelled() + Out.Log("Listener: loadCancelled") + loadCancelled = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrameLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/script.xlb new file mode 100644 index 000000000000..ec903f42eeed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/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="frame_XFrameLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFrameLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba new file mode 100644 index 000000000000..b3217b33fdd4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba @@ -0,0 +1,129 @@ +<?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="frame_XFramesSupplier" 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.frame.XFramesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getFrames()") + bOK = true + Dim frames As Object + frames = oObj.getFrames() + Dim cnt As Integer + if (Not isNull(frames) ) then + cnt = frames.getCount() + bOK = cnt <> 0 + Out.log("There are " + cnt + " frames.") + else + Out.log("getFrames() returned null !!!") + bOK = false + end if + Dim i As Integer + for i = 0 to (cnt - 1) + Dim fr As Object + fr = frames.getByIndex(i) + if (isNull(fr)) then + Out.log("Frame(" + i + ") == null") + bOK = false + end if + next i + Test.MethodTested("getFrames()", bOK) + + Test.StartMethod("getActiveFrame()") + bOK = true + Dim active As Object + active = oObj.getActiveFrame() + active.setName("ActiveFrame") + Dim hasActiveFrame As Boolean + Dim activeIndex As Integer + if (isNull(active)) then + bOK = false + Out.log("getActiveFrame() returned null") + else + hasActiveFrame = false + for i = 0 to (cnt - 1) + fr = frames.getByIndex(i) + if (fr.getName() = "ActiveFrame") then + hasActiveFrame = true + activeIndex = i + end if + next i + if (Not hasActiveFrame) then + Out.log("getActiveFrame() isn't contained in getFrames() collection") + bOK = false + end if + end if + Test.MethodTested("getActiveFrame()", bOK) + + Test.StartMethod("setActiveFrame()") + bOK = true + Dim sFrame As Object + if (cnt > 1) then + if (activeIndex <> 0) then + sFrame = frames.getByIndex(0) + else + sFrame = frame.getByIndex(1) + end if + else + sFrame = active + end if + sFrame.setName("Frame for set") + oObj.setActiveFrame(sFrame) + Dim gFrame As Object + gFrame = oObj.getActiveFrame() + if (gFrame.getName() <> "Frame for set") then + bOK = false + Out.log("Active frame set is not equal frame get: FAILED") + end if + Test.MethodTested("setActiveFrame()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/script.xlb new file mode 100644 index 000000000000..296097706b89 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/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="frame_XFramesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFramesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba b/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba new file mode 100644 index 000000000000..0c13d0c3d710 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba @@ -0,0 +1,145 @@ +<?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="frame_XModel" 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 oXModelController as Object +' - Global oXModelSel as Object +' - Global oXModelToSel as Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oController As Object + Dim oSelection As Object + Dim aArgs(0 to 0) As Variant + Dim oCursor As Object + Dim cURL As String + Dim i As Integer + Dim args1(0) As New com.sun.star.beans.PropertyValue + + Test.StartMethod("attachResource()") + args1(0).Name = "XModel" + bOK = oObj.attachResource(".component:DB/DataSourceBrowser", args1()) + Test.MethodTested("attachResource()", bOK) + + Test.StartMethod("getURL()") + bOK = true + cURL = oObj.getURL() + bOK = bOK AND (cURL = ".component:DB/DataSourceBrowser") + Test.MethodTested("getURL()", bOK) + + Test.StartMethod("getArgs()") + bOK = true + aArgs() = oObj.Args + bOK = bOK AND NOT isNull(aArgs()) '(0).Name = "XModel" + Test.MethodTested("getArgs()", bOK) + + Test.StartMethod("getCurrentController()") + bOK = true + Dim oCurrCtrl As Object + oCurrCtrl = oObj.getCurrentController() + bOK = bOK AND isObject(oCurrCtrl) + bOK = bOK AND hasUnoInterfaces(oCurrCtrl, "com.sun.star.frame.XController") + Test.MethodTested("getCurrentController()", bOK) + + Test.StartMethod("getCurrentSelection()") + bOK = true + Dim oCurrSelection As Object + oXModelSel.select(oXModelToSel) + oCurrSelection = oObj.getCurrentSelection() + bOK = bOK AND hasUnoInterfaces(oCurrSelection, "com.sun.star.uno.XInterface") + Test.MethodTested("getCurrentSelection()", bOK) + + Test.StartMethod("hasControllersLocked()") + bOK = true + ' there should no controllers be locked + bOK = bOK AND NOT oObj.hasControllersLocked() + Test.MethodTested("hasControllersLocked()", bOK) + + ' now lock controllers + Test.StartMethod("lockControllers()") + bOK = true + oObj.lockControllers() + ' controllers should be locked + bOK = bOK AND oObj.hasControllersLocked() + Test.MethodTested("lockControllers()", bOK) + + ' unlock controllers and check success + Test.StartMethod("unlockControllers()") + bOK = true + oObj.unlockControllers() + bOK = bOK AND NOT oObj.hasControllersLocked() + Test.MethodTested("unlockControllers()", bOK) + + Test.StartMethod("connectController()") + oObj.connectController(oXModelController) + Test.MethodTested("connectController()", bOK) + + Test.StartMethod("disconnectController()") + oObj.disconnectController(oXModelController) + oObj.connectController(oCurrCtrl) + Test.MethodTested("disconnectController()", bOK) + + Test.StartMethod("setCurrentController()") + oObj.setCurrentController(oCurrCtrl) + Test.MethodTested("setCurrentController()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XModel/script.xlb b/qadevOOo/tests/basic/ifc/frame/XModel/script.xlb new file mode 100644 index 000000000000..079f98424e95 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XModel/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="frame_XModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba b/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba new file mode 100644 index 000000000000..eb16431b0f7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba @@ -0,0 +1,116 @@ +<?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="frame_XStorable" 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.frame.XStorable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cLocation, cLocation1 As String + Dim i As Integer + Dim oDoc1 As Object + + bOK = true + cLocation = utils.getTempFileURL(cObjectName & "." & "XStorable.tmp") + if (FileExists(cLocation)) then + Kill(cLocation) + end if + + if (FileExists(cLocation & ".bak")) then + Kill(cLocation & ".bak") + end if + + Out.Log("cLocation: "+cLocation) + + Test.StartMethod("storeAsURL()") + bOK = true + oObj.storeAsURL(cLocation, DimArray()) + bOK = bOK AND oObj.hasLocation() + Test.MethodTested("storeAsURL()", bOK) + + Test.StartMethod("hasLocation()") + bOK = true + bOK = bOK AND oObj.hasLocation() + Test.MethodTested("hasLocation()", bOK) + + Test.StartMethod("isReadonly()") + bOK = true + bOK = bOK AND NOT oObj.isReadOnly() + Test.MethodTested("isReadonly()", bOK) + + Test.StartMethod("getLocation()") + bOK = true + bOK = bOK AND (oObj.getLocation = cLocation) + Out.Log("Location is: " & oObj.getLocation & " It should be: " & cLocation) + Test.MethodTested("getLocation()", bOK) + + Test.StartMethod("storeToURL()") + bOK = true + cLocation1 = cLocation + ".bak" + Out.Log("New Location: " + cLocation1) + oDoc.getDocumentInfo().setPropertyValue("Title", "frame_XStorable") + oObj.storeToURL(cLocation1, DimArray()) + oDoc1 = StarDesktop.loadComponentFromUrl(cLocation1, "sc.ScModelObj.XStorable.tmp.bak", 40, DimArray() ) + bOK = bOK AND (oDoc1.getDocumentInfo().getPropertyValue("Title") = "frame_XStorable") + if bOK then Out.Log("Document titles are equal") + oDoc1.dispose() + Test.MethodTested("storeToURL()", bOK) + + Test.StartMethod("store()") + bOK = true + oObj.storeAsURL(cLocation1, DimArray()) + oDoc.getDocumentInfo().setPropertyValue("Title", "frame_XStorable12345") + oObj.store() + oDoc1 = StarDesktop.loadComponentFromUrl(cLocation1, "sc.ScModelObj.XStorable.tmp.bak", 40, DimArray() ) + bOK = bOK AND (oDoc1.getDocumentInfo().getPropertyValue("Title") = "frame_XStorable12345") + if bOK then Out.Log("Document titles are equal") + oDoc1.dispose() + Test.MethodTested("store()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XStorable/script.xlb b/qadevOOo/tests/basic/ifc/frame/XStorable/script.xlb new file mode 100644 index 000000000000..f52674f15c6a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XStorable/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="frame_XStorable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XStorable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba new file mode 100644 index 000000000000..918fafd7d6e9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba @@ -0,0 +1,87 @@ +<?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="frame_XSynchronousFrameLoader" 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 oFrame As Object +' Global sURL As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XSynchronousFrameLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("load()") + + Dim url As new com.sun.star.util.URL + url.Complete = sURL + Dim prop(0) As new com.sun.star.beans.PropertyValue + prop(0).Name = "URL" + prop(0).Value = url + + out.log("Load document with URL: " + sURL) + bOK = oObj.load(prop(), oFrame) + + Test.MethodTested("load()", bOK) + + Test.StartMethod("cancel()") + oObj.cancel() + bOK = True + Test.MethodTested("cancel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/script.xlb new file mode 100644 index 000000000000..14ff69fcef13 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/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="frame_XSynchronousFrameLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XSynchronousFrameLoader"/> +"</library:library> |