88 Commits
Author SHA1 Message Date
Egor Bogatov 61559965a1 [System.Data] move to corefx (#4893)
* [System.Data] move to corefx

* [System.Data] Missing API: SqlTypesSchemaImporters

* [System.Data] Missing API: SqlNotification*

* [System.Data] Missing API: SqlDataSourceEnumerator

* [System.Data] Missing API: SQLDebugging

* [System.Data] fix build

* [System.Data] remove public API from different assemblies

* Apply corefx changes

* Hide some PropertiesTest (missing API in corefx)

* Missing API: TypedDataSetGenerator*, etc

* Missing API: SqlClientMetaDataCollectionNames

* Missing API: SqlCredential

* SqlMetaDataFactory.cs is actually sqlmetadatafactory.cs (case sensitive)

* Missing API: PoolBlockingPeriod

* Fix case-sensitive issues

* Odbc support (requires changes in corefx)

* ODBC support

* Re-enable ODBC ProviderTests

* Apply corefx changes

* temp commit: fix build

* Missing API: Microsoft.SqlServer.Server.*

* Missing API: DBDataPermission, OdbcPermission, SqlClientPermission

* Missing API: DbProviderFactoriesConfigurationHandler, DbProviderConfigurationHandler, DbProviderFactory.CreatePermission

* Missing API: DbProviderFactories

* Missing API: SqlCommand BeginXXX methods, SqlException.Message, OdbcFactory.CreatePermission

* Add System.Data.SqlClient.SqlMetaData.xml (embedded resource)

* reorganize *.sources files for win32, macos and linux

* bump corefx

* [System.Data] API: SqlDataSourceEnumerator, SqlClientFactory, SqlParameter, SqlMetaData

* [System.Data] cleanup

* [System.Data] mobile profile, cleanup

* [System.Data] Fix few odbc tests (changes are in corefx PR)

* [System.Data] fix Open_ConnectionString_DatabaseInvalid test

* [System.Data] enable all tests

* Add AsynchronousProcessing and ConnectionReset to SqlConnectionStringBuilder

* [System.Data] fix build

* fix all ProvierTests

* fix tests (files several issues against the corefx)

* system-data code cleanup

* system-data code cleanup

* add SqlTypesSchemaImporters

* remove corefx/RuntimeInformation.cs, add OleDbPermission stub

* OleDbPermission should be serializable (fixing tests)

* remove ODBC from mobile profile

* fix linux build - add 619 (obsolete) to nowarn list.

* temp commit

* fix a few api diff issues

* add OleDbType type (currently exists even in mobile profiles)

* add stubs

* Add stubs for OleDb

* improve oledb stubs

* improve oledb stubs

* improve oledb stubs

* more oledb stubs

* add xunit tests from corefx

* Add SqlClient corefx tests

* use corefx sources for System.Data.DataSetExtensions

* Remove [InternalsVisibleTo ("System.Data.DataSetExtensions")] from System.Data

* [System.Data] sync with external/corefx

* fix linux\macOS builds

* Fix xunit tests

* System.Data/Makefile cleanup

* tabify System.Data

* Rollback changes in System.Web & SqlSharpCli

* small cleanup

* [System.Data] Remove redundant .sources files

* [System.Data] update odbc Res.cs

* [System.Data] Remove redundant .sources files

* fix System.Data.dll.sources (add a blank line)

* remove TypeForwarder for DBNull and register xunit tests for System.Data

* Bump API snapshot submodule
2017-10-19 18:20:03 +02:00
Marek Safar 9b06c6a000 [System.Data] Update cas test category 2017-05-09 19:14:51 +02:00
Alexander Köplinger ceabda8a54 [corlib/System.Data] Test fixes for xammac 4.5 and watchos
The TrimSpecial() method and Windows-specific code was removed from
xammac 4.5 so reflection can't find it anymore, handle this case.

Also add a workaround for SqlParameterCollectionTest.CopyToTest()
which fails on watchos since the SqlCommand would throw a PNSE.
It's a workaround because it just makes the test ignored since we don't
set the env var that ConnectionManager.Instance.Sql reads in XI tests,
but it makes the test consistent with the other tests in the suite.
We should fix this properly later on.
2017-04-19 21:08:52 +02:00
Alexander Köplinger f11c25c426 [System.Data] Call SqlConnection.ClearAllPools() only when we had a connection
When ConnectionManager.Instance.Sql.ConnectionString throws in
SetUp() we'd still call SqlConnection.ClearAllPools() in the TearDown()
which happens for example when the connection string environment
variable is not set.

This is a problem on WatchOS since SqlConnection.ClearAllPools()
throws PlatformNotSupportedException there, making the tests fail.
Instead we now check whether the connectionString is set and only
call the method in that case.
2017-04-19 14:40:10 +02:00
Egor Bogatov 11789c98ce [System.Data] Fix Azure SQL specific issues (ProviderTests) (#4622)
* [System.Data] Fix Azure SQL specific issues (ProviderTests)

* [System.Data] ChangeDatabase - Azure specific test

* [System.Data] SqlConnectionTest: use Assert.Throws instead
2017-04-05 15:12:21 +02:00
Egor Bogatov 2115cd7394 [System.Data] Integration tests (#4538) 2017-03-22 13:51:57 +01:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Alexander Köplinger d4d7374efc [bcl] Remove ONLY_1_1 defines from class libs
This is not used anymore.
2015-01-21 17:18:30 +01:00
Alexander Köplinger 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01:00
vvaradhan ceefad76f1 2010-10-01 Veerapuram Varadhan <[email protected]>
** Fixes #561667
	* SqlCommand.cs (Dispose): While Disposing, set connection's
	datareader to null so the connection can be reused with another datareader.
2010-10-04 15:27:52 +05:30
vvaradhan b2285ad835 2010-09-29 Veerapuram Varadhan <[email protected]>
** Fixes failed test for smallmoney
	* Tds70.cs (WriteParameterInfo): Round money values to 4
	decimals, for smallmoney too.
2010-10-01 19:17:48 +05:30
vvaradhan 2ff8ca98f1 2010-09-20 Veerapuram Varadhan <[email protected]>
* SqlDataReaderTest.cs: Add test for bug#613087
2010-09-29 14:39:01 +05:30
vvaradhan 57e6ec2bdb test fixes 2010-09-29 14:37:37 +05:30
vvaradhan f5d5778245 2010-09-16 Veerapuram Varadhan <[email protected]>
* SqlCommandTest.cs: Add test for bug#569543
2010-09-28 20:36:55 +05:30
vvaradhan 29db32e771 2010-09-16 Veerapuram Varadhan <[email protected]>
* SqlCommandTest.cs: Add test for bug#584833
2010-09-28 20:28:44 +05:30
Veerapuram Varadhan b664161029 2010-04-21 Veerapuram Varadhan <[email protected]>
** Fixes #595918
	* Tds70.cs (WriteParameterInfo): Write updated decimal value
	according to specified scale value.

svn path=/trunk/mcs/; revision=155912
2010-04-21 20:21:41 +00:00
Gert Driesen 5def661365 * SqlDataReaderTest.cs: Fixes for SQL Server 7.0 / TDS 7. Avoid
catching and rethrowing AssertionException. Minor code formatting
changes.

svn path=/trunk/mcs/; revision=139244
2009-08-01 14:38:27 +00:00
Gert Driesen b5fa4ed568 * SqlCommandBuilderTest.cs: Fixes for SQL Server 7.0 / TDS 7.
* SqlCommandTest.cs: Fixes for SQL Server 7.0 / TDS 7.
* SqlConnectionTest.cs: Fixes for SQL Server 7.0 / TDS 7.
* SqlDataAdapterTest.cs: Added tests for Update. Fixed Fill_Test_Data,
Fill_Test_PriKey and Fill_Test_FillErrorTest to pass on SQL Server 7.0.
Avoid catching and rethrowing AssertionException. Minor improvements.
* SqlParameterTest.cs: Fixes for SQL Server 7.0 / TDS 7. Updated
ZeroLengthString to pass on 1.0 profile.
* SqlTransactionTest.cs: Fixes for SQL Server 7.0 / TDS 7.

svn path=/trunk/mcs/; revision=139242
2009-08-01 13:07:28 +00:00
Gert Driesen 86f912a56e * SqlParameterTest.cs: Improved tests for bug #382589.
svn path=/trunk/mcs/; revision=139119
2009-07-30 19:56:59 +00:00
Gert Driesen 594407eb88 * SqlParameter.cs: Modified ConvertToFrameworkType to only perform
conversion if type of value is different from "system type". Make
DbTypeMapping hashtable available on 1.0 profile, and add missing
mappings. Wrap FormatException adding information on conversion
that failed.
* SqlParameterTest.cs: Added test for bug #526794, and failed
conversion from (zero-length) string to int. Changed spaces to tabs.

svn path=/trunk/mcs/; revision=139116
2009-07-30 19:42:59 +00:00
Veerapuram Varadhan ea3ee3d074 Test fix.
svn path=/trunk/mcs/; revision=139064
2009-07-30 12:36:07 +00:00
Veerapuram Varadhan 8d5211d815 conflict fix between trunk and local tree
svn path=/trunk/mcs/; revision=139063
2009-07-30 12:35:52 +00:00
Gert Driesen 1925fbede7 * SqlCommandTest.cs: Improved test for invalid statement to cover
CloseConnection behavior.
* SqlCommand.cs: Ensure connection is closed if CloseConnection
behavior is set, and reader could not be created.

svn path=/trunk/mcs/; revision=138854
2009-07-28 17:24:35 +00:00
Veerapuram Varadhan 29eccae63a Fix for bug #382589 and corresponding tests
svn path=/trunk/mcs/; revision=134257
2009-05-16 01:16:05 +00:00
Veerapuram Varadhan fd5ac5b3ed TDS 8 changes
svn path=/trunk/mcs/; revision=125333
2009-02-02 11:05:18 +00:00
Gert Driesen 78a4d7dc71 * SqlCommandTest.cs: Added test for bug #470579.
svn path=/trunk/mcs/; revision=124992
2009-01-29 19:10:44 +00:00
Gert Driesen 7ecb22b4dd * SqlCommandBuilderTest.cs: Improved DeriveParameters test.
* SqlCommandTest.cs: Added InputOutput parameter to
StoredProc_ParameterTest.

svn path=/trunk/mcs/; revision=123716
2009-01-17 22:39:14 +00:00
Gert Driesen b49af57c79 Improved test for DeriveParameters.
svn path=/trunk/mcs/; revision=123674
2009-01-17 00:45:35 +00:00
Gert Driesen 42d7ff0754 Use existing sp for testing bug326182.
svn path=/trunk/mcs/; revision=123671
2009-01-16 23:42:44 +00:00
Gert Driesen 0886e7d542 Improve test to also cover specifying value in .ctor.
svn path=/trunk/mcs/; revision=123668
2009-01-16 23:25:28 +00:00
Gert Driesen a2589359cd * SqlCommandBuilderTest.cs: Improved tests to also check
behavior of RefreshSchema.
* SqlDataReaderTest.cs: Added tests for GetBytes.

svn path=/trunk/mcs/; revision=122398
2009-01-04 21:45:09 +00:00
Gert Driesen 37d01cae34 * SqlCommandBuilderTest.cs: Improve Get*Command tests.
* SqlCommandTest.cs: Fixed warning.
* SqlConnectionTest.cs: Removed unused property.
* SqlDataReaderTest.cs: Enabled GetChars test on 1.0
profile. Added GetValues test. Added and improved
GetSqlValue tests. Improved HasRows and NextResult
tests. Added GetFieldType tests. Added big batch of
schema-related tests.
* SqlParameterTest.cs: Moved disconnected tests to
System.Data test suite. Improved test for bug
#382635. Added test for failed conversion to SQL type.


svn path=/trunk/mcs/; revision=122382
2009-01-03 23:24:47 +00:00
Gert Driesen 25c01a2252 * app-default.config: Renamed to app-net_1_1.config, and added
providerTests section.
* app-net_2.0.config: Added providerTests section and removed
mono.data section.
* Makefile: Added support for CONNECTION variable and corresponding
PROVIDER_TESTS_CONNECTION environment variable. Always rebuild test
assembly since we have no dependency check for sources in place.
Only add reference to Mono.Data on 1.1 profile. Added reference to
System.Configuration on 2.0 profile.
* sqlserver.config: Merged into app-*.config.
* odbc.config: Merged into app-*.config.
* System.Data.Connected.Tests.dll.sources: Added ConnectionConfig.cs,
EngineConfig.cs, EngineType.cs, ProviderTestsConfigurationHandler.cs
and DbDataReaderTest.cs. Removed OdbcConnectionStringBuilderTest.cs.
* ConnectionConfig.cs:  Holds information on a specific connection and
corresponding engine to test.
* EngineConfig.cs: Holds information on the capabilities and behavior
of an RDBMS engine.
* EngineType.cs: Defines different database engines supported by the
provider tests.
* ConnectionManager.cs: Use DbProviderFactory and DbConnection
on 2.0 profile. Added support for new Connection/Engine configuration.
* ProviderTestsConfigurationHandler.cs: IConfigurationSectionHandler
for the ProviderTests section.
* DataReaderTest.cs: Added tests that were previously part of
SqlClient tests but apply to all families. Improved existing
tests.
* DbDataReaderTest.cs: Added GetProviderSpecificValues error check
 tests.
* IDbCommandTest.cs: Added ExecuteNonQuery tests for empty CommandText.
Added test for bug #462947.
* OdbcCommandBuilderTest.cs: Improved GetDeleteCommand,
GetInsertCommand and GetUpdateCommand tests. Added QuotePrefix,
QuoteSuffix and QuoteIdentifier tests.
* OdbcCommandTest.cs: Improved existing tests. Added
ExecuteNonQuery and Dispose tests.
* OdbcConnectionStringBuilderTest.cs: Moved to System.Data
test suite.
* OdbcDataAdapterTest.cs: Removed extra whitespace.
* OdbcDataReaderTest.cs: Added GetBytes and GetSchemaTable
tests.
* OdbcParameterCollectionTest.cs: Improve existing tests.
* OdbcParameterTest.cs: Added tests for several data types.
* SqlCommandBuilderTest.cs: Improve Get*Command tests.
* SqlCommandTest.cs: Added test for bug #341743. Added test
for connection state after executing invalid SQL. Improved
stored procedure test to check behavior with and without
leading '@' for parameter names. Minor formatting changes.
* SqlConnectionTest.cs: Split up connection string errors
test.
* SqlDataReaderTest.cs: Improved GetInt64Test. Improved and
added GetBytes tests. Added GetSqlValues and HasRows tests.
Added GetSchemaTable test. Improved GetProviderSpecificFieldType
tests.
* SqlParameterTest.cs: Improved ParameterType test. Added
type inferrence tests.
* SqlTransactionTest.cs: Allow not working tests to run on MS.
* MySQL_5.sql: Added numeric and decimal colums with different
precision and scale. Added more rows to binary_family. Added
nchar and nvarchar columns to string_family, and added extra
data. Added time and date columns to datetime_family.
* sqlserver.sql: Added numeric and decimal colums with different
precision and scale. Added timestamp column and more rows to
binary_family. Added nchar and nvarchar columns to string_family,
and added extra data. Added sp_326182 stored procedure.
* sybase.sql: Added more rows to binary_family.

svn path=/trunk/mcs/; revision=122297
2008-12-31 15:35:07 +00:00
Gert Driesen 39a234d167 * SqlConnectionTest.cs: Improve Database test.
svn path=/trunk/mcs/; revision=122270
2008-12-30 21:24:56 +00:00
Gert Driesen 573643b6fc * SqlCommandTest.cs: Added (SMALL)MONEY rounding tests.
svn path=/trunk/mcs/; revision=118536
2008-11-11 19:22:02 +00:00
Gert Driesen 79f260901c * SqlCommandTest.cs: Added tests for bug #428139. Added test for
SMALLMONEY overflows. Added workaround for Assert.AreEqual bug in 
NUnit v2.2.0. 

svn path=/trunk/mcs/; revision=118529
2008-11-11 18:20:27 +00:00
Gert Driesen 82dd9fc53c * TdsConnectionPool.cs: Added TdsConnectionPoolManager.GetConnection
overload that can be used to retrieve an existing connection pool.
Modified ResetConnectionPool () to skip free slots in the pool and to
close pooled connections that are not in use. Pooled connections that
are in use are now marked as non-pooled so that they are no longer
returned to the pool when they are closed. Fixes bug #443131.
* SqlConnection.cs: In Close, also remove reference to pool. In Open,
set TdsConnection.Pooling to false for a non-pooled connection.
Fixed ClearAllPools to no longer create a new connection for each
pool. In ClearPool, perform a lookup of the pool to clear using
the connectionstring as the pool field may refer to another pool
(as the connectionstring may have changed).
* SqlConnectionTest.cs: Added tests for ClearPool and ClearAllPools.

svn path=/trunk/mcs/; revision=118308
2008-11-09 13:36:37 +00:00
Gert Driesen d780e61bbd * SqlConnectionTest.cs: Added test for bug #383061.
svn path=/trunk/mcs/; revision=118279
2008-11-08 16:53:04 +00:00
Veerapuram Varadhan 862681f443 Added test for DeriveParameters
svn path=/trunk/mcs/; revision=113328
2008-09-17 16:54:30 +00:00
Gert Driesen ce5f523da5 * SqlCommandTest.cs: Enabled test for bug #412569.
* SqlCommand.cs (ExecuteReader): When behavior includes SingleRow,
then only return a single result. Fixes bug #412569.

svn path=/trunk/mcs/; revision=109065
2008-07-28 19:01:02 +00:00
Gert Driesen f5f8d8daba * SqlCommand.cs: Fixed param name in ArgumentException for negative
CommandTimeout to match MS. On 2.0 profile, throw NRE in Prepare
when connection is NULL. In Prepare, return immediately after
connection check (2.0 only) for stored procedures, or when no
parameters are added. Added check to see if transaction is
associated with same connection as the command and updated
exception messages.
* SqlCommandTest.cs: Enabled CommandTimeout test. Enabled test for
Prepare with NULL connection. Enabled test for bug #412586.
* SqlCommandTest.cs: Enabled and improved tests for pending transaction
and transaction that is not associated with connection. Added tests for
Prepare.

svn path=/trunk/mcs/; revision=109058
2008-07-28 18:15:17 +00:00
Gert Driesen ebf1361ab6 * SqlCommand.cs: Added bool argument to ValidateCommand to specify
whether an async method is being executed. Minor changes to exception
messages to match MS.
* SqlCommandTest.cs: Enabled and improved tests for Execute* with closed
connection.
* SqlCommandTest.cs: Enabled and improved tests for Execute* with only a
transaction set.

svn path=/trunk/mcs/; revision=109043
2008-07-28 16:17:55 +00:00
Gert Driesen b1e8819b84 * SqlCommand.cs: (Transaction): On the 1.0 profile, do not allow
Transaction to be set when a reader is open for the current connection.
Fixes bug #412579.
* SqlCommandTest.cs: Enabled test for bug #412579.

svn path=/trunk/mcs/; revision=109021
2008-07-28 15:15:54 +00:00
Gert Driesen 8185146fb8 * SqlCommand.cs (Connection): Do not throw InvalidOperationException
if transaction is in progress. Fixes bug #412576. On 1.0 profile, throw
InvalidOperationException when a reader is open for the current
connection. Do not set transaction to NULL when changing connection,
instead set it to null in Transaction when transaction is no longer
open.
* SqlCommandTest.cs: Enabled and improved test for bug #412576.
Enabled test for changing Connection while reader is open.

svn path=/trunk/mcs/; revision=109018
2008-07-28 15:07:45 +00:00
Gert Driesen 4c4ae3f815 * SqlConnection.cs: Use null as default value for connectionString
field. Remove Init method, as initialization is done in
SetDefaultConnectionParameters. Initialize parms in
SetDefaultConnectionParameters to avoid calling Reset on newly
initialized collection. In Dispose (bool), also invoke base.Dispose if 
SqlConnection was already disposed. Fixes bug #412571.
* SqlConnectionTest.cs: Enabled and improved test for bug #412571.

svn path=/trunk/mcs/; revision=109013
2008-07-28 14:46:55 +00:00
Gert Driesen 8485db3629 * SqlConnection.cs(ChangeState): Return immediately when new state
equals original state. Fixes bug #412574. Removed extra whitespace.
* SqlConnectionTest.cs: Enabled test for bug #412574.

svn path=/trunk/mcs/; revision=109009
2008-07-28 13:53:56 +00:00
Gert Driesen 1f47aabcf3 * SqlCommandTest.cs: Moved tests that do not require connection to
regular test suite. Improved existing tests, and added set of new
tests. Reduce failure count.
* SqlConnectionTest.cs: Moved tests that do not require connection to
regular test suite. Improved existing tests, and added set of new
tests. Reduce failure count.
* SqlTransactionTest.cs: Added several tests.

svn path=/trunk/mcs/; revision=108997
2008-07-28 12:58:58 +00:00
Veerapuram Varadhan 57e4a0605f Fixes #326182
svn path=/trunk/mcs/; revision=107667
2008-07-10 16:46:48 +00:00
Veerapuram Varadhan ffeabbcd92 Test case to verify Bug#382635
svn path=/trunk/mcs/; revision=104443
2008-05-29 17:28:36 +00:00
Nagappan Alagappan 831403d104 2007-10-19 Nagappan A <[email protected]>
* SqlCommandBuilderTest.cs: Fixed compilation warnings.


svn path=/trunk/mcs/; revision=87822
2007-10-19 11:49:41 +00:00