summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/basic/mod/stm
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/basic/mod/stm')
-rw-r--r--qadevOOo/tests/basic/mod/stm/DataInputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/DataInputStream/stm_DataInputStream.xba131
-rw-r--r--qadevOOo/tests/basic/mod/stm/DataOutputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/DataOutputStream/stm_DataOutputStream.xba115
-rw-r--r--qadevOOo/tests/basic/mod/stm/MarkableInputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/MarkableInputStream/stm_MarkableInputStream.xba125
-rw-r--r--qadevOOo/tests/basic/mod/stm/MarkableOutputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/MarkableOutputStream/stm_MarkableOutputStream.xba127
-rw-r--r--qadevOOo/tests/basic/mod/stm/ObjectInputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/ObjectInputStream/stm_ObjectInputStream.xba109
-rw-r--r--qadevOOo/tests/basic/mod/stm/ObjectOutputStream/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/ObjectOutputStream/stm_ObjectOutputStream.xba104
-rw-r--r--qadevOOo/tests/basic/mod/stm/Pipe/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/Pipe/stm_Pipe.xba81
-rw-r--r--qadevOOo/tests/basic/mod/stm/Pump/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/stm/Pump/stm_Pump.xba92
16 files changed, 924 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/mod/stm/DataInputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/DataInputStream/script.xlb
new file mode 100644
index 000000000000..e139fe6fdc1c
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/DataInputStream/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="stm_DataInputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_DataInputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/DataInputStream/stm_DataInputStream.xba b/qadevOOo/tests/basic/mod/stm/DataInputStream/stm_DataInputStream.xba
new file mode 100644
index 000000000000..541ee3f12d70
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/DataInputStream/stm_DataInputStream.xba
@@ -0,0 +1,131 @@
+<?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="stm_DataInputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global bInputStream As Boolean
+Global bOutputStream As Boolean
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.DataInputStream
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim oOS As Object
+
+ bInputStream = false
+ bOutputStream = false
+ cFileName = utils.getTempFileURL("BasicDataInputStream.dat")
+ oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+
+ oObj = createUnoService("com.sun.star.io.DataInputStream")
+
+ 'Creating a file...
+ oOS = oFileAcc.openFileWrite(cFileName)
+ oOS.closeOutput()
+
+ ResetStreams()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getOutStream() As Object
+On Error goto ErrHndl
+ Dim oFO As Object
+ ResetStreams()
+ oInputStream.closeInput()
+ oOutputStream = createUnoService("com.sun.star.io.DataOutputStream")
+ oFileAcc.kill(cFileName)
+ oFO = oFileAcc.openFileWrite(cFileName)
+ oOutputStream.setOutputStream(oFO)
+ bOutputStream = true
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Function getInStream() As Object
+On Error goto ErrHndl
+ ResetStreams()
+ getInStream() = oInputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+ if bInputStream then
+ oInputStream.closeInput()
+ bInputStream = false
+ end if
+ if bOutputStream then
+ oOutputStream.closeOutput()
+ bOutputStream = false
+ end if
+
+ if NOT oFileAcc.exists(cFileName) then
+ Dim oFO As Object
+ oFO = oFileAcc.openFileWrite(cFileName)
+ oFO.closeOutput()
+ end if
+
+ oInputStream = oFileAcc.openFileRead(cFileName)
+ bInputStream = true
+ oObj.setInputStream(oInputStream)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeInput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/DataOutputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/DataOutputStream/script.xlb
new file mode 100644
index 000000000000..efe7b2965fe1
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/DataOutputStream/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="stm_DataOutputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_DataOutputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/DataOutputStream/stm_DataOutputStream.xba b/qadevOOo/tests/basic/mod/stm/DataOutputStream/stm_DataOutputStream.xba
new file mode 100644
index 000000000000..35344daf0705
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/DataOutputStream/stm_DataOutputStream.xba
@@ -0,0 +1,115 @@
+<?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="stm_DataOutputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global bInputStream As Boolean
+Global bOutputStream As Boolean
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.DataOutputStream
+'*************************************************************************
+On Error Goto ErrHndl
+ bInputStream = false
+ bOutputStream = false
+ cFileName = utils.getTempFileURL("BasicDataOutputStream.dat")
+ oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+
+ oObj = createUnoService("com.sun.star.io.DataOutputStream")
+ ResetStreams()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getInStream() As Object
+On Error goto ErrHndl
+ Dim oFI As Object
+ ResetStreams()
+ oInputStream = createUnoService("com.sun.star.io.DataInputStream")
+ oFI = oFileAcc.openFileRead(cFileName)
+ oInputStream.setInputStream(oFI)
+ bInputStream = true
+ getInStream() = oInputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Function getOutStream() As Object
+On Error goto ErrHndl
+ ResetStreams()
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+ if bInputStream then
+ oInputStream.closeInput()
+ bInputStream = false
+ end if
+ if bOutputStream then
+ oOutputStream.closeOutput()
+ bOutputStream = false
+ end if
+ oOutputStream = oFileAcc.openFileWrite(cFileName)
+ bOutputStream = true
+ oObj.setOutputStream(oOutputStream)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeOutput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/MarkableInputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/MarkableInputStream/script.xlb
new file mode 100644
index 000000000000..111d34113e5e
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/MarkableInputStream/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="stm_MarkableInputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_MarkableInputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/MarkableInputStream/stm_MarkableInputStream.xba b/qadevOOo/tests/basic/mod/stm/MarkableInputStream/stm_MarkableInputStream.xba
new file mode 100644
index 000000000000..2e4b93d772a8
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/MarkableInputStream/stm_MarkableInputStream.xba
@@ -0,0 +1,125 @@
+<?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="stm_MarkableInputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global bInputStream As Boolean
+Global bOutputStream As Boolean
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.MarkableInputStream
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim oOS As Object
+
+ bInputStream = false
+ bOutputStream = false
+ cFileName = utils.getTempFileURL("BasicMarkableIOStream.dat")
+ oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+
+ oObj = createUnoService("com.sun.star.io.MarkableInputStream")
+ 'Creating a file...
+ if oFileAcc.exists(cFileName) then oFileAcc.Kill(cFileName)
+ oOS = oFileAcc.openFileWrite(cFileName)
+ oOS.closeOutput()
+
+ ResetStreams()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getInStream() As Object
+On Error goto ErrHndl
+ ResetStreams()
+ getInStream() = oInputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Function getOutStream() As Object
+On Error goto ErrHndl
+ Dim oFO As Object
+
+ ResetStreams()
+ oOutputStream = createUnoService("com.sun.star.io.MarkableOutputStream")
+ oInputStream.closeInput()
+ oFileAcc.Kill(cFileName)
+ oFO = oFileAcc.openFileWrite(cFileName)
+ oOutputStream.setOutputStream(oFO)
+ bOutputStream = true
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+ if bOutputStream then
+ oOutputStream.closeOutput()
+ bOutputStream = false
+ end if
+ if bInputStream then
+ oInputStream.closeInput()
+ bInputStream = false
+ end if
+ oInputStream = oFileAcc.openFileRead(cFileName)
+ bInputStream = true
+ oObj.setInputStream(oInputStream)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeInput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/script.xlb
new file mode 100644
index 000000000000..98c1f2b8c4d3
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/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="stm_MarkableOutputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_MarkableOutputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/stm_MarkableOutputStream.xba b/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/stm_MarkableOutputStream.xba
new file mode 100644
index 000000000000..b9e9835dcd43
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/MarkableOutputStream/stm_MarkableOutputStream.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="stm_MarkableOutputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global bInputStream As Boolean
+Global bOutputStream As Boolean
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.MarkableOutputStream
+'*************************************************************************
+On Error Goto ErrHndl
+
+ bInputStream = false
+ bOutputStream = false
+ cFileName = utils.getTempFileURL("BasicMarkableIOStream.dat")
+ oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+
+ oObj = createUnoService("com.sun.star.io.MarkableOutputStream")
+
+ ResetStreams()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getOutStream() As Object
+On Error Goto ErrHndl
+ CloseStreams()
+ oOutputStream = oFileAcc.openFileWrite(cFileName)
+ bOutputStream = true
+ oObj.setOutputStream(oOutputStream)
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Function getInStream() As Object
+On Error Goto ErrHndl
+ Dim oFI As Object
+
+ CloseStreams()
+ oInputStream = createUnoService("com.sun.star.io.MarkableInputStream")
+ oFI = oFileAcc.openFileRead(cFileName)
+ oInputStream.setInputStream(oFI)
+ bInputStream = true
+ getInStream() = oInputStream
+
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+ CloseStreams()
+ oFileAcc.Kill(cFileName)
+ oOutputStream = oFileAcc.openFileWrite(cFileName)
+ bOutputStream = true
+ oObj.setOutputStream(oOutputStream)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub CloseStreams()
+ if bOutputStream then
+ oObj.closeOutput()
+ bOutputStream = false
+ end if
+ if bInputStream then
+ oInputStream.closeInput()
+ bInputStream = false
+ end if
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeOutput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/ObjectInputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/ObjectInputStream/script.xlb
new file mode 100644
index 000000000000..27475e3cc3c0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/ObjectInputStream/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="stm_ObjectInputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_ObjectInputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/ObjectInputStream/stm_ObjectInputStream.xba b/qadevOOo/tests/basic/mod/stm/ObjectInputStream/stm_ObjectInputStream.xba
new file mode 100644
index 000000000000..df0bbfd4e9b9
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/ObjectInputStream/stm_ObjectInputStream.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="stm_ObjectInputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global oMarkOut As Object, oMarkIn As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.ObjectInputStream
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim oPipe As Object
+
+ oObj = createUnoService("com.sun.star.io.ObjectInputStream")
+ oMarkIn = createUnoService("com.sun.star.io.MarkableInputStream")
+ oPipe = createUnoService("com.sun.star.io.Pipe")
+ oMarkOut = createUnoService("com.sun.star.io.MarkableOutputStream")
+ oOutputStream = createUnoService("com.sun.star.io.ObjectOutputStream")
+ oObj.setInputStream(oMarkIn)
+ oMarkIn.setInputStream(oPipe)
+ oMarkOut.setOutputStream(oPipe)
+ oOutputStream.setOutputStream(oMarkOut)
+ oInputStream = oObj
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getInStream() As Object
+On Error Goto ErrHndl
+ getInStream() = oInputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Function getOutStream() As Object
+On Error Goto ErrHndl
+ Dim oNewPipe As Object
+
+ oNewPipe = createUnoService("com.sun.star.io.Pipe")
+ oMarkIn.getInputStream().closeInput()
+ oMarkOut.getOutputStream().closeOutput()
+ oMarkIn.setInputStream(oNewPipe)
+ oMarkOut.setOutputStream(oNewPipe)
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+Exit Sub
+ErrHndl:
+ Out.Log("ResetStreams: exception: " + error)
+ resume next
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeInput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/script.xlb b/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/script.xlb
new file mode 100644
index 000000000000..2388085a07d5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/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="stm_ObjectOutputStream" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_ObjectOutputStream"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/stm_ObjectOutputStream.xba b/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/stm_ObjectOutputStream.xba
new file mode 100644
index 000000000000..2e041224c9ac
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/ObjectOutputStream/stm_ObjectOutputStream.xba
@@ -0,0 +1,104 @@
+<?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="stm_ObjectOutputStream" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global cFileName As String
+Global oFileAcc As Object
+Global oInputStream As Object
+Global oOutputStream As Object
+Global oMarkOut As Object, oMarkIn As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.ObjectOutputStream
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim oPipe As Object
+
+ oObj = createUnoService("com.sun.star.io.ObjectOutputStream")
+ oMarkOut = createUnoService("com.sun.star.io.MarkableOutputStream")
+ oPipe = createUnoService("com.sun.star.io.Pipe")
+ oMarkIn = createUnoService("com.sun.star.io.MarkableInputStream")
+ oInputStream = createUnoService("com.sun.star.io.ObjectInputStream")
+ oObj.setOutputStream(oMarkOut)
+ oMarkOut.setOutputStream(oPipe)
+ oMarkIn.setInputStream(oPipe)
+ oInputStream.setInputStream(oMarkIn)
+ oOutputStream = oObj
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getInStream() As Object
+On Error Goto ErrHndl
+ Dim oFI As Object
+
+ getInStream() = oInputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Function getOutStream() As Object
+On Error Goto ErrHndl
+ getOutStream() = oOutputStream
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error goto ErrHndl
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub DisposeObj()
+ if NOT isNULL(oObj) then oObj.closeOutput()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/Pipe/script.xlb b/qadevOOo/tests/basic/mod/stm/Pipe/script.xlb
new file mode 100644
index 000000000000..f13f198a9dd0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/Pipe/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="stm_Pipe" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_Pipe"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/Pipe/stm_Pipe.xba b/qadevOOo/tests/basic/mod/stm/Pipe/stm_Pipe.xba
new file mode 100644
index 000000000000..2aab9c88cc2a
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/Pipe/stm_Pipe.xba
@@ -0,0 +1,81 @@
+<?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="stm_Pipe" 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 CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.Pipe
+'*************************************************************************
+On Error Goto ErrHndl
+ oObj = createUnoService("com.sun.star.io.Pipe")
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Function getInStream() As Object
+On Error Goto ErrHndl
+ getInStream() = oObj
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getInStream() = NULL_OBJECT
+End Function
+
+Function getOutStream() As Object
+On Error Goto ErrHndl
+ getOutStream() = oObj
+Exit Function
+ErrHndl:
+ Test.Exception()
+ getOutStream() = NULL_OBJECT
+End Function
+
+Sub ResetStreams()
+On Error Goto ErrHndl
+ oObj.closeInput()
+ oObj.closeOutput()
+ oObj = createUnoService("com.sun.star.io.Pipe")
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/stm/Pump/script.xlb b/qadevOOo/tests/basic/mod/stm/Pump/script.xlb
new file mode 100644
index 000000000000..848abf83b3ba
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/Pump/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="stm_Pump" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="stm_Pump"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/stm/Pump/stm_Pump.xba b/qadevOOo/tests/basic/mod/stm/Pump/stm_Pump.xba
new file mode 100644
index 000000000000..46f1a9e77835
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/stm/Pump/stm_Pump.xba
@@ -0,0 +1,92 @@
+<?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="stm_Pump" 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
+
+
+' REQUIRED VARIABLES for interface/service tests:
+Global oPipe As Object
+Global PumpOUTFileName As String
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' stm.Pump
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim oFileAcc As Object
+ Dim oDataInput As Object
+ Dim oDataOutput As Object
+ Dim oSFA As Object
+ Dim oOS As Object
+
+ oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+ PumpOUTFileName = utils.getTempFileURL("PumpOUT.dat")
+ if (FileExists(PumpOUTFileName)) then
+ oFileAcc.Kill(PumpOUTFileName)
+ end if
+
+ oObj = createUnoService("com.sun.star.io.Pump")
+ oPipe = createUnoService("com.sun.star.io.Pipe")
+
+ oDataInput = createUnoService("com.sun.star.io.DataInputStream")
+ oDataInput.setInputStream(oPipe)
+
+ oDataOutput = createUnoService("com.sun.star.io.DataOutputStream")
+ oSFA = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+ oOS = oSFA.openFileWrite(PumpOUTFileName)
+ oDataOutput.setOutputStream(oOS)
+
+ oObj.setInputStream(oDataInput)
+ oObj.setOutputStream(oDataOutput)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub DisposeObj()
+On Error goto ErrHndl
+ oObj.terminate()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub ResetStreams()
+End Sub
+</script:module>