Author: leszek
Date: 2006-09-11 10:46:12 -0400 (Mon, 11 Sep 2006)
New Revision: 65232

Added:
   trunk/mcs/class/System.Data.OracleClient/README.tests
   
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example
   
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleCommandTest.cs
   
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
Modified:
   trunk/mcs/class/System.Data.OracleClient/
   trunk/mcs/class/System.Data.OracleClient/ChangeLog
   trunk/mcs/class/System.Data.OracleClient/Makefile
   
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs
   
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
   
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test.dll.sources
   
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
Log:
Fixed bug 78509 in OracleParameter (trimming trailing spaces) and added 
regression test.
Fixed bug 78765 in OracleCommand (nulling the Connection/Transaction) and added 
regression test.



Property changes on: trunk/mcs/class/System.Data.OracleClient
___________________________________________________________________
Name: svn:ignore
   - .makefrag
.response
library-deps.stamp
*.dll
*.mdb
TestResult*
semantic.cache

   + .makefrag
.response
library-deps.stamp
*.dll
*.mdb
TestResult*
semantic.cache
System.Data.OracleClient_test_default.dll.config


Modified: trunk/mcs/class/System.Data.OracleClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data.OracleClient/ChangeLog  2006-09-11 14:38:40 UTC 
(rev 65231)
+++ trunk/mcs/class/System.Data.OracleClient/ChangeLog  2006-09-11 14:46:12 UTC 
(rev 65232)
@@ -1,3 +1,12 @@
+2006-08-21     Leszek Ciesielski <[EMAIL PROTECTED]>
+
+       * OracleCommand.cs : fix for bug 78765
+       * OracleParameter.cs : fix for bug 78509
+       * README.tests : New : information about running on-line tests from
+       Test/System.Data.OracleClient
+       * System.Data.OracleClient_test_default.dll.config.example : New : 
Example configuration
+       for     on-line tests from Test/System.Data.OracleClient
+
 2006-08-21     Boris Kirzner   <[EMAIL PROTECTED]>
 
        * run-tests.test.bat: fixes for NET_2_0 tests run.
@@ -11,7 +20,7 @@
        * System.Data.OracleClient.vmwcsproj: added OracleProvider.cs
 
 2006-03-13 Boris Kirzner <[EMAIL PROTECTED]>
-       * run-tests.bat, run-tests.test.bat: added batch files for automated 
testing 
+       * run-tests.bat, run-tests.test.bat: added batch files for automated 
testing
        support for TARGET_JVM.
 
 2006-03-10  Senganal T  <[EMAIL PROTECTED]>
@@ -23,7 +32,7 @@
 
        * System.Data.OracleClient/OracleConnection.cs: dispose of the
        connection string and other fields
-       
+
        * Test/TestOracleClient.cs: tests for Intergrated Security
        and Persist Secuirty Info connection string parameters
 
@@ -54,7 +63,7 @@
        * System.Data.OracleClient/OracleConnection.cs: for connection pooling, 
need to
        dispose of any connection pools properly otherwise a SEGSIGV may happen 
trying
        to detach from the server during finalization at exit of app
-       
+
        * System.Data.OracleClient/OracleDataReader.cs: need to make sure 
statement and command
        exists during dispose because they are set to null when closed
 
@@ -79,41 +88,41 @@
 
        * System.Data.OracleClient/OracleParameter.cs: patch
        from "Hubert FONGARNAND" <[EMAIL PROTECTED]>
-       - problems with OracleClob as input parameters 
-         (when the input parameter is an OracleString, 
+       - problems with OracleClob as input parameters
+         (when the input parameter is an OracleString,
          mono crashes with a invalidcastexception)
-    - problems with OracleDateTime.Null, OracleString.Null 
-      as input parameters (it works with DBNull.Value, 
+    - problems with OracleDateTime.Null, OracleString.Null
+      as input parameters (it works with DBNull.Value,
       but it fails with those parameters)
 
 2005-12-11  Daniel Morgan <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleCommand.cs: when
        binding the parameters, need to pass the parameter position
-       
+
        * System.Data.OracleClient/OracleDataReader.cs: null the statement 
handle
        after close
-       
+
        * System.Data.OracleClient/OracleParameter.cs: add support for an output
        parameter of Cursor to return an Oracle REF CURSOR as an 
OracleDataReader.
        Zsolt Petrény - Zsolt.Petreny at sensenet.hu helped contribute to this 
patch.
-       
+
        * Test/TestOracleClient.cs: add tests for REF CURSOR
-       
+
        * System.Data.OracleClient.Oci/OciHandle.cs:
        allow setting of the handle to free the previous handle if it existed
-       
+
        * System.Data.OracleClient.Oci/OciCalls.cs: add OCI Bind functions
        to bind a parameter using its position instead of its name
-       
+
        * System.Data.OracleClient.Oci/OciDataType.cs: add an OCI type of
        RSet for a REF CUROSR
-       
+
        * System.Data.OracleClient.Oci/OciDataType.cs: add RSet (REF CURSOR)
-       
+
        * System.Data.OracleClient.Oci/OciParameterDescriptor.cs: flush. REF
        is not an RSet
-       
+
        * System.Data.OracleClient.Oci/OciStatementHandle.cs: set up the result 
set
        for a statement handle for a REF CURSOR
 
@@ -127,10 +136,10 @@
 
 2005-08-10  Daniel Morgan <[EMAIL PROTECTED]>
 
-       * System.Data.OracleClient/OracleCommandBuilder.cs: update 
-       based on changes Suresh did to OdbcCommandBuilder, SqlCommandBuilder, 
+       * System.Data.OracleClient/OracleCommandBuilder.cs: update
+       based on changes Suresh did to OdbcCommandBuilder, SqlCommandBuilder,
        and DbDataAdapter
-       
+
        * System.Data.OracleClient/OracleParameter.cs
        * System.Data.OracleClient.Oci/OciHandle.cs
        * System.Data.OracleClient.Oci/OciCalls.cs
@@ -140,20 +149,20 @@
        * System.Data.OracleClient.Oci/OciDefineHandle.cs: with help
        from Hubert FONGARNAND <[EMAIL PROTECTED]>
        implement TIMESTAMP support via OciDateTime descriptor
-       
+
        * System.Data.OracleClient.dll.sources: add
        OciDateTimeDescriptor.cs to build
-       
+
        * System.Data.OracleClient.Oci/OciDateTimeDescriptor.cs: add new
        file to support Oracle TIMESTAMP using OciDateTime descriptor
 
 2005-07-25  Daniel Morgan <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleParameter.cs: apply
-       patch from 
+       patch from
        Hubert FONGARNAND <[EMAIL PROTECTED]>
        to tranmit an input paramter that is a date in a binary format
-       instead of a character format to avoid culture 
+       instead of a character format to avoid culture
        dependent problems
 
 2005-07-17  Daniel Morgan <[EMAIL PROTECTED]>
@@ -177,22 +186,22 @@
 
     * System.Data.OracleClient/OracleCommandBuilder.cs:
     implemented a working OracleCommandBuilder based on
-    current SqlCommandBuilder  
+    current SqlCommandBuilder
 
-       * System.Data.OracleClient/OracleCommand.cs: added 
+       * System.Data.OracleClient/OracleCommand.cs: added
        placeholder for DeriveParamters
 
        * System.Data.OracleClient/OracleDataReader.cs:
-               - sometimes trying to get records affected 
+               - sometimes trying to get records affected
                  throws an exception
-               - set BaseColumnName to the ColumnName 
+               - set BaseColumnName to the ColumnName
                  in the Schema table
                  if the command behavior is KeyInfo
                - only try to Read if there are rows to read
 
        * Test/OracleAdapterTest.cs: removed file
        because adapter tests added to TestOracleClient.cs
-                 
+
        * Test/TestOracleClient.cs: added tests
                - test ExecuteReader and records affected
                  executing a Non-Query
@@ -214,12 +223,12 @@
 
        * System.Data.OracleClient.Oci/OciParameterDescriptor.cs: add
        method to convert a OciDataType enum to OracleDataType enum
-       
+
        * System.Data.OracleClient.Oci/OciStatementHandle.cs: allow
        execute of DescribeOnly to support CommandBehavior.SchemaOnly
 
        * Test/OracleAdapterTest.cs: add file for adapter tests
-       
+
 2005-07-08  Daniel Morgan <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleParameter.cs
@@ -235,46 +244,46 @@
 
 2005-03-06  Daniel Morgan <[EMAIL PROTECTED]>
 
-       - Applied patch by Hubert FONGARNAND 
+       - Applied patch by Hubert FONGARNAND
          <[EMAIL PROTECTED]>
-       - Had to re-format according to mono style 
+       - Had to re-format according to mono style
          and remove Console.WriteLines
-       - Made sure maxPoolSize and minPoolSize can be specified 
+       - Made sure maxPoolSize and minPoolSize can be specified
          via the connection string, and that pooling can be disabled
        - if the next opened connection surpasses the max pool size, it waits
-         for a specified time in milliseconds, if it did not 
+         for a specified time in milliseconds, if it did not
          get another connection from the connection pool,
          throw an InvalidOperationException for timeout expired
-         
-       * System.Data.OracleClient.dll.sources: add 
+
+       * System.Data.OracleClient.dll.sources: add
        OracleConnectionPool.cs to the build
-       
-       * System.Data.OracleClient/OracleConnection.cs: modified 
+
+       * System.Data.OracleClient/OracleConnection.cs: modified
          - add connection pooling to OracleClient
          - GetNlsInfo () was not using the passed handle, it was always
          a session handle
-       
+
        * System.Data.OracleClient/OracleConnectionPoolManager.cs
        * System.Data.OracleClient/OracleConnectionPool.cs: added
        new file for connection pooling in OracleClient
-       
+
        * System.Data.OracleClient/Test/TestOracleClient.cs: added tests
        for OracleClient connection pooling
-       
+
 2005-02-25  Daniel Morgan <[EMAIL PROTECTED]>
 
-       * System.Data.OracleClient/OracleParameter.cs: modified 
+       * System.Data.OracleClient/OracleParameter.cs: modified
          - fix for input parameters for strings, dates,
-           CLOBs, and other types 
+           CLOBs, and other types
            to use OCIUnicodeToCharSet to convert
            the string to bytes that are in Oracle's character set
-         - fix for input parameters for BLOBs to 
+         - fix for input parameters for BLOBs to
            use OciDataType.LongRaw instead of Long
-         - fix for Raw data type 
+         - fix for Raw data type
            thanks to [EMAIL PROTECTED] (Curtis) which fixes bug #72416
-           and also fix "System.DataType" 
+           and also fix "System.DataType"
            to "System.DateTime" in InferOracleType
-           
+
        * Test/TestOracleClient.cs: handle byte[] from 
OracleDataReader.GetValue()
 
 2005-02-20  Daniel Morgan <[EMAIL PROTECTED]>
@@ -282,7 +291,7 @@
        * System.Data.OracleClient/OracleDataReader.cs: use ICovertible
        to convert data types for GetDateTime, GetInt64, GetInt32, GetFloat,
        GetDouble, GetDecimal.  Fixes bug #53391.
-       
+
        * Test/TestOracleClient.cs: updated OracleClient tests for
        these functions
 
@@ -295,130 +304,130 @@
 
        * System.Data.OracleClient/OracleDateTime.cs: modified -
        added functions for converting the date format strings between
-       OracleDateTime and DateTime based on 
+       OracleDateTime and DateTime based on
        the NLS_DATE_FORMAT on the Oracle server
-       
+
        * System.Data.OracleClient/OracleConnection.cs: implement
        internal function GetNlsInfo to get NLS info from the Oracle server
        for the session or environment.  Also, implemented function
        GetSessionNlsDateFormat to get Oracle's NLS_DATE_FORMAT string
-       
+
        * System.Data.OracleClient/OracleParameter.cs: for input parameters,
        fixed setting the parameter value to DBNull.Value and fixed the
        setting of a DateTime or OracleDateTime.  Tried to fix CLOBs/BLOBs, but
        it is still a TODO.
-       
+
        * Test/TestOracleClient.cs: updated the parameters test
-       
+
        * System.Data.OracleClient.Oci/OciHandle.cs: implement
        internal function SetAttributeString
-       
+
        * System.Data.OracleClient.Oci/OciCalls.cs: add DllImport
        OCIBindByNameBytes so byte array can be passed instead of IntPtr
-       for the value, add DllImport OCIDateTimeFromText, 
-       and added DllImport for OCINlsGetInfo to get NLS info, 
+       for the value, add DllImport OCIDateTimeFromText,
+       and added DllImport for OCINlsGetInfo to get NLS info,
        such as, NLS_DATE_FORMAT
-       
+
        * System.Data.OracleClient.Oci/OciAttributeType.cs: added
        attribute for date format (not used)
-       
+
        * System.Data.OracleClient.Oci/OciNlsServiceType.cs: added new file
        for an enum to hold NLS Service types which is to be used with 
GetNlsInfo()
        in OracleConnection
-       
+
        * System.Data.OracleClient.dll.sources: added OciNlsServiceType.cs to
        the build
-       
+
 2005-02-07  Daniel Morgan <[EMAIL PROTECTED]>
 
-       * System.Data.OracleClient/OracleDataReader.cs: add LONG 
+       * System.Data.OracleClient/OracleDataReader.cs: add LONG
        to GetOracleValue to return an OracleString
-       
+
        * System.Data.OracleClient.Oci/OciDefineHandle.cs: add
-       LONG VARCHAR support.  See DefineLong () 
+       LONG VARCHAR support.  See DefineLong ()
        for LAMESPEC about OCI
 
        * Test/TestOracleClient.cs: add LONG to Oracle tests
-               
+
 2005-01-09  Daniel Morgan <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleCommand.cs: set Command
        property on OciStatementHandle
-       
+
        * System.Data.OracleClient/OracleConnection.cs: implement
        properties ServerVersion and DataSource, partially
        implement method ICloneable Clone, implement
        connection StateChange and InfoMessage events
-       
+
        * System.Data.OracleClient/OciGlue.cs: add internal properties
        for OciSessionHandle and OciServerHandle
-       
+
        * System.Data.OracleClient/OracleInfoMessageEventArgs.cs:
        implement
-       
+
        * Test/TestOracleClient.cs: add new tests
-       
-       * System.Data.OracleClient.Oci/OciStatementHandle.cs: 
+
+       * System.Data.OracleClient.Oci/OciStatementHandle.cs:
        - add property for OracleCommand
        - patch from Joost Evertse <[EMAIL PROTECTED]>
          for handling OCI_SUCCES_WITH_INFO during Fetch which
          indicates a Warning info message
-       
+
        * System.Data.OracleClient.Oci/OciCalls.cs: added OCI call
        OCIServerVersion
-       
+
        * System.Data.OracleClient.Oci/OciDefineHandle.cs: flush
 
 2005-01-06  Daniel Morgan <[EMAIL PROTECTED]>
 
        * Assembly/AssemblyInfo.cs: updated copyright
-       
-       * System.Data.OracleClient/OracleCommand.cs: add 
-       connection string parameter "Server" and 
+
+       * System.Data.OracleClient/OracleCommand.cs: add
+       connection string parameter "Server" and
        removed "Database" to match .NET
-       
-       * System.Data.OracleClient/OracleLob.cs: handle 
+
+       * System.Data.OracleClient/OracleLob.cs: handle
                BLOBs and CLOBs that are not null, but are empty
-       
-       * System.Data.OracleClient/OracleCommand.cs: started 
+
+       * System.Data.OracleClient/OracleCommand.cs: started
                implementing Clone and ExecuteOracleScalar
-       
+
        * System.Data.OracleClient/OracleDataReader.cs: modified
        - ms.net has GetDataTypeName return data types upper case
        - implement     GetFieldType
-       - implement GetOracleValues, GetOracleValue, 
+       - implement GetOracleValues, GetOracleValue,
          GetOracleDateTime, GetOracleNumber, GetOracleString
        - modified GetOracleLob based on internal change
-       - fix GetSchemaTable to return the correct "DataType" 
+       - fix GetSchemaTable to return the correct "DataType"
                instead of always being System.String
-       - GetValue should return Blobs as a byte array and Clobs 
+       - GetValue should return Blobs as a byte array and Clobs
                as a string
        - Test/TestOracleClient.cs: updated Mono Oracle Tests
-       - System.Data.OracleClient.Oci/OciCalls.cs: update 
+       - System.Data.OracleClient.Oci/OciCalls.cs: update
                DllImports for data type, actual data size, and iters
 
        * System.Data.OracleClient.Oci/OciDefineHandle.cs: modified
        - added properties for precision and field type
-       - if ROWID is specified in a SELECT statement, handle 
-               the data type of OciDataType.RowIdDescriptor by just 
+       - if ROWID is specified in a SELECT statement, handle
+               the data type of OciDataType.RowIdDescriptor by just
                treating it as 10 byte string
        - do not free a HGlobal handle for a LOB since they do
                not get a HGlobal created for them
        - GetValue should return an OracleLob for BLOBs and CLOBs
-       
+
        * System.Data.OracleClient.Oci/OciDataType.cs: make enum
        OciDataType to be uint
-       
+
        * System.Data.OracleClient.Oci/OciParameterDescriptor.cs:
-       - add function to convert Oracle's data type name 
+       - add function to convert Oracle's data type name
                to .net data type name
-               
-       * System.Data.OracleClient.Oci/OciRowIdDescriptor.cs: flush     
 
+       * System.Data.OracleClient.Oci/OciRowIdDescriptor.cs: flush
+
 2004-09-14  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * Makefile: Activate unit tests.
-       * System.Data.OracleClient_test.dll.sources: New. Sources for unit 
+       * System.Data.OracleClient_test.dll.sources: New. Sources for unit
        tests.
 
 2004-06-19  Gert Driesen <[EMAIL PROTECTED]>
@@ -449,14 +458,14 @@
                Fixed namespace.
        * System.Data.OracleClient.dll.sources:
                Added OracleCommandBuilder.cs.
-               
+
 2004-05-26     Joerg Rosenkranz <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient.Oci/OciDefineHandle.cs:
-               Merged in a fix send by Rogerio Pereira Araujo 
-               <[EMAIL PROTECTED]>: Fixed a bug with NUMBER data type 
+               Merged in a fix send by Rogerio Pereira Araujo
+               <[EMAIL PROTECTED]>: Fixed a bug with NUMBER data type
                when no parameter is passed to OracleCommand.
-               
+
 2004-05-26  Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleType.cs: fixed values for Int16 and
@@ -479,12 +488,12 @@
                Changed statement encoding from UTF8 to OCIUnicodeToCharSet.
        * System.Data.OracleClient.Oci/OciDefineHandle.cs:
                Changed string encoding from UTF8 to OCICharSetToUnicode.
-       
+
 2004-05-21  Umadevi S  <[EMAIL PROTECTED]>
        * System.Data.OracleClient.Oci/OciDefineHandle.cs
-         Fixed bug 55030. Included checking for size           
-               
+         Fixed bug 55030. Included checking for size
 
+
 2004-05-20  Atsushi Enomoto <[EMAIL PROTECTED]>
 
        * OracleCommandBuilder.cs : Added (stub).
@@ -498,33 +507,33 @@
 2004-03-31  Joerg Rosenkranz  <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient.Oci/OciDefineHandle.cs:
-               Changed DefineChar to allow retrieval of 
+               Changed DefineChar to allow retrieval of
                multibyte characters (i.e. german umlauts).
        * System.Data.OracleClient.Oci/OciStatementHandle.cs:
                OciDefineHandles are now disposed in the
                Dispose function.
-               
+
 2004-02-09  Joerg Rosenkranz  <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleLob.cs:
                Changed Erase() to call Erase(offset, amount)
                using zero based offset.
-               
+
 2004-01-26  Joerg Rosenkranz  <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient.Oci/OciCalls.cs:
-               Changed binding of OciStmtPrepare from string 
+               Changed binding of OciStmtPrepare from string
                to byte [].
        * System.Data.OracleClient.Oci/OciDefineHandle.cs:
                Character types are converted using UTF8 encoding.
        * System.Data.OracleClient.Oci/OciStatementHandle.cs:
                SQL statement to be prepared is converted to byte
                array using UTF8 encoding.
-               
+
 2004-01-09  Joerg Rosenkranz  <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient.Oci/OciCalls.cs:
-               Added. It contains all external OCI calls which are 
+               Added. It contains all external OCI calls which are
                removed from all other files.
        * System.Data.OracleClient/OciGlue.cs:
                Fix for #52699 (OCI not thread safe).
@@ -559,7 +568,7 @@
        * System.Data.OracleClient.Oci/OciServiceHandle.cs:
        * System.Data.OracleClient.Oci/OciSessionHandle.cs:
                Replaced OCI calls.
-       
+
 2003-12-16  Joerg Rosenkranz  <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient/OracleCommand.cs:
@@ -695,8 +704,8 @@
                come.
        * Test/TestOracleClient.cs:
                New test for LOB added.
-       
 
+
 2003-02-20  Tim Coleman <[EMAIL PROTECTED]>
        * System.Data.OracleClient/OracleBFile.cs:
        * System.Data.OracleClient/OracleBinary.cs:
@@ -761,12 +770,12 @@
        * System.Data.OracleClient.Oci/OciColumnInfo.cs
        * System.Data.OracleClient/OciGlue.cs
        * System.Data.OracleClient/OracleDataReader.cs: fixes
-         to display character data in SQL# command-line 
+         to display character data in SQL# command-line
          and GTK# versions
-       
+
        * Test/TestOracleClient.cs: updated test to
          include reading data via the OracleDataReader
-       
+
        * System.Data.OracleClient/OracleConnection.cs: removed
          debug code
 
@@ -820,18 +829,18 @@
     * Test/Test.csproj
     * Test/Test.csproj.user: removed files because System.Data.OracleClient
     no longer uses a glue library
-    
+
     * System.Data.OracleClient/TODOAttribute.cs: added file
-    
+
     * System.Data.OracleClient/OracleCommand.cs
     * System.Data.OracleClient/OracleConnection.cs
     * System.Data.OracleClient/OciGlue.cs: modified -
     implement Disconnect and error handling (still need
     to create OracleException though)
-    
+
     * Test/TestOracleClient.cs: clean up and accept
-    connection parameters from command line   
-    
+    connection parameters from command line
+
 2003-02-11  Tim Coleman <[EMAIL PROTECTED]>
        * System.Data.OracleClient.Oci/OciAttributeType.cs:
        * System.Data.OracleClient.Oci/OciCredentialType.cs:
@@ -877,7 +886,7 @@
        * System.Data.OracleClient/OracleCommand.cs:
        * System.Data.OracleClient/OracleConnection.cs:
                Add some more implementation
-       
+
 2003-02-08  Tim Coleman <[EMAIL PROTECTED]>
        * System.Data.OracleClient/OciGlueLib_BCC_win32.make:
        * System.Data.OracleClient/OciGlueLib_MSVC_win32.make:
@@ -895,49 +904,49 @@
 
        * list
        * makefile.gnu: added files for linux build
-       
-       * System.Data.OracleClient.build: added file 
+
+       * System.Data.OracleClient.build: added file
        for windows build
-       
+
        * .cvsignore: added file for cvs to ignore files
 
        * System.Data.OracleClient/OciGlue.cs
        * System.Data.OracleClient/ociglue.h
-       * System.Data.OracleClient/ociglue.c: code clean up 
+       * System.Data.OracleClient/ociglue.c: code clean up
        and     better error handling
-       
+
 2002-12-05  Daniel Morgan <[EMAIL PROTECTED]>
 
        * System.Data.OracleClient
        * System.Data.OracleClient/System.Data.OracleClient
-         added directory to mcs/class for the Oracle 8i 
+         added directory to mcs/class for the Oracle 8i
          data provider
-       
+
        * System.Data.OracleClient/OciGlue.cs
        * System.Data.OracleClient/OracleConnection.cs
        * System.Data.OracleClient/OracleCommand.cs: added
        files for the System.Data.OracleClient.dll assembly
-       
+
        * System.Data.OracleClient/ociglue.c
        * System.Data.OracleClient/ociglue.h: added
        files for thte System.Data.OracleClient.gluelib.dll
        unmanaged c shared library
-       
+
        * System.Data.OracleClient/TestOracleClient.cs: test
        the OracleClient data provider for Oracle 8i database
-       
+
        * ChangeLog: added file
-       
+
        * README.TXT: added file
-       
+
        * System.Data.OracleClient/OciGlueLib_MSVC_win32.make:
-       added makefile for ociglue shared lib on Win32 platform 
+       added makefile for ociglue shared lib on Win32 platform
        and compiler Visual C++ 7.0
-       
+
        * System.Data.OracleClient/OciGlueLib_BCC_win32.make:
        added makefile for ociglue shared lib on Win32 platform
        and compiler Borland C++ 5.5
-       
+
        * MonoOracleClient.csproj
        * MonoOracleClient.csproj.usr
        * MonoOracleClient.sln

Modified: trunk/mcs/class/System.Data.OracleClient/Makefile
===================================================================
--- trunk/mcs/class/System.Data.OracleClient/Makefile   2006-09-11 14:38:40 UTC 
(rev 65231)
+++ trunk/mcs/class/System.Data.OracleClient/Makefile   2006-09-11 14:46:12 UTC 
(rev 65232)
@@ -24,6 +24,6 @@
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
 
-EXTRA_DISTFILES = Test/TestOracleClient.cs
+EXTRA_DISTFILES = Test/*.cs
 
 include ../../build/library.make

Added: trunk/mcs/class/System.Data.OracleClient/README.tests
===================================================================
--- trunk/mcs/class/System.Data.OracleClient/README.tests       2006-09-11 
14:38:40 UTC (rev 65231)
+++ trunk/mcs/class/System.Data.OracleClient/README.tests       2006-09-11 
14:46:12 UTC (rev 65232)
@@ -0,0 +1,5 @@
+Some tests located in Test/System.Data.OracleClient require a connection to 
Oracle database to execute.
+To configure a connection, copy 
System.Data.OracleClient_test_default.dll.config.example
+to System.Data.OracleClient_test_default.dll.config and fill in the 
OracleConnectionString with appropriate values.
+
+If no System.Data.OracleClient_test_default.dll.config is present, those tests 
will be ignored.

Modified: 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs
  2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs
  2006-09-11 14:46:12 UTC (rev 65232)
@@ -130,9 +130,8 @@
                [DefaultValue (null)]
                IDbConnection IDbCommand.Connection {
                        get { return Connection; }
-                       set { 
-                               if (!(value is OracleConnection))
-                                       throw new InvalidCastException ("The 
value was not a valid OracleConnection.");
+                       set {
+                                // InvalidCastException is expected when types 
do not match
                                Connection = (OracleConnection) value;
                        }
                }
@@ -143,9 +142,8 @@
 
                IDbTransaction IDbCommand.Transaction {
                        get { return Transaction; }
-                       set { 
-                               if (!(value is OracleTransaction))
-                                       throw new ArgumentException ();
+                       set {
+                                // InvalidCastException is expected when types 
do not match
                                Transaction = (OracleTransaction) value; 
                        }
                }

Modified: 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
        2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
        2006-09-11 14:46:12 UTC (rev 65232)
@@ -490,7 +490,7 @@
                                        bindSize = v.ToString ().Length;
                                }
                                else {
-                                       string svalue = v.ToString ();
+                                       string svalue = v.ToString () + '\0';
                                        rsize = 0;
                        
                                        // Get size of buffer
@@ -500,8 +500,8 @@
                                        bytes = new byte[rsize];
                                        OciCalls.OCIUnicodeToCharSet 
(statement.Parent, bytes, svalue, out rsize);
 
-                                       bindType = OciDataType.VarChar2;
-                                       bindSize = v.ToString ().Length;
+                                       bindType = OciDataType.String;
+                                       bindSize = v.ToString ().Length + 1;
                                }
                        }
 

Modified: 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test.dll.sources
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test.dll.sources
  2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test.dll.sources
  2006-09-11 14:46:12 UTC (rev 65232)
@@ -1 +1,3 @@
 System.Data.OracleClient/OraclePermissionAttributeTest.cs
+System.Data.OracleClient/OracleCommandTest.cs
+System.Data.OracleClient/OracleParameterTest.cs

Added: 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example
   2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example
   2006-09-11 14:46:12 UTC (rev 65232)
@@ -0,0 +1,5 @@
+<configuration>
+       <appSettings>
+               <add key="OracleConnectionString" value="Data Source=;User 
ID=;Password=;" />
+       </appSettings>
+</configuration>

Modified: 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
    2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
    2006-09-11 14:46:12 UTC (rev 65232)
@@ -1,3 +1,10 @@
+2006-09-11  Leszek Ciesielski  <[EMAIL PROTECTED]>
+
+       * OracleCommandTest.cs: New. Regression tests for class
+       OracleCommand.
+       * OracleParameterTest.cs: New. Regression tests for class
+       OracleParameter.
+
 2005-09-22  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * OraclePermissionAttributeTest.cs: Removed *Choice security actions.

Added: 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleCommandTest.cs
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleCommandTest.cs
 2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleCommandTest.cs
 2006-09-11 14:46:12 UTC (rev 65232)
@@ -0,0 +1,74 @@
+//
+// OracleCommandTest.cs -
+//      NUnit Test Cases for OraclePermissionAttribute
+//
+// Author:
+//      Leszek Ciesielski  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Forcom (http://www.forcom.com.pl/)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+using System.Data.OracleClient;
+using System.Data;
+using System;
+
+namespace MonoTests.System.Data.OracleClient {
+
+        [TestFixture]
+        public class OracleCommandTest {
+
+                OracleCommand command;
+                IDbCommand interface_command;
+
+                [SetUp]
+                public void SetUp ()
+                {
+                        command = new OracleCommand ();
+                        interface_command = command;
+                }
+
+                [Test] // regression for bug #78765
+                public void AllowNullConnectionTest ()
+                {
+                        command.Connection = null;
+                        try {
+                                interface_command.Connection = null;
+                        }
+                        catch (Exception) {
+                                Assert.Fail ("Connection property should be 
nullable");
+                        }
+                }
+
+                [Test] // regression for bug #78765
+                public void AllowNullTransactionTest ()
+                {
+                        command.Transaction = null;
+                        try {
+                                interface_command.Transaction = null;
+                        }
+                        catch (Exception) {
+                                Assert.Fail ("Transaction property should be 
nullable");
+                        }
+                }
+        }
+}
\ No newline at end of file

Added: 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
===================================================================
--- 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
       2006-09-11 14:38:40 UTC (rev 65231)
+++ 
trunk/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
       2006-09-11 14:46:12 UTC (rev 65232)
@@ -0,0 +1,110 @@
+//
+// OracleParameterTest.cs -
+//      NUnit Test Cases for OracleParameter
+//
+// Author:
+//      Leszek Ciesielski  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Forcom (http://www.forcom.com.pl/)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+using System.Configuration;
+using System.Data.OracleClient;
+using System.Data;
+using System;
+
+namespace MonoTests.System.Data.OracleClient {
+
+        [TestFixture]
+        public class OracleParameterTest {
+
+                String connection_string;
+                OracleConnection connection;
+                OracleCommand command;
+
+                // test string
+                string test_value = "  simply trim test      ";
+                string test_value2 = "  simply trim test in query      ";
+
+                [TestFixtureSetUp]
+                public void FixtureSetUp ()
+                {
+                        connection_string = 
ConfigurationSettings.AppSettings.Get ("OracleConnectionString");
+                        if(connection_string == null)
+                                Assert.Ignore ("Please consult README.tests.");
+                }
+
+                [SetUp]
+                public void SetUp ()
+                {
+                        connection = new OracleConnection (connection_string);
+                        connection.Open ();
+                        command = connection.CreateCommand ();
+
+                        // create the table
+                        command.CommandText =
+                                        "create table oratest (id number(10), 
text varchar2(64), text2 varchar2(64) )";
+                        command.ExecuteNonQuery ();
+                }
+
+                [TearDown]
+                public void TearDown ()
+                {
+                        command = connection.CreateCommand ();
+                        command.CommandText = "drop table oratest";
+                        command.ExecuteNonQuery ();
+
+                        connection.Close ();
+                        connection.Dispose ();
+                }
+
+                [Test] // regression for bug #78509
+                public void TrimsTrailingSpacesTest ()
+                {
+                        command = connection.CreateCommand (); // reusing 
command from SetUp causes parameter names mismatch
+
+                        // insert test values
+                        command.CommandText =
+                                        "insert into oratest (id,text,text2) 
values (:id,:txt,'" + test_value2 + "')";
+                        command.Parameters.Add (new OracleParameter ("ID", 
OracleType.Int32));
+                        command.Parameters.Add( new OracleParameter ("TXT", 
OracleType.VarChar));
+                        command.Parameters ["ID"].Value = 100;
+                        command.Parameters ["TXT"].Value = test_value;
+                        command.ExecuteNonQuery ();
+
+                        // read test values
+                        command.CommandText =
+                                        "select text,text2 from oratest where 
id = 100";
+                        command.Parameters.Clear ();
+                        using (OracleDataReader reader = command.ExecuteReader 
()) {
+                                if (reader.Read ()) {
+                                        Assert.AreEqual (test_value2, 
reader.GetString (1), "Directly passed value mismatched");
+                                        Assert.AreEqual (test_value, 
reader.GetString (0), "Passed through bind value mismatched");
+                                }
+                                else {
+                                        Assert.Fail("Expected records not 
found.");
+                                }
+                        }
+                }
+        }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to