23 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
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 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01: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 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 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
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
Nagappan Alagappan f90d4f76a9 2007-07-31 Nagappan A <[email protected]>
* SqlConnectionTest.cs (InterfaceTransactionTest): Fixes bug
	82189. SqlConnection throws an exception if Connection or
	Transaction is set to null on IDbCommand interface.


svn path=/trunk/mcs/; revision=83061
2007-07-31 09:08:17 +00:00
Nagappan Alagappan 903da96171 2007-04-03 Amit Biswas <[email protected]>
* SqlDataReaderTest.cs (GetSqlBytesTest): Test case for GetSqlBytes
	(GetProviderSpecificFieldTypeTest): Test case for GetProviderSpecificFieldTypeTest
	(GetProviderSpecificValueTest): Test case for GetProviderSpecificValueTest
	(GetProviderSpecificValueLowerBoundaryTest):
	(GetProviderSpecificValueUpperBoundaryTest):
	(GetProviderSpecificValuesTest): Test case for GetProviderSpecificValuesTest
	(GetProviderSpecificValuesSmallArrayTest): Test case with an array smaller than no. of columns
	(GetProviderSpecificValuesLargeArrayTest): Test case with an array larger than no. of columns
	(GetProviderSpecificValuesNullTest): Test case for null parameters

	* SqlParameterTest.cs (XmlSchemaTest): Test case for properties related to XML schema
	(SourceColumnNullMappingTest): Test case for SourceColumnNullMappingTest
	(ctor7Test): Test case to the constructor new in .net 2.0

	* SqlParameterTest.cs (ParameterType): Corrected a bug in the test case regarding
	default values of SqlDbType and DbType
	(SqlDbTypeTest): Test for SqlDbType and DbType properties
	(ResetSqlDbTypeTest): Test for ResetSqlDbType method
	(ResetDbTypeTest): Test for ResetDbType method

	* SqlParameterCollectionTest.cs (CopyToTest): Test case for CopyTo method


svn path=/trunk/mcs/; revision=76656
2007-05-04 04:08:23 +00:00
Nagappan Alagappan 2ea5f59a13 2007-03-23 Nidhi Rawal <[email protected]>
* SqlCommandTest.cs (BeginExecuteXmlReaderTest): Written test case for the method
	BeginExecuteXmlReader.
	(BeginExecuteXmlReaderExceptionTest): Written test case for the method BeginExecuteXmlReader
	to check for InvalidOperationException.
	(CloneObjTest): Written test case for the method Clone.
	
	* SqlConnectionTest.cs (ChangePasswordNullConnStringTest): Written test case for the method
	ChangePassword to check for null connection string.
	(ChangePasswordNullPasswordTest): Written test case for the method ChangePassword to check for
	null new password.
	(ChangePasswordEmptyPasswordTest): Written test case for the method ChangePassword to check for
	password as empty string.
	(ChangePasswordExceedPasswordTest): Written test case for the method ChangePassword to check
	if the password exceeds its permitted size.
	
	* SqlClientFactory.cs: Created the class.
	(CreatePermissionTest): Added a test case for the method CreatePermission.

2007-03-20  Nidhi Rawal <[email protected]>

	* SqlConnectionStringBuilderTest.cs: Fixed the bug by including the 
	category sqlserver, in the absence of which none of the test-cases
	were executing.
	(TrustServerCertificateTest): Written test-case for the property TrustServerCertificate.
	(TypeSystemVersionTest): Written test-case for the property TypeSystemVersion.
	(UserInstanceTest): Written test-case for the property UserInstance.
	(SettingUserInstanceTest): Written test-case for checking the connection string after
	assigning the value for keyword User Instance.
	(ContextConnectionTest): Written test-case for the property ContextConnection.
	(SettingContextConnectionTest): Written test-case for checking the connection string after
	assigning the value for keyword Context Connection.

	* SqlCommandTest.cs (NotificationTest): Written test-case for property Notification.
	(NotificationAutoEnlistTest): Written the test-case for property NotificationAutoEnlist.

	* SqlConnectionTest.cs (FireInfoMessageEventOnUserErrorsTest): Written
	test-case for the property FireInfoMessageEventOnUserErrors.
	(StatisticsEnabledTest): Written test-case for the property StatisticsEnabled.

	* SqlDataAdapterTest.cs (UpdateBatchSizeTest): Written test-case for the
	property UpdateBatchSize.
	(UpdateBatchSizeArgumentOutOfRangeTest): Written test-case for the ArgumentOutOfRange
	exception for UpdateBatchSize property.

2007-03-19  Nidhi Rawal <[email protected]>

	* SqlParameterTest.cs (CompareInfoTest): Written the test case
	for property CompareInfo.
	(LocaleIdTest): Written the test case for property LocaleId.
	(SqlValueTest): Written test case for property SqlValue.


svn path=/trunk/mcs/; revision=75190
2007-03-30 12:44:22 +00:00
Nagappan Alagappan 2a3368d2bc 2006-12-20 Nagappan A <[email protected]>
* SqlDataAdapterTest.cs (SqlDataAdapterInheritTest): Implemented
	new class to verify protected method of DbDataAdapter.
	* Fixed existing test-cases to work with 2.0 profile.


svn path=/trunk/mcs/; revision=69820
2006-12-20 17:20:39 +00:00
Nagappan Alagappan 91b49d2187 * SqlConnectionTest.cs: SqlConnection.GetSchema testcases
svn path=/trunk/mcs/; revision=64546
2006-08-30 12:00:13 +00:00
Senganal T 5cd065b00a 2006-04-18 Senganal T <[email protected]>
* Test/ProviderTests/System.Data.SqlClient/SqlConnectionTest.cs :
		- OpenTest_1 : test InvalidOperationException is raised if
		ConnectionString is empty
		- DisposeTest : test nullreference exception is not raised
	* System.Data.SqlClient/SqlConnection.cs :
		- SetConnectionString : set the pareameter to default values
		if connection string is empty or null
		- Open : Raise InvalidOperationException if Connection String
		is empty or null
		- Dispose : Test exception not raised if dispose called on a
		connection with empty connection string

	slight modification of the patch by Jonel Rienton


svn path=/trunk/mcs/; revision=59582
2006-04-18 09:58:08 +00:00
Sureshkumar T 3f1e1a17dd 2005-09-24 Sureshkumar T <[email protected]>
In sql:

	* sybase.sql: grant permissions on objects

	* sqlserver.sql: change id as int. tiny int won't allow 6000 (the
	tempory updatable limit).

In System.Data.SqlClient:

	* SqlDataAdapterTest.cs (Fill_Test_Exceptions): passing null
	dataset name throws ArgumentNullException in ms.net

	* SqlConnectionTest.cs: HostName compare: convert to uppercase.

	* SqlDataReaderTest.cs: remove Opening connection in few test
	cases as it was done in SetUp.
	- id type change changes


svn path=/trunk/mcs/; revision=50673
2005-09-24 13:53:03 +00:00
Senganal T 694cd01513 In Mono.Data.Tds:
* Mono.Data.Tds.Protocol/Tds.cs: 
		- Modified the way Server Version number is calculated
		- Added a new varaible to remember the original database
		connected to and to reset the Database property when the
		connection to database is closed.
	* Mono.Data.Tds.Protocol/Tds70.cs: 
		modified Reset() to Call the Reset() of base class which 
		in turn resets the database name. 

In System.Data/Test/ProviderTests/System.Data.SqlClient:

	* SqlConnectionTest.cs: removed some hardcoded database names
	in DatabasePropertyTest ().

In System.Data/System.Data.SqlClient:
	* SqlConnection.cs : 
		- Set the correct Default Values for Parameters.
		- Added Argument Checks (where missing) for the Properties and 
		throw the correct exception on error.
		- Modified SetDefaultParameters() to make sure that the parameters
		are all reset to default values everytime it is called.
		- Modified SetProperties() to take into account the order of the 
		keywords in the ConnectionString.

svn path=/trunk/mcs/; revision=50377
2005-09-21 14:27:58 +00:00
Senganal T e520ee3e0a 2005-09-16 Senganal T <[email protected]>
* System.Data.Connected.Tests.dll.sources: added more source files 
	* sql/sqlserver.sql: modified. added string_family, datetime_family,
	  modified numeric_family values.
	  created new database mono-test for checking -.
	* Common/DataProvider.cs : Provides data for validation
	  DataProvider provides the data that is used for
	  validating Sq[DataReader. Currently it uses a dataset
	  to fill data from the database. Will be modified later to
	  get the values from a config file.
	* System.Data.SqlClient/SqlCommandTest.cs: added more testcases 
	  for connected mode
	* System.Data.SqlClient/SqlConnectionTest.cs: added more testcases
	  for connected mode
	* System.Data.SqlClient/SqlDataAdapterTest.cs: added more testcases 
	  for connected mode
	* System.Data.SqlClient/SqlDataReaderTest.cs: added more testcases 
	  for connected mode


svn path=/trunk/mcs/; revision=50153
2005-09-16 15:51:44 +00:00