List:Commits« Previous MessageNext Message »
From:rburnett Date:August 9 2007 5:20pm
Subject:Connector/NET commit: r843 - branches/1.0/TestSuite
View as plain text  
Modified:
   branches/1.0/TestSuite/BaseTest.cs
   branches/1.0/TestSuite/CommandBuilderTests.cs
   branches/1.0/TestSuite/ConnectionTests.cs
   branches/1.0/TestSuite/DataReaderTests.cs
   branches/1.0/TestSuite/MySql.Data.Tests.csproj
   branches/1.0/TestSuite/StoredProcedure.cs
Log:
I failed to include a new file named DbConfig with my last cset.  Since then I decided to move what DbConfig was doing into BaseTest so this change is redirecting calls to DbConfig into BaseTest.

Modified: branches/1.0/TestSuite/BaseTest.cs
===================================================================
--- branches/1.0/TestSuite/BaseTest.cs	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/BaseTest.cs	2007-08-09 17:20:36 UTC (rev 843)
@@ -43,6 +43,8 @@
         protected string memoryName;
         protected string rootUser;
         protected string rootPassword;
+		protected string database0;
+		protected string database1;
 
         public BaseTest()
         {
@@ -56,6 +58,11 @@
             rootUser = "root";
             rootPassword = "";
 
+			database0 = System.IO.Path.GetFileNameWithoutExtension(
+				System.IO.Path.GetTempFileName());
+			database1 = System.IO.Path.GetFileNameWithoutExtension(
+				System.IO.Path.GetTempFileName());
+
 #if NET20
             string strPort = ConfigurationManager.AppSettings["port"];
             string strPipeName = ConfigurationManager.AppSettings["pipename"];
@@ -84,17 +91,17 @@
 			rootConn.Open();
 
 			// now create our databases
-			suExecSQL("CREATE DATABASE " + DbConfig.Database0);
-			suExecSQL("CREATE DATABASE " + DbConfig.Database1);
+			suExecSQL("CREATE DATABASE " + database0);
+			suExecSQL("CREATE DATABASE " + database1);
 
 			// now allow our user to access them
 			suExecSQL(String.Format(@"GRANT ALL ON {0}.* to 'test'@'localhost' 
-				identified by 'test'", DbConfig.Database0));
+				identified by 'test'", database0));
 			suExecSQL(String.Format(@"GRANT ALL ON {0}.* to 'test'@'localhost' 
-				identified by 'test'", DbConfig.Database1));
+				identified by 'test'", database1));
 			suExecSQL("FLUSH PRIVILEGES");
 
-			rootConn.ChangeDatabase(DbConfig.Database0);
+			rootConn.ChangeDatabase(database0);
 
 			Open();
 		}
@@ -102,8 +109,8 @@
 		[TestFixtureTearDown]
 		protected virtual void TestFixtureTearDown()
 		{
-			suExecSQL("DROP DATABASE " + DbConfig.Database0);
-			suExecSQL("DROP DATABASE " + DbConfig.Database1);
+			suExecSQL("DROP DATABASE " + database0);
+			suExecSQL("DROP DATABASE " + database1);
 
 			rootConn.Close();
 			Close();
@@ -119,7 +126,7 @@
             string connStr = String.Format("server={0};user id={1};password={2};" +
                  "persist security info=true;{3}", host, user, password, csAdditions);
             if (includedb)
-                connStr += String.Format("database={0};", DbConfig.Database0);
+                connStr += String.Format("database={0};", database0);
             connStr += GetConnectionInfo();
             return connStr;
         }
@@ -129,7 +136,7 @@
             string connStr = String.Format("server={0};user id={1};" +
                  "persist security info=true;{2}", host, user, csAdditions);
             if (includedb)
-                connStr += String.Format("database={0};", DbConfig.Database0);
+                connStr += String.Format("database={0};", database0);
             if (pw != null)
                 connStr += String.Format("password={0};", pw);
             connStr += GetConnectionInfo();

Modified: branches/1.0/TestSuite/CommandBuilderTests.cs
===================================================================
--- branches/1.0/TestSuite/CommandBuilderTests.cs	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/CommandBuilderTests.cs	2007-08-09 17:20:36 UTC (rev 843)
@@ -180,10 +180,10 @@
 			execSQL("INSERT INTO test (id, name) VALUES (2,'test2')");
 			execSQL("INSERT INTO test (id, name) VALUES (3,'test3')");
 
-            conn.ChangeDatabase(DbConfig.Database1);
+            conn.ChangeDatabase(database1);
 
 			MySqlDataAdapter da = new MySqlDataAdapter(
-                String.Format("SELECT id, name FROM {0}.test", DbConfig.Database0), conn);
+                String.Format("SELECT id, name FROM {0}.test", database0), conn);
 			MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
 			cb.ToString();
 			DataSet ds = new DataSet();
@@ -195,7 +195,7 @@
 			ds.Merge(changes);
 			ds.AcceptChanges();
 
-			conn.ChangeDatabase(DbConfig.Database0);
+			conn.ChangeDatabase(database0);
 		}
 
 		/// <summary>

Modified: branches/1.0/TestSuite/ConnectionTests.cs
===================================================================
--- branches/1.0/TestSuite/ConnectionTests.cs	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/ConnectionTests.cs	2007-08-09 17:20:36 UTC (rev 843)
@@ -129,11 +129,11 @@
             c.Open();
             Assert.IsTrue(c.State == ConnectionState.Open);
 
-            Assert.AreEqual(DbConfig.Database0.ToLower(), c.Database.ToLower());
+            Assert.AreEqual(database0.ToLower(), c.Database.ToLower());
 
-            c.ChangeDatabase(DbConfig.Database1);
+            c.ChangeDatabase(database1);
 
-            Assert.AreEqual(DbConfig.Database1.ToLower(), c.Database.ToLower());
+            Assert.AreEqual(database1.ToLower(), c.Database.ToLower());
 
             c.Close();
         }

Modified: branches/1.0/TestSuite/DataReaderTests.cs
===================================================================
--- branches/1.0/TestSuite/DataReaderTests.cs	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/DataReaderTests.cs	2007-08-09 17:20:36 UTC (rev 843)
@@ -808,7 +808,7 @@
 			execSQL("DROP TABLE IF EXISTS test");
 			execSQL("CREATE TABLE test (id int, PRIMARY KEY(id))");
 			MySqlCommand cmd = new MySqlCommand(
-                String.Format("SHOW INDEX FROM test FROM {0}", DbConfig.Database0), conn);
+                String.Format("SHOW INDEX FROM test FROM {0}", database0), conn);
 			MySqlDataReader reader = null;
 			try
 			{

Modified: branches/1.0/TestSuite/MySql.Data.Tests.csproj
===================================================================
--- branches/1.0/TestSuite/MySql.Data.Tests.csproj	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/MySql.Data.Tests.csproj	2007-08-09 17:20:36 UTC (rev 843)
@@ -154,11 +154,6 @@
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "DbConfig.cs"
-                    SubType = "Code"
-                    BuildAction = "Compile"
-                />
-                <File
                     RelPath = "EventTests.cs"
                     SubType = "Code"
                     BuildAction = "Compile"

Modified: branches/1.0/TestSuite/StoredProcedure.cs
===================================================================
--- branches/1.0/TestSuite/StoredProcedure.cs	2007-08-09 16:46:49 UTC (rev 842)
+++ branches/1.0/TestSuite/StoredProcedure.cs	2007-08-09 17:20:36 UTC (rev 843)
@@ -462,7 +462,7 @@
 			try
 			{
 				c.Open();
-				MySqlCommand cmd2 = new MySqlCommand(String.Format("use {0}", DbConfig.Database0), c);
+				MySqlCommand cmd2 = new MySqlCommand(String.Format("use {0}", database0), c);
 				cmd2.ExecuteNonQuery();
 
 				MySqlCommand cmd = new MySqlCommand("spTest", c);
@@ -470,10 +470,10 @@
 				object val = cmd.ExecuteScalar();
 				Assert.AreEqual(4, val);
 
-				cmd2.CommandText = String.Format("use {0}", DbConfig.Database1);
+				cmd2.CommandText = String.Format("use {0}", database1);
 				cmd2.ExecuteNonQuery();
 
-				cmd.CommandText = String.Format("{0}.spTest", DbConfig.Database0);
+				cmd.CommandText = String.Format("{0}.spTest", database0);
 				val = cmd.ExecuteScalar();
 				Assert.AreEqual(4, val);
 			}
@@ -1001,10 +1001,10 @@
         {
             suExecSQL(String.Format(
                 "GRANT ALL ON {0}.* to 'testuser'@'%' identified by 'testuser'",
-                DbConfig.Database0));
+                database0));
             suExecSQL(String.Format(
                 "GRANT ALL ON {0}.* to 'testuser'@'localhost' identified by 'testuser'",
-                DbConfig.Database0));
+                database0));
 
             execSQL("DROP PROCEDURE IF EXISTS spTest");
             execSQL("CREATE PROCEDURE spTest(id int, OUT outid int, INOUT inoutid int) " +

Thread
Connector/NET commit: r843 - branches/1.0/TestSuiterburnett9 Aug