summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/basic/ifc/sdbc
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/basic/ifc/sdbc')
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/ResultSet/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba64
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/RowSet/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba78
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XCloseable/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba79
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba71
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDataSource/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba74
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDriver/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba104
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDriverManager/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba86
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba76
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XParameters/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba211
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSet/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba311
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba61
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba138
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRow/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba317
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRowSet/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba107
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba514
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/script.xlb5
-rw-r--r--qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba64
32 files changed, 2435 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/ifc/sdbc/ResultSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/script.xlb
new file mode 100644
index 000000000000..32a0dc881d96
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/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="sdbc_ResultSet" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_ResultSet"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba
new file mode 100644
index 000000000000..8c4be7b77bd1
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdbc_ResultSet" 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()
+
+'*************************************************************************
+' SERVICE:
+' com.sun.star.sdbc.ResultSet
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+
+ PropertyTester.TestProperty("CursorName")
+
+ PropertyTester.TestProperty("ResultSetConcurrency")
+
+ PropertyTester.TestProperty("ResultSetType")
+
+ PropertyTester.TestProperty("FetchDirection")
+
+ PropertyTester.TestProperty("FetchSize")
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/RowSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/RowSet/script.xlb
new file mode 100644
index 000000000000..b29bd1235b71
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/RowSet/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="sdbc_RowSet" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_RowSet"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba b/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba
new file mode 100644
index 000000000000..dccad879e23f
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba
@@ -0,0 +1,78 @@
+<?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="sdbc_RowSet" 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()
+
+'*************************************************************************
+' SERVICE:
+' com.sun.star.sdbc.RowSet
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+
+ PropertyTester.TestProperty("DataSourceName")
+
+ PropertyTester.TestProperty("URL")
+
+ PropertyTester.TestProperty("Command")
+
+ PropertyTester.TestProperty("TransactionIsolation")
+
+ PropertyTester.TestProperty("TypeMap")
+
+ PropertyTester.TestProperty("EscapeProcessing")
+
+ PropertyTester.TestProperty("QueryTimeOut")
+
+ PropertyTester.TestProperty("MaxFieldSize")
+
+ PropertyTester.TestProperty("MaxRows")
+
+ PropertyTester.TestProperty("User")
+
+ PropertyTester.TestProperty("Password")
+
+ PropertyTester.TestProperty("ResultSetType")
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XCloseable/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/script.xlb
new file mode 100644
index 000000000000..52cb7f319887
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/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="sdbc_XCloseable" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XCloseable"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba
new file mode 100644
index 000000000000..19240d37a292
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba
@@ -0,0 +1,79 @@
+<?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="sdbc_XCloseable" 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.sdbc.XCloseable
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+
+ Test.StartMethod("close()")
+ bOK = true
+
+ Out.Log("Checking if the object is valid before closing ...")
+ oObj.first()
+
+ oObj.close()
+
+ Dim bEx As Boolean
+ bEx = false
+ On Error Goto ExpectErr
+ Out.Log("Checking if the row set was closed ...")
+ oObj.first()
+ On Error Goto ErrHndl
+
+ bOK = bEx
+
+ Test.MethodTested("close()", bOK)
+
+ ReCreateObj()
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+
+ExpectErr:
+ Out.Log("Proper exception occured")
+ bEx = true
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/script.xlb
new file mode 100644
index 000000000000..735924c27e5c
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/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="sdbc_XColumnLocate" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XColumnLocate"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba
new file mode 100644
index 000000000000..b2570fa5238c
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.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="sdbc_XColumnLocate" 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 cExistantColumnName As String
+
+'*************************************************************************
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XColumnLocate
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+
+ Test.StartMethod("findColumn()")
+ bOK = true
+ iColumn = oObj.findColumn(cExistantColumnName)
+
+ bOK = bOK AND iColumn &lt;&gt; 0
+ Test.MethodTested("findColumn()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDataSource/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/script.xlb
new file mode 100644
index 000000000000..e5ffc7e4109a
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/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="sdbc_XDataSource" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XDataSource"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba
new file mode 100644
index 000000000000..6596f68fc20f
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba
@@ -0,0 +1,74 @@
+<?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="sdbc_XDataSource" 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.sdbc.XDataSource
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+ Test.StartMethod("getConnection()")
+ Dim connection As Object
+ connection = oObj.getConnection("", "")
+ bOK = Not IsNull(connection)
+ Test.MethodTested("getConnection()", bOK)
+
+ Test.StartMethod("getLoginTimeout()")
+ Dim timeout As Integer
+ timeout = oObj.getLoginTimeout()
+ bOK = timeout = 0
+ Test.MethodTested("getLoginTimeout()", bOK)
+
+ Test.StartMethod("setLoginTimeout()")
+ oObj.setLoginTimeout(111)
+ timeout = oObj.getLoginTimeout()
+ bOK = timeout = 111
+ Test.MethodTested("setLoginTimeout()", bOK)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriver/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDriver/script.xlb
new file mode 100644
index 000000000000..e4f39f7430d6
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDriver/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="sdbc_XDriver" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XDriver"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba b/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba
new file mode 100644
index 000000000000..5e6a37c70e2e
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.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="sdbc_XDriver" 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 URL as String
+' Global info As Variant
+
+'*************************************************************************
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XDriver
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+ Test.StartMethod("acceptsURL()")
+ bOK = oObj.acceptsURL(URL)
+ Out.log("acceptsURL('" + URL + "')? " + bOK)
+ Test.MethodTested("acceptsURL()", bOK)
+
+ Test.StartMethod("connect()")
+ Out.log("connecting to '" + URL + "'")
+ Dim connection As Object
+ connection = oObj.connect(URL, info)
+ bOK = Not IsNull(connection)
+ Test.MethodTested("connect()", bOK)
+
+ Test.StartMethod("getPropertyInfo()")
+ Dim dpi As Variant
+ dpi = oObj.getPropertyInfo(URL, info)
+ bOK = Not IsNull(dpi)
+ if bOK then
+ Dim i As Integer
+ for i = 0 to ubound(dpi)
+ Out.log(dpi(i).Name + ": " + dpi(i).Value)
+ next i
+ endif
+ Test.MethodTested("getPropertyInfo()", bOK)
+
+ Test.StartMethod("getMajorVersion()")
+ bOK = true
+ Dim majVer As Integer
+ majVer = oObj.getMajorVersion()
+ Out.log("Major version: " + majVer)
+ Test.MethodTested("getMajorVersion()", bOK)
+
+ Test.StartMethod("getMinorVersion()")
+ bOK = true
+ Dim minVer As Integer
+ minVer = oObj.getMinorVersion()
+ Out.log("Minor version: " + minVer)
+ Test.MethodTested("getMinorVersion()", bOK)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/script.xlb
new file mode 100644
index 000000000000..e2b90a2b7f85
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/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="sdbc_XDriverManager" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XDriverManager"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba
new file mode 100644
index 000000000000..8adf6fd5828a
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdbc_XDriverManager" 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.sdbc.XDriverManager
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+ Test.StartMethod("getConnection()")
+ Dim connection As Object
+ connection = oObj.getConnection(dbaseUrl)
+ Out.log("getConnection('" + dbaseUrl + "')")
+ bOK = Not IsNull(connection)
+ Test.MethodTested("getConnection()", bOK)
+
+ Test.StartMethod("getConnectionWithInfo()")
+ Dim info(2) As new com.sun.star.beans.PropertyValue
+ info(0).Name = "user" : info(0).Value = jdbcUser
+ info(1).Name = "password" : info(1).Value = jdbcPassword
+ info(2).Name = "JavaDriverClass" : info(2).Value = "org.gjt.mm.mysql.Driver"
+ connection = oObj.getConnectionWithInfo(jdbcUrl, info())
+ Out.log("getConnectionWithInfo('" + jdbcUrl + "')")
+ bOK = Not IsNull(connection)
+ Test.MethodTested("getConnectionWithInfo()", bOK)
+
+ Test.StartMethod("getLoginTimeout()")
+ Dim timeout As Integer
+ timeout = oObj.getLoginTimeout()
+ Out.log("getLoginTimeout(): " + timeout)
+ bOK = true
+ Test.MethodTested("getLoginTimeout()", bOK)
+
+ Test.StartMethod("setLoginTimeout()")
+ oObj.setLoginTimeout(111)
+ Out.log("setLoginTimeout(): 111")
+ timeout = oObj.getLoginTimeout()
+ bOK = timeout = 111
+ Test.MethodTested("setLoginTimeout()", bOK)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/script.xlb
new file mode 100644
index 000000000000..93b938880d5a
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/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="sdbc_XIsolatedConnection" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XIsolatedConnection"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba
new file mode 100644
index 000000000000..f491c1d99085
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba
@@ -0,0 +1,76 @@
+<?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="sdbc_XIsolatedConnection" 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 handler As Object
+
+'*************************************************************************
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XIsolatedConnection
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+ Test.StartMethod("getIsolatedConnectionWithCompletion()")
+ Dim connection As Object
+ connection = oObj.getIsolatedConnectionWithCompletion(handler)
+ bOK = Not IsNull(connection)
+ Test.MethodTested("getIsolatedConnectionWithCompletion()", bOK)
+
+ Test.StartMethod("getIsolatedConnection()")
+ connection = oObj.getIsolatedConnection(handler)
+ bOK = Not IsNull(connection)
+ Test.MethodTested("getIsolatedConnection()", bOK)
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XParameters/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XParameters/script.xlb
new file mode 100644
index 000000000000..c2367a3e7172
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XParameters/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="sdbc_XParameters" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XParameters"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba b/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba
new file mode 100644
index 000000000000..6140ade242c1
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba
@@ -0,0 +1,211 @@
+<?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="sdbc_XParameters" 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 paramTypes As Variant
+' Array of Strings which describes the types of the query parameters
+
+'*************************************************************************
+
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XParameters
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim i As Integer
+
+ for i = 0 to ubound(paramTypes())
+ if (paramTypes(i) = "boolean") OR (paramTypes(i) = "byte") OR (paramTypes(i) = "short") OR _
+ (paramTypes(i) = "int") OR (paramTypes(i) = "long") OR (paramTypes(i) = "float") OR _
+ (paramTypes(i) = "double") OR (paramTypes(i) = "string") OR (paramTypes(i) = "bytes") OR _
+ (paramTypes(i) = "date") OR (paramTypes(i) = "time") OR (paramTypes(i) = "timestamp") OR _
+ (paramTypes(i) = "binarystream") OR (paramTypes(i) = "characterstream") then
+
+ bOK = true
+ oObj.setNull(i + 1, paramTypes(i))
+ Test.MethodTested("setNull()", bOK)
+ elseif paramTypes(i) = "ref" then
+ Out.Log("Don't know how to test this :(")
+' bOK = true
+' oObj.setObjectNull(i)
+' Test.MethodTested("setNull()", bOK)
+ end if
+
+
+ if paramTypes(i) = "boolean" then
+ Test.StartMethod("setBoolean()")
+ bOK = true
+ oObj.setBoolean(i + 1, true)
+ Test.MethodTested("setBoolean()", bOK)
+ elseif paramTypes(i) = "byte" then
+ Test.StartMethod("setByte()")
+ bOK = true
+ oObj.setByte(i + 1, 5)
+ Test.MethodTested("setByte()", bOK)
+ elseif paramTypes(i) = "short" then
+ Test.StartMethod("setShort()")
+ bOK = true
+ oObj.setShort(i + 1, 6)
+ Test.MethodTested("setShort()", bOK)
+ elseif paramTypes(i) = "int" then
+ Test.StartMethod("setInt()")
+ bOK = true
+ oObj.setInt(i + 1, 234)
+ Test.MethodTested("setInt()", bOK)
+ elseif paramTypes(i) = "long" then
+ Test.StartMethod("setLong()")
+ bOK = true
+ oObj.setLong(i + 1, 34656)
+ Test.MethodTested("setLong()", bOK)
+ elseif paramTypes(i) = "float" then
+ Test.StartMethod("setFloat()")
+ bOK = true
+ oObj.setFloat(i + 1, 98.765)
+ Test.MethodTested("setFloat()", bOK)
+ elseif paramTypes(i) = "double" then
+ Test.StartMethod("setDouble()")
+ bOK = true
+ oObj.setDouble(i + 1, 54.432)
+ Test.MethodTested("setDouble()", bOK)
+ elseif paramTypes(i) = "string" then
+ Test.StartMethod("setString()")
+ bOK = true
+ oObj.setString(i + 1, "XParameters")
+ Test.MethodTested("setString()", bOK)
+ elseif paramTypes(i) = "bytes" then
+ Test.StartMethod("setBytes()")
+ bOK = true
+ oObj.setBytes(i + 1, Array(1,2,3))
+ Test.MethodTested("setBytes()", bOK)
+ elseif paramTypes(i) = "date" then
+ Dim dat As new com.sun.star.util.Date
+
+ Test.StartMethod("setDate()")
+ bOK = true
+ oObj.setDate(i + 1, dat)
+ Test.MethodTested("setDate()", bOK)
+ elseif paramTypes(i) = "time" then
+ Dim tim As new com.sun.star.util.Time
+
+ Test.StartMethod("setTime()")
+ bOK = true
+ oObj.setTime(i + 1, tim)
+ Test.MethodTested("setTime()", bOK)
+ elseif paramTypes(i) = "timestamp" then
+ Dim timstmp As new com.sun.star.util.DateTime
+
+ Test.StartMethod("setTimestamp()")
+ bOK = true
+ oObj.setTimestamp(i + 1, timstmp)
+ Test.MethodTested("setTimestamp()", bOK)
+ elseif paramTypes(i) = "binarystream" then
+ Test.StartMethod("setBinaryStream()")
+ bOK = true
+ oObj.setBinaryStream(i + 1, ceateUnoService("com.sun.star.io.Pipe"))
+ Test.MethodTested("setBinaryStream()", bOK)
+ elseif paramTypes(i) = "characterstream" then
+ Test.StartMethod("setCharacterStream()")
+ bOK = true
+ oObj.setCharacterStream(i + 1, ceateUnoService("com.sun.star.io.Pipe"))
+ Test.MethodTested("setCharacterStream()", bOK)
+ elseif paramTypes(i) = "object" then
+ Test.StartMethod("setObject()")
+ bOK = true
+ oObj.setObject(i + 1, ceateUnoService("com.sun.star.io.Pipe"))
+ Test.MethodTested("setObject()", bOK)
+ elseif paramTypes(i) = "objectwithinfo" then
+ Out.Log("Don't know how to test this type :(")
+' Test.StartMethod("setObjectWithInfo()")
+' bOK = true
+' oObj.setObjectWithInfo()
+' bOK = bOK AND false
+' Test.MethodTested("setObjectWithInfo()", bOK)
+ elseif paramTypes(i) = "ref" then
+ Out.Log("Don't know how to test this type :(")
+' Test.StartMethod("setRef()")
+' bOK = true
+' oObj.setRef()
+' bOK = bOK AND false
+' Test.MethodTested("setRef()", bOK)
+ elseif paramTypes(i) = "blob" then
+ Out.Log("Don't know how to test this type :(")
+' Test.StartMethod("setBlob()")
+' bOK = true
+' oObj.setBlob()
+' bOK = bOK AND false
+' Test.MethodTested("setBlob()", bOK)
+ elseif paramTypes(i) = "clob" then
+ Out.Log("Don't know how to test this type :(")
+' Test.StartMethod("setClob()")
+' bOK = true
+' oObj.setClob()
+' bOK = bOK AND false
+' Test.MethodTested("setClob()", bOK)
+ elseif paramTypes(i) = "array" then
+ Out.Log("Don't know how to test this type :(")
+' Test.StartMethod("setArray()")
+' bOK = true
+' oObj.setArray()
+' bOK = bOK AND false
+' Test.MethodTested("setArray()", bOK)
+ end if
+ next i
+
+ Test.StartMethod("clearParameters()")
+ bOK = true
+ oObj.clearParameters()
+ Test.MethodTested("clearParameters()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/script.xlb
new file mode 100644
index 000000000000..8f24ba399ef1
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/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="sdbc_XResultSet" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XResultSet"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba
new file mode 100644
index 000000000000..2d694bdc3669
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba
@@ -0,0 +1,311 @@
+<?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="sdbc_XResultSet" 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 cXResultSetFirstRecord as String
+' Global cXResultSetLastRecord as String
+' Global cXResultSetRecord1 as String
+' Global cXResultSetRecord2 as String
+' Global cXResultSet2BeforeLastRecord as String
+
+'*************************************************************************
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XResultSet
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+
+ Out.Log("ReCreating Object, to be shure that it is in initial state.")
+
+ Test.StartMethod("beforeFirst()")
+ Test.StartMethod("isBeforeFirst()")
+ Test.StartMethod("isFirst()")
+ Test.StartMethod("first()")
+ Test.StartMethod("next()")
+
+ Test.StartMethod("afterLast()")
+ Test.StartMethod("isAfterLast()")
+ Test.StartMethod("isLast()")
+ Test.StartMethod("last()")
+ Test.StartMethod("previous()")
+
+ Test.StartMethod("getRow()")
+
+ Dim bBeforeFirst As Boolean
+ Dim bIsBeforeFirst As Boolean
+ Dim bIsBeforeFirstLoop As Boolean
+ Dim bIsFirst As Boolean
+ Dim bFirst As Boolean
+ Dim bNext As Boolean
+ Dim bAfterLast As Boolean
+ Dim bIsAfterLast As Boolean
+ Dim bIsAfterLastLoop As Boolean
+ Dim bIsLast As Boolean
+ Dim bLast As Boolean
+ Dim bPrevious As Boolean
+ Dim bGetRow As Boolean
+ Dim bLoopError as Boolean
+
+ bLoopError = false
+ bBeforeFirst = true
+ bIsBeforeFirst = true
+ bIsFirst = true
+ bFirst = true
+ bNext = true
+ bAfterLast = true
+ bIsAfterLast = true
+ bIsLast = true
+ bLast = true
+ bPrevious = true
+ bGetRow = true
+
+ oObj.beforeFirst()
+
+ Out.Log("Initially the cursor should be before first record.")
+ Out.Log("getRow(): expected : 0, actual: " + oObj.getRow())
+ if (oObj.getRow() = 0) then
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+ end if
+
+ Out.Log("Go to not first record...")
+ oObj.next
+ oObj.next
+ Out.Log("isBeforeFirst(): expected: 'false', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND NOT oObj.isBeforeFirst()
+
+ Out.Log("Go to before first record...")
+ oObj.beforeFirst()
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bBeforeFirst = bBeforeFirst AND oObj.isBeforeFirst()
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+
+ Out.Log("Go to previous position")
+ oObj.previous()
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+ bPrevious = bPrevious AND oObj.isBeforeFirst()
+
+ Out.Log("Go to first record...")
+ oObj.first()
+ Out.Log("isBeforeFirst(): expected: 'false', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND NOT oObj.isBeforeFirst()
+ Out.Log("isFirst(): expected: 'true', actual '" + oObj.isFirst() + "'")
+ bIsFirst = bIsFirst AND oObj.isFirst()
+ Out.Log("getRow(): expected : 1, actual: " + oObj.getRow())
+ bIsFirst = bIsFirst AND oObj.getRow() = 1
+ Out.Log("RowDsc should contain " + cXResultSetFirstRecord)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bFirst = bFirst AND inStr(1, oObj.getString(1), cXResultSetFirstRecord)
+
+ Out.Log("Go to previous position")
+ oObj.previous()
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+ bPrevious = bPrevious AND oObj.isBeforeFirst()
+ Out.Log("isFirst(): expected: 'false', actual '" + oObj.isFirst() + "'")
+ bIsFirst = bIsFirst AND NOT oObj.isFirst()
+
+ Out.Log("Go to beforeFirst()")
+ oObj.beforeFirst()
+ Out.Log("Iterate through all records form first to last")
+ Dim n As Integer
+ n = 0
+ bLoopError = false
+ bIsAfterLastLoop = oObj.isAfterLast()
+ while (n &lt; 1000 AND NOT bIsAfterLastLoop)
+ oObj.next()
+ n = n + 1
+ bIsAfterLastLoop = oObj.isAfterLast()
+ if bLoopError then
+ bLoopError = false
+ n = 1000
+ end if
+ wend
+
+ Out.Log("IsAfterLast(): expected: 'true', actual '" + oObj.IsAfterLast() + "'")
+ bIsAfterLast = bIsAfterLast AND oObj.isAfterLast()
+ Out.Log("IsLast(): expected: 'false', actual '" + oObj.IsLast() + "'")
+ bIsLast = bIsLast AND NOT oObj.isLast()
+ Out.Log("Amount of records is " + n)
+ Out.Log("Trying to go to next record")
+ oObj.next()
+ Out.Log("IsAfterLast(): expected: 'true', actual '" + oObj.IsAfterLast() + "'")
+ bIsAfterLast = bIsAfterLast AND oObj.isAfterLast()
+
+ Out.Log("Go to previous position.")
+ oObj.previous()
+ Out.Log("IsLast(): expected: 'true', actual '" + oObj.IsLast() + "'")
+ bIsLast = bIsLast AND oObj.isLast()
+ Out.Log("RowDsc should contain " + cXResultSetLastRecord)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bIsLast = bIsLast AND inStr(1, oObj.getString(1), cXResultSetLastRecord)
+
+ Out.Log("Iterate through all records form last to first")
+ bLoopError = false
+ bIsBeforeFirstLoop = oObj.isBeforeFirst()
+ while (n &gt; 0 AND NOT bIsBeforeFirstLoop)
+ oObj.previous()
+ n = n - 1
+ bIsBeforeFirstLoop = oObj.isBeforeFirst()
+ if bLoopError then
+ bLoopError = false
+ n = 0
+ end if
+ wend
+
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+
+ Out.Log("Trying to go to previous record")
+ oObj.previous()
+ Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'")
+ bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst()
+
+
+ Test.MethodTested("beforeFirst()", bBeforeFirst)
+ Test.MethodTested("isBeforeFirst()", bIsBeforeFirst)
+ Test.MethodTested("isFirst()", bIsFirst)
+ Test.MethodTested("first()", bFirst)
+ Test.MethodTested("next()", bNext)
+
+ Test.MethodTested("afterLast()", bAfterLast)
+ Test.MethodTested("isAfterLast()", bIsAfterLast)
+ Test.MethodTested("isLast()", bIsLast)
+ Test.MethodTested("last()", bLast)
+ Test.MethodTested("previous()", bPrevious)
+
+ Test.MethodTested("getRow()", bGetRow)
+
+
+ Test.StartMethod("absolute()")
+ bOK = true
+ Out.Log("Go to second record")
+ oObj.absolute(2)
+ Out.Log("RowDsc should contain " + cXResultSetRecord2)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord2)
+ Out.Log("Go to record -1")
+ oObj.absolute(-1)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ Out.Log("IsLast(): expected: 'true', actual '" + oObj.IsLast() + "'")
+ bOK = bOK AND oObj.isLast()
+ Out.Log("Go to record -2")
+ oObj.absolute(-2)
+ Out.Log("IsLast(): expected: 'false', actual '" + oObj.IsLast() + "'")
+ bOK = bOK AND NOT oObj.isLast()
+ Out.Log("RowDsc should contain " + cXResultSet2BeforeLastRecord)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bOK = bOK AND inStr(1, oObj.getString(1), cXResultSet2BeforeLastRecord)
+ Test.MethodTested("absolute()", bOK)
+
+ Test.StartMethod("relative()")
+ bOK = true
+ Out.Log("Go to before first record")
+ oObj.beforeFirst()
+ on error goto RelativeErrHndl
+ oObj.relative(1)
+ Out.Log("Exception expected!")
+ bOK = false
+ goto ContRelative
+ RelativeErrHndl:
+ Out.Log("Expected exception.")
+
+ ContRelative:
+ On Error Goto NewErrHndl
+ Out.Log("Go to first record and relative(1)")
+ oObj.next()
+ oObj.relative(1)
+ Out.Log("RowDsc should contain " + cXResultSetRecord2)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord2)
+ Out.Log("Go to relative(-1)")
+ oObj.relative(-1)
+ Out.Log("RowDsc should contain " + cXResultSetRecord1)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord1)
+ Out.Log("RowDsc is '" + oObj.getString(1) + "'")
+ Test.MethodTested("relative()", bOK)
+
+ Test.StartMethod("refreshRow()")
+ bOK = true
+ oObj.refreshRow()
+ Test.MethodTested("refreshRow()", bOK)
+
+ Test.StartMethod("rowUpdated()")
+ bOK = true
+ Out.Log("rowUpdated() is " + oObj.rowUpdated())
+ bOK = bOK AND NOT oObj.rowUpdated()
+ Test.MethodTested("rowUpdated()", bOK)
+
+ Test.StartMethod("rowInserted()")
+ bOK = true
+ Out.Log("rowInserted() is " + oObj.rowInserted())
+ bOK = bOK AND NOT oObj.rowInserted()
+ Test.MethodTested("rowInserted()", bOK)
+
+ Test.StartMethod("rowDeleted()")
+ bOK = true
+ Out.Log("rowDeleted() is " + oObj.rowDeleted())
+ bOK = bOK AND NOT oObj.rowDeleted()
+ Test.MethodTested("rowDeleted()", bOK)
+
+ Test.StartMethod("getStatement()")
+ bOK = true
+ oStatement = oObj.getStatement()
+ bOK = bOK AND NOT isNULL(oStatement)
+ Test.MethodTested("getStatement()", bOK)
+
+Exit Sub
+NewErrHndl:
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ bLoopError = true
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/script.xlb
new file mode 100644
index 000000000000..6e3f9179b493
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/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="sdbc_XResultSetMetaDataSupplier" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XResultSetMetaDataSupplier"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba
new file mode 100644
index 000000000000..53301bf52e90
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdbc_XResultSetMetaDataSupplier" 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.sdbc.XResultSetMetaDataSupplier
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oMetaData As Object
+
+
+ Test.StartMethod("getMetaData()")
+ bOK = true
+ oMetaData = oObj.getMetaData()
+ bOK = bOK AND hasUnoInterfaces(oMetaData, "com.sun.star.sdbc.XResultSetMetaData")
+ Test.MethodTested("getMetaData()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/script.xlb
new file mode 100644
index 000000000000..139cb18cc2f4
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/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="sdbc_XResultSetUpdate" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XResultSetUpdate"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba
new file mode 100644
index 000000000000..95b3788ed51a
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba
@@ -0,0 +1,138 @@
+<?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="sdbc_XResultSetUpdate" 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 textColumn As String
+
+'*************************************************************************
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XResultSetUpdate
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim iCount As Integer
+ Dim cString As String
+ Dim colIdx As Integer
+
+ colIdx = oObj.findColumn(textColumn)
+
+ Test.StartMethod("insertRow()")
+ bOK = true
+ iCount = countRows()
+ Out.Log("Initially " + countRows() + " records")
+ oObj.moveToInsertRow()
+ oObj.updateString(colIdx, "New string")
+ oObj.insertRow()
+ Out.Log("After inserting " + countRows() + " records")
+ oObj.last()
+ bOK = bOK AND oObj.getString(colIdx) = "New string"
+ bOK = bOK AND iCount = countRows() - 1
+ Test.MethodTested("insertRow()", bOK)
+
+ Test.StartMethod("cancelRowUpdates()")
+ bOK = true
+ oObj.last()
+ oObj.updateString(colIdx, "Changed string")
+ oObj.cancelRowUpdates()
+ bOK = bOK AND oObj.getString(colIdx) = "New string"
+ bOK = bOK AND iCount = countRows() - 1
+ Test.MethodTested("cancelRowUpdates()", bOK)
+
+ Test.StartMethod("updateRow()")
+ bOK = true
+ oObj.last()
+ oObj.updateString(colIdx, "Changed string")
+ oObj.updateRow()
+ bOK = bOK AND oObj.getString(colIdx) = "Changed string"
+ bOK = bOK AND iCount = countRows() - 1
+ Test.MethodTested("updateRow()", bOK)
+
+ Test.StartMethod("deleteRow()")
+ Dim rowsBefore As Integer, rowsAfter As Integer
+ bOK = true
+ rowsBefore = countRows()
+ oObj.Last()
+ oObj.deleteRow()
+ rowsAfter = countRows()
+ Out.Log("Rows before: " + rowsBefore + ", rows after: " + rowsAfter)
+ bOK = bOK AND iCount = rowsAfter
+ oObj.Last()
+ Out.Log(oObj.getString(colIdx))
+ Test.MethodTested("deleteRow()", bOK)
+
+ Test.StartMethod("moveToInsertRow()")
+ bOK = true
+ oObj.moveToInsertRow()
+ bOK = bOK AND oObj.getString(colIdx) = ""
+ Test.MethodTested("moveToInsertRow()", bOK)
+
+ Test.StartMethod("moveToCurrentRow()")
+ bOK = true
+ oObj.first()
+ oObj.next()
+ cString = oObj.getString(colIdx)
+ oObj.moveToInsertRow()
+ oObj.moveToCurrentRow()
+ bOK = bOK AND oObj.getString(colIdx) = cString
+ Test.MethodTested("moveToCurrentRow()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+Function countRows() As Integer
+ Dim iCount As Integer
+ iCount = 0
+ oObj.first()
+ while NOT oObj.isAfterLast()
+ iCount = iCount + 1
+ oObj.next()
+ wend
+ countRows() = iCount
+End Function
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRow/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRow/script.xlb
new file mode 100644
index 000000000000..0cda44d376bf
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRow/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="sdbc_XRow" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XRow"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba b/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba
new file mode 100644
index 000000000000..bfac0743d4b8
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba
@@ -0,0 +1,317 @@
+<?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="sdbc_XRow" 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 rowTypes As Variant
+' Array of Strings with description of column types
+
+'*************************************************************************
+
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XRow
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim i As Integer
+ Dim colType As String
+
+ Test.StartMethod("getBoolean()")
+ bOK = true
+ colType = "boolean"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getBoolean(i)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getBoolean()", bOK)
+
+ Test.StartMethod("getByte()")
+ bOK = true
+ colType = "byte"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getByte(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getByte()", bOK)
+
+ Test.StartMethod("getShort()")
+ bOK = true
+ colType = "short"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getShort(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getShort()", bOK)
+
+ Test.StartMethod("getInt()")
+ bOK = true
+ colType = "int"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getInt(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getInt()", bOK)
+
+ Test.StartMethod("getLong()")
+ bOK = true
+ colType = "long"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getLong(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getLong()", bOK)
+
+ Test.StartMethod("getFloat()")
+ bOK = true
+ colType = "float"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getFloat(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getFloat()", bOK)
+
+ Test.StartMethod("getDouble()")
+ bOK = true
+ colType = "double"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getDouble(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getDouble()", bOK)
+
+ Test.StartMethod("getString()")
+ bOK = true
+ colType = "string"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getString(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getString()", bOK)
+
+ Test.StartMethod("getBytes()")
+ bOK = true
+ colType = "bytes"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getBytes(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getBytes()", bOK)
+
+ Test.StartMethod("getDate()")
+ bOK = true
+ colType = "date"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getDate(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getDate()", bOK)
+
+ Test.StartMethod("getTime()")
+ bOK = true
+ colType = "time"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getTime(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getTime()", bOK)
+
+ Test.StartMethod("getTimestamp()")
+ bOK = true
+ colType = "timestamp"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getTimestamp(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getTimestamp()", bOK)
+
+ Test.StartMethod("getBinaryStream()")
+ bOK = true
+ colType = "binarystream"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getBinaryStream(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getBinaryStream()", bOK)
+
+ Test.StartMethod("getCharacterStream()")
+ bOK = true
+ colType = "characterstream"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getCharacterStream(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getCharacterStream()", bOK)
+
+ Test.StartMethod("getObject()")
+ bOK = true
+ colType = "object"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getObject(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getObject()", bOK)
+
+ Test.StartMethod("getRef()")
+ bOK = true
+ colType = "ref"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getRef(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getRef()", bOK)
+
+ Test.StartMethod("getBlob()")
+ bOK = true
+ colType = "blob"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getBlob(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getBlob()", bOK)
+
+ Test.StartMethod("getClob()")
+ bOK = true
+ colType = "clob"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getClob(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getClob()", bOK)
+
+ Test.StartMethod("getArray()")
+ bOK = true
+ colType = "array"
+ i = findColumn(colType)
+ if i >= 0 then
+ oObj.getArray(i + 1)
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ end if
+ Test.MethodTested("getArray()", bOK)
+
+
+ Test.StartMethod("wasNull()")
+ bOK = true
+ oObj.wasNull()
+ Test.MethodTested("wasNull()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+
+Function findColumn(cType As String) As Integer
+ Dim i As Integer
+
+ for i = lbound(rowTypes()) to ubound(rowTypes())
+ if rowTypes(i) = cType then
+ findColumn() = rowTypesCol(i)
+ exit function
+ end if
+ next i
+
+ findColumn() = -1
+End function
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/script.xlb
new file mode 100644
index 000000000000..099e40a905dc
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/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="sdbc_XRowSet" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XRowSet"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba
new file mode 100644
index 000000000000..5c7f4725cf3e
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba
@@ -0,0 +1,107 @@
+<?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="sdbc_XRowSet" 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.sdbc.XRowSet
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim list1 As Object, list2 As Object
+
+ bOK = true
+ Test.StartMethod("addRowSetListener()")
+
+ list1 = createUnoListener("L1_", "com.sun.star.sdbc.XRowSetListener")
+ list2 = createUnoListener("L2_", "com.sun.star.sdbc.XRowSetListener")
+ oObj.addRowSetListener(list1)
+ oObj.addRowSetListener(list2)
+
+ Test.StartMethod("removeRowSetListener()")
+ oObj.removeRowSetListener(list1)
+
+ Test.StartMethod("execute()")
+
+ l1Called = false
+ l2Called = false
+
+ oObj.execute()
+ bOK = bOK AND l2Called
+ Test.MethodTested("execute()", bOK)
+ Test.MethodTested("addRowSetListener()", bOK)
+
+ bOK = bOK AND NOT l1Called
+ Test.MethodTested("removeRowSetListener()", bOK)
+
+ oObj.removeRowSetListener(list2)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+
+Dim l1Called As Boolean, l2Called As Boolean
+
+Sub L1_cursorMoved()
+End Sub
+Sub L1_rowChanged()
+End Sub
+Sub L1_disposing()
+End Sub
+Sub L1_rowSetChanged()
+ l1Called = true
+ Out.Log("Listener 1 called")
+End Sub
+
+Sub L2_cursorMoved()
+End Sub
+Sub L2_rowChanged()
+End Sub
+Sub L2_disposing()
+End Sub
+Sub L2_rowSetChanged()
+ l2Called = true
+ Out.Log("Listener 2 called")
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/script.xlb
new file mode 100644
index 000000000000..7d8d5fb30e23
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/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="sdbc_XRowUpdate" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XRowUpdate"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba
new file mode 100644
index 000000000000..03dab0a3ccbf
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba
@@ -0,0 +1,514 @@
+<?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="sdbc_XRowUpdate" 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 rowTypes As Variant
+' must be an array of Strings with description of column types
+' - Global rowTypesCol As Variant
+' corresponding column numbers
+
+'*************************************************************************
+
+
+
+
+
+
+Sub RunTest()
+
+'*************************************************************************
+' INTERFACE:
+' com.sun.star.sdbc.XRowUpdate
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean, bNullOK As Boolean
+ Dim i As Integer
+ Dim getV As Variant, newV As Variant, resV As Variant
+ Dim colType As String
+
+ if NOT hasUnoInterfaces(oObj, "com.sun.star.sdbc.XRow") then
+ Out.Log("The interface com.sun.star.sdbc.XRow isn't supported by the component.")
+ Out.Log("The test must be upgraded !!!")
+ exit Sub
+ end if
+
+ Test.RecreateObj()
+
+ bNullOK = true
+
+ Test.StartMethod("updateBoolean()")
+ colType = "boolean"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getBoolean(i+1)
+ newV = NOT getV
+ oObj.updateBoolean(i+1, newV)
+ resV = oObj.getBoolean(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateBoolean()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getBoolean(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateBoolean()", true)
+ end if
+
+ Test.StartMethod("updateByte()")
+ colType = "byte"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getByte(i+1)
+ newV = getV + 1
+ oObj.updateByte(i+1, newV)
+ resV = oObj.getByte(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateByte()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getByte(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateByte()", true)
+ end if
+
+ Test.StartMethod("updateShort()")
+ colType = "short"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getShort(i+1)
+ newV = getV + 1
+ oObj.updateShort(i+1, newV)
+ resV = oObj.getShort(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateShort()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getShort(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateShort()", true)
+ end if
+
+ Test.StartMethod("updateInt()")
+ colType = "int"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getInt(i+1)
+ newV = getV + 1
+ oObj.updateInt(i+1, newV)
+ resV = oObj.getInt(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateInt()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getInt(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateInt()", true)
+ end if
+
+ Test.StartMethod("updateLong()")
+ colType = "long"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getLong(i+1)
+ newV = getV + 1
+ oObj.updateLong(i+1, newV)
+ resV = oObj.getLong(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateLong()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getLong(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateLong()", true)
+ end if
+
+ Test.StartMethod("updateFloat()")
+ colType = "float"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getFloat(i+1)
+ newV = getV + 1.3
+ oObj.updateFloat(i+1, newV)
+ resV = oObj.getFloat(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateFloat()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getFloat(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateFloat()", true)
+ end if
+
+ Test.StartMethod("updateDouble()")
+ colType = "double"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getDouble(i+1)
+ newV = getV + 1.5
+ oObj.updateDouble(i+1, newV)
+ resV = oObj.getDouble(i+1)
+ Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV)
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateDouble()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getDouble(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateDouble()", true)
+ end if
+
+ Test.StartMethod("updateString()")
+ colType = "string"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getString(i+1)
+ newV = "_" + getV
+ oObj.updateString(i+1, newV)
+ resV = oObj.getString(i+1)
+ Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'")
+ bOK = bOK AND (resV = newV)
+ Test.MethodTested("updateString()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getString(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateString()", true)
+ end if
+
+ Test.StartMethod("updateBytes()")
+ colType = "bytes"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getBytes(i+1)
+
+ if (oObj.wasNull() OR ubound(getV()) &lt; 0) then
+ newV = Array(1,2,3)
+ else
+ newV = getV
+ newV(0) = newV(0) + 1
+ end if
+
+ oObj.updateBytes(i+1, newV)
+ resV = oObj.getBytes(i+1)
+
+ Out.Log("Was: " + getv(0) + ", New: " + newV(0) + ", Res: " + resV(0))
+ bOK = bOK AND (resV(0) = newV(0))
+ Test.MethodTested("updateBytes()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getBytes(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateBytes()", true)
+ end if
+
+
+ Dim dat As com.sun.star.util.Date
+ Test.StartMethod("updateDate()")
+ colType = "date"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getDate(i+1)
+ if (oObj.wasNull() OR isNull(getV)) then
+ newV = dat
+ else
+ newV = getV
+ newV.Year = newV.Year + 1
+ end if
+
+ oObj.updateDate(i+1, newV)
+ resV = oObj.getDate(i+1)
+ Out.Log("Was: '" + getv.Year + "', New: '" + newV.Year + "', Res: '" + resV.Year + "'")
+ bOK = bOK AND (resV.Year = newV.Year)
+ Test.MethodTested("updateDate()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getDate(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateDate()", true)
+ end if
+
+ Dim tim As com.sun.star.util.Time
+ Test.StartMethod("updateTime()")
+ colType = "time"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getTime(i+1)
+ if (oObj.wasNull() OR isNull(getV)) then
+ newV = tim
+ else
+ newV = getV
+ newV.Seconds = newV.Seconds + 1
+ end if
+
+ oObj.updateTime(i+1, newV)
+ resV = oObj.getTime(i+1)
+ Out.Log("Was: '" + getv.Seconds + "', New: '" + newV.Seconds + "', Res: '" + resV.Seconds + "'")
+ bOK = bOK AND (resV.Seconds = newV.Seconds)
+ Test.MethodTested("updateTime()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getTime(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateTime()", true)
+ end if
+
+ Dim dattm As com.sun.star.util.DateTime
+ Test.StartMethod("updateTimestamp()")
+ colType = "timestamp"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getTimestamp(i+1)
+ if (oObj.wasNull() OR isNull(getV)) then
+ newV = dattm
+ else
+ newV = getV
+ newV.Year = newV.Year + 1
+ end if
+
+ oObj.updateTimestamp(i+1, newV)
+ resV = oObj.getTimestamp(i+1)
+ Out.Log("Was: '" + getv.Year + "', New: '" + newV.Year + "', Res: '" + resV.Year + "'")
+ bOK = bOK AND (resV.Year = newV.Year)
+ Test.MethodTested("updateTimestamp()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getTimestamp(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateTimestamp()", true)
+ end if
+
+ Dim bytes As Variant, nBytes As Long
+ Test.StartMethod("updateCharacterStream()")
+ colType = "characterstream"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ newV = createUnoService("com.sun.star.io.Pipe")
+ newV.writeBytes(Array(123, 234))
+ oObj.updateCharacterStream(i+1, newV)
+ resV = oObj.getCharacterStream(i+1)
+ 'Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'")
+ bOK = bOK AND NOT oObj.wasNull() AND NOT isNull(resV)
+
+ if bOK then
+ Out.Log("Testing further ...")
+ nBytes = resV.readBytes(bytes, 2)
+ bOK = bOK AND (nBytes = 2) AND (bytes(0) = 123) AND (bytes(1) = 234)
+ end if
+
+ Test.MethodTested("updateCharacterStream()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getCharacterStream(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateCharacterStream()", true)
+ end if
+
+ Test.StartMethod("updateBinaryStream()")
+ colType = "binarystream"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ newV = createUnoService("com.sun.star.io.Pipe")
+ newV.writeBytes(Array(123, 234))
+ oObj.updateBinaryStream(i+1, newV)
+ resV = oObj.getBinaryStream(i+1)
+ 'Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'")
+ bOK = bOK AND NOT oObj.wasNull() AND NOT isNull(resV)
+
+ if bOK then
+ Out.Log("Testing further ...")
+ nBytes = resV.readBytes(bytes, 2)
+ bOK = bOK AND (nBytes = 2) AND (bytes(0) = 123) AND (bytes(1) = 234)
+ end if
+
+ Test.MethodTested("updateBinaryStream()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getBinaryStream(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateBinaryStream()", true)
+ end if
+
+ Test.StartMethod("updateObject()")
+ colType = "object"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getObject(i+1)
+ if (NOT hasUnoInterfaces(getV, "com.sun.star.io.XInputStream")) then
+ newV = createUnoService("com.sun.star.io.DataInputStream")
+ else
+ newV = createUnoService("com.sun.star.io.DataOutputStream")
+ end if
+
+ oObj.updateObject(i+1, newV)
+ resV = oObj.getObject(i+1)
+
+ bOK = bOK AND (hasUnoInterfaces(newV, "com.sun.star.io.XInputStream") = _
+ hasUnoInterfaces(resV, "com.sun.star.io.XInputStream")) AND _
+ (hasUnoInterfaces(newV, "com.sun.star.io.XOutputStream") = _
+ hasUnoInterfaces(resV, "com.sun.star.io.XOutputStream"))
+
+ Test.MethodTested("updateObject()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getObject(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateObject()", true)
+ end if
+
+ Test.StartMethod("updateNumericObject()")
+ colType = "numericobject"
+ i = findColumn(colType)
+ if i >= 0 then
+ bOK = true
+ getV = oObj.getNumericObject(i+1)
+ if (NOT hasUnoInterfaces(getV, "com.sun.star.io.XInputStream")) then
+ newV = createUnoService("com.sun.star.io.DataInputStream")
+ else
+ newV = createUnoService("com.sun.star.io.DataOutputStream")
+ end if
+
+ oObj.updateNumericObject(i+1, newV, 0)
+ resV = oObj.getNumericObject(i+1)
+
+ bOK = bOK AND (hasUnoInterfaces(newV, "com.sun.star.io.XInputStream") = _
+ hasUnoInterfaces(resV, "com.sun.star.io.XInputStream")) AND _
+ (hasUnoInterfaces(newV, "com.sun.star.io.XOutputStream") = _
+ hasUnoInterfaces(resV, "com.sun.star.io.XOutputStream"))
+
+ Test.MethodTested("updateNumericObject()", bOK)
+
+ oObj.updateNull(i+1)
+ oObj.getNumericObject(i+1)
+ bNullOK = bNullOK AND oObj.wasNull()
+ else
+ Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.")
+ Out.Log("Nevertheless status is OK")
+ Test.MethodTested("updateNumericObject()", true)
+ end if
+
+ Test.StartMethod("updateNull()")
+ Test.MethodTested("updateNull()", bNullOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+
+Function findColumn(cType As String) As Integer
+ Dim i As Integer
+
+ for i = lbound(rowTypes()) to ubound(rowTypes())
+ if rowTypes(i) = cType then
+ findColumn() = rowTypesCol(i) - 1
+ exit function
+ end if
+ next i
+
+ findColumn() = -1
+End function
+</script:module>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/script.xlb
new file mode 100644
index 000000000000..20435089b7f1
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/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="sdbc_XWarningsSupplier" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="sdbc_XWarningsSupplier"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba
new file mode 100644
index 000000000000..39ac1729e41d
--- /dev/null
+++ b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdbc_XWarningsSupplier" 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.sdbc.XWarningsSupplier
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+
+ Test.StartMethod("clearWarnings()")
+ bOK = true
+ oObj.clearWarnings()
+ Test.MethodTested("clearWarnings()", bOK)
+
+
+ Test.StartMethod("getWarnings()")
+ bOK = true
+ bOK = bOK AND isEmpty(oObj.getWarnings())
+ Test.MethodTested("getWarnings()", bOK)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ bOK = false
+ resume next
+End Sub
+</script:module>