You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -48,13 +48,13 @@ namespace MonoTests.System.Data.Connected
|
||||
private static ConnectionManager instance;
|
||||
private ConnectionHolder<SqlConnection> sql;
|
||||
|
||||
private const string OdbcEnvVar = "SYSTEM_DATA_ODBC";
|
||||
private const string SqlEnvVar = "SYSTEM_DATA_MSSQL";
|
||||
private const string OdbcEnvVar = "SYSTEM_DATA_ODBC_V2";
|
||||
private const string SqlEnvVar = "SYSTEM_DATA_MSSQL_V2";
|
||||
|
||||
private ConnectionManager ()
|
||||
{
|
||||
//Environment.SetEnvironmentVariable(OdbcEnvVar, @"Driver={MySQL ODBC 5.3 Unicode Driver};server=127.0.0.1;uid=sa;pwd=qwerty123;";
|
||||
//Environment.SetEnvironmentVariable(SqlEnvVar, @"server=127.0.0.1;database=master;user id=sa;password=qwerty123";
|
||||
//Environment.SetEnvironmentVariable(OdbcEnvVar, @"Driver={MySQL ODBC 5.3 Unicode Driver};server=127.0.0.1;uid=sa;pwd=qwerty123;");
|
||||
//Environment.SetEnvironmentVariable(SqlEnvVar, @"server=127.0.0.1;database=master;user id=sa;password=qwerty123");
|
||||
|
||||
// Generate a random db name
|
||||
DatabaseName = "monotest" + Guid.NewGuid().ToString().Substring(0, 7);
|
||||
@@ -122,7 +122,8 @@ namespace MonoTests.System.Data.Connected
|
||||
private void CreateMssqlDatabase()
|
||||
{
|
||||
DBHelper.ExecuteNonQuery(sql.Connection, $"CREATE DATABASE [{DatabaseName}]");
|
||||
sql.Connection.ChangeDatabase(DatabaseName);
|
||||
sql.ConnectionString = sql.ConnectionString.Replace(sql.Connection.Database, DatabaseName);
|
||||
sql.CloseConnection();
|
||||
|
||||
string query = File.ReadAllText(@"Test/ProviderTests/sql/sqlserver.sql");
|
||||
|
||||
@@ -247,5 +248,7 @@ namespace MonoTests.System.Data.Connected
|
||||
this.connection = connection;
|
||||
ConnectionString = connectionString;
|
||||
}
|
||||
|
||||
public bool IsAzure => ConnectionString.ToLower().Contains("database.windows.net");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace MonoTests.System.Data.Connected
|
||||
IDbCommand command = connection.CreateCommand ();
|
||||
command.CommandType = CommandType.Text;
|
||||
command.CommandText = query;
|
||||
command.CommandTimeout = 120;
|
||||
int result = -1;
|
||||
try {
|
||||
result = command.ExecuteNonQuery ();
|
||||
|
||||
@@ -788,6 +788,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
// FIXME: Add test for ContinueUpdateOnError property
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")]
|
||||
public void CheckParameters_BuiltCommand ()
|
||||
{
|
||||
SqlDataAdapter adapter = new SqlDataAdapter ("select id,type_varchar from string_family", conn);
|
||||
@@ -813,6 +814,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")]
|
||||
public void DeriveParameters ()
|
||||
{
|
||||
SqlCommand cmd = null;
|
||||
|
||||
@@ -1438,6 +1438,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
}
|
||||
|
||||
[Test] // bug #319598
|
||||
[Category("NotWorking")]
|
||||
public void LongQueryTest ()
|
||||
{
|
||||
if (ClientVersion == 7)
|
||||
|
||||
@@ -288,15 +288,27 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
[Test]
|
||||
public void ChangeDatabase ()
|
||||
{
|
||||
conn = new SqlConnection (connectionString);
|
||||
conn.Open ();
|
||||
conn.ChangeDatabase ("master");
|
||||
Assert.AreEqual ("master", conn.Database);
|
||||
conn = new SqlConnection(connectionString);
|
||||
conn.Open();
|
||||
|
||||
if (ConnectionManager.Instance.Sql.IsAzure)
|
||||
{
|
||||
var exc = Assert.Throws<SqlException>(() => conn.ChangeDatabase("master"));
|
||||
Assert.Equals(40508, exc.Number); //USE statement is not supported to switch between databases (Azure).
|
||||
}
|
||||
else
|
||||
{
|
||||
conn.ChangeDatabase("master");
|
||||
Assert.AreEqual("master", conn.Database);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangeDatabase_DatabaseName_DoesNotExist ()
|
||||
{
|
||||
if (ConnectionManager.Instance.Sql.IsAzure)
|
||||
Assert.Ignore("SQL Azure doesn't support 'ChangeDatabase'");
|
||||
|
||||
conn = new SqlConnection (connectionString);
|
||||
conn.Open ();
|
||||
|
||||
@@ -385,6 +397,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")]
|
||||
public void ClearAllPools ()
|
||||
{
|
||||
SqlConnection conn1 = new SqlConnection (connectionString + ";Pooling=false");
|
||||
@@ -668,6 +681,9 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
[Test]
|
||||
public void Database ()
|
||||
{
|
||||
if (ConnectionManager.Instance.Sql.IsAzure)
|
||||
Assert.Ignore("SQL Azure doesn't support 'use [db]'");
|
||||
|
||||
conn = new SqlConnection (connectionString);
|
||||
string database = conn.Database;
|
||||
|
||||
@@ -830,6 +846,9 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
[Test]
|
||||
public void GetSchemaTest1()
|
||||
{
|
||||
if (ConnectionManager.Instance.Sql.IsAzure)
|
||||
Assert.Ignore("SQL Azure - Not supported'");
|
||||
|
||||
bool flag = false;
|
||||
DataTable tab1 = conn.GetSchema("databases");
|
||||
foreach (DataRow row in tab1.Rows)
|
||||
@@ -1004,6 +1023,9 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
[Test]
|
||||
public void GetSchemaTest9()
|
||||
{
|
||||
if (ConnectionManager.Instance.Sql.IsAzure)
|
||||
Assert.Ignore("SQL Azure - Not supported'");
|
||||
|
||||
bool flag = false;
|
||||
DataTable tab1 = conn.GetSchema("Columns");
|
||||
foreach (DataRow row in tab1.Rows)
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
}
|
||||
|
||||
[Test] // bug #324840
|
||||
[Category("NotWorking")]
|
||||
public void ParameterSizeTest ()
|
||||
{
|
||||
if (ClientVersion == 7)
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace MonoTests.System.Data.Connected.SqlClient
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")]
|
||||
public void Commit ()
|
||||
{
|
||||
if (RunningOnMono)
|
||||
|
||||
Reference in New Issue
Block a user