List:Commits« Previous MessageNext Message »
From:rburnett Date:September 28 2006 9:21pm
Subject:Connector/NET commit: r373 - in trunk: . TestSuite mysqlclient
View as plain text  
Modified:
   trunk/Client.build
   trunk/Package.build
   trunk/TestSuite/AsyncTests.cs
   trunk/TestSuite/BlobTests.cs
   trunk/TestSuite/CommandTests.cs
   trunk/TestSuite/GetSchemaTests.cs
   trunk/TestSuite/PreparedStatements.cs
   trunk/TestSuite/StoredProcedure.cs
   trunk/TestSuite/StressTests.cs
   trunk/mysqlclient/PreparedStatement.cs
   trunk/mysqlclient/command.cs
Log:
small cleanups during testing

Modified: trunk/Client.build
===================================================================
--- trunk/Client.build	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/Client.build	2006-09-28 21:21:01 UTC (rev 373)
@@ -2,10 +2,6 @@
 <project name="MySqlClient" default="allframeworks" xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd">
 	<description>MySQLClient Managed Provider for MySQL</description>
 
-	<property name="nunit" value="C:\Program Files\NUnit-Net-2.0 2.2.8"/>
-	<property name="ncover.executable" value="c:\program files\ncover\ncover.console.exe"/>
-	<property name="fxcop.executable" value="c:\program files\fxcop\fxcopcmd.exe"/>
-
 	<!-- filesets -->
 	<fileset id="Source">
 		<include name="mysqlclient/common/*.cs"/>
@@ -47,11 +43,10 @@
 		
 		<mkdir dir="${outdir}" failonerror="false"/>
 		<resgen input="mysqlclient/Resources.resx" output="mysqlclient/Resources.resources"/>
-    <echo message="defines=${defines}"/>
 		<csc output="${outdir}/MySql.Data.dll" target="library" 
 			define="${defines}" debug="${debug}" optimize="${opt}" keycontainer="ConnectorNet" 
 			doc="${outdir}/MySql.Data.xml">
-			<arg value="/nowarn:0679,1591"/>
+			<arg value="/nowarn:0679,1591,2029"/>
 			<resources prefix="MySql.Data.MySqlClient" dynamicprefix="false">
 				<include name="mysqlclient/Resources.resources"/>
         <include name="mysqlclient/ResoucedWords.txt"/>
@@ -64,7 +59,7 @@
 			<sources refid="Source"/>
 		</csc>
 		<csc output="${outdir}/MySql.Data.Tests.dll" target="library" 
-			define="${defines}" debug="${debug}" optimize="${opt}"> <arg value="/nowarn:0679"/>
+			define="${defines}" debug="${debug}" optimize="${opt}"> <arg value="/nowarn:0679,2029"/>
 			<sources>
 				<include name="TestSuite/*.cs" />
 			</sources>
@@ -82,21 +77,21 @@
 
 	<!-- core managed driver target 1.0 -->	
 	<target name="net-1.0" description="1.0 .NET target">
-		<property name="nunit-lib" value="${nunit}/bin"/>
+		<property name="nunit-lib" value="${nunit.dir}/bin"/>
 		<property name="framework" value="net-1.0"/>
 		<call target="client"/>
 	</target>
 	
 	<!-- core managed driver target 1.1 -->
 	<target name="net-1.1" description="1.1 .NET target">
-		<property name="nunit-lib" value="${nunit}/bin"/>
+		<property name="nunit-lib" value="${nunit.dir}/bin"/>
 		<property name="framework" value="net-1.1"/>
 		<call target="client"/>
 	</target>
 
 	<!-- core managed driver target 2.0 -->
 	<target name="net-2.0" description="2.0 .NET target">
-		<property name="nunit-lib" value="${nunit}/bin"/>
+		<property name="nunit-lib" value="${nunit.dir}/bin"/>
 		<property name="framework" value="net-2.0"/>
 		<property name="defines" value="${defines},NET20"/>
 		<call target="client"/>
@@ -143,18 +138,6 @@
 		<call target="testclient"/>
 	</target>
 
-	<!-- This target will call the testdb target for each supported config. -->
-	<target name="test_all_configs">
-		<property name="config" value="tcp"/>
-		<call target="testdb"/>  
-		<property name="config" value="tcp_compressed"/>
-		<call target="testdb"/> 
-<!--		<property name="config" value="pipe"/>
-		<call target="testdb"/>  
-		<property name="config" value="pipe_compressed"/>
-		<call target="testdb"/>-->
-	</target>
-
     <!-- 
     Target to run the test suite.  This target will run through all the 
     supported versions of MySQL, stopping the services, and then starting
@@ -164,29 +147,28 @@
 		<mkdir dir="results"/>
 		<echo message="Stopping all services"/>
 		<property name="doCoverage" value="false"/>
-		<servicecontroller action="Stop" service="MySql4.0"/>
 		<servicecontroller action="Stop" service="MySql4.1"/>
 		<servicecontroller action="Stop" service="MySql5.0"/>
+		<servicecontroller action="Stop" service="MySql5.1"/>
 
-		<!-- test 4.0 -->		
-		<echo message="Testing MySQL 4.0"/>
-		<property name="excludes" value="4.1,5.0,NotWorking"/>
-		<servicecontroller action="Start" service="MySql4.0"/>
-		<call target="test_all_configs"/>
-
+		<!-- test 4.1 -->		
 		<echo message="Testing MySQL 4.1"/>
-		<servicecontroller action="Stop" service="MySql4.0"/>
-		<servicecontroller action="Start" service="MySql4.1"/>
 		<property name="excludes" value="5.0,NotWorking"/>
-		<call target="test_all_configs"/>
+		<servicecontroller action="Start" service="MySql4.1"/>
+		<call target="testdb"/>  
 
 		<echo message="Testing MySQL 5.0"/>
 		<servicecontroller action="Stop" service="MySql4.1"/>
 		<servicecontroller action="Start" service="MySql5.0"/>
 		<property name="excludes" value="NotWorking"/>
 		<!--<property name="doCoverage" value="true"/>-->
-		<call target="test_all_configs"/>
+		<call target="testdb"/>  
 		
+		<echo message="Testing MySQL 5.1"/>
+		<servicecontroller action="Stop" service="MySql5.0"/>
+		<servicecontroller action="Start" service="MySql5.1"/>
+		<property name="excludes" value="NotWorking"/>
+		<call target="testdb"/>  
 	</target>
 
 	<!-- 
@@ -196,8 +178,8 @@
 	<target name="testdb" description="Target to test a database with all possible configurations">
 		<copy file="testsuite/configs/${config}.config" tofile="bin/${framework}/${buildType}/MySql.Data.Tests.dll.config"/>
 		
-		<property name="nunit-exe" value="${nunit}/bin/nunit-console.exe"/>
-		<property name="nunit-exe" value="${nunit}/mono/bin/nunit-console.exe" if="${string::contains(framework, 'mono')}"/>
+		<property name="nunit-exe" value="${nunit.dir}/bin/nunit-console.exe"/>
+		<property name="nunit-exe" value="${nunit.dir}/mono/bin/nunit-console.exe" if="${string::contains(framework, 'mono')}"/>
 		
 		<exec unless="${doCoverage}" program="${nunit-exe}"
 		      commandline="/exclude=${excludes} /xml=../../../results/nunit-${framework}-${buildType}.xml bin/${framework}/${buildType}/MySql.Data.Tests.dll"

Modified: trunk/Package.build
===================================================================
--- trunk/Package.build	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/Package.build	2006-09-28 21:21:01 UTC (rev 373)
@@ -67,6 +67,8 @@
 		<copy todir="staging">
 			<fileset>
 				<include name="Installer/main.wxs"/>
+				<include name="Installer/samples.wxs"/>
+				<include name="Installer/sources.wxs"/>
 				<include name="Installer/Bitmaps/*.*"/>
 			</fileset>
 		</copy>

Modified: trunk/TestSuite/AsyncTests.cs
===================================================================
--- trunk/TestSuite/AsyncTests.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/AsyncTests.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -40,6 +40,7 @@
 			Close();
 		}
 
+        [Category("5.0")]
         [Test]
         public void ExecuteNonQuery()
         {
@@ -76,6 +77,7 @@
             }
         }
 
+        [Category("5.0")]
         [Test]
         public void ExecuteReader()
         {

Modified: trunk/TestSuite/BlobTests.cs
===================================================================
--- trunk/TestSuite/BlobTests.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/BlobTests.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -36,9 +36,6 @@
 		public void TestFixtureSetUp()
 		{
 			Open();
-
-			execSQL("DROP TABLE IF EXISTS Test");
-			execSQL("CREATE TABLE Test (id INT NOT NULL, blob1 LONGBLOB, text1 LONGTEXT, PRIMARY KEY(id))");
 		}
 
 		[TestFixtureTearDown]
@@ -47,6 +44,14 @@
 			Close();
 		}
 
+        protected override void Setup()
+        {
+            base.Setup();
+
+            execSQL("DROP TABLE IF EXISTS Test");
+            execSQL("CREATE TABLE Test (id INT NOT NULL, blob1 LONGBLOB, text1 LONGTEXT, PRIMARY KEY(id))");
+        }
+
 		[Test]
 		[Category("4.0")]
 		public void InsertBinary() 
@@ -368,8 +373,34 @@
                     reader.Close();
             }
         }
-    }
 
+        [Test]
+        public void BlobBiggerThanMaxPacket()
+        {
+            execSQL("set @@global.max_allowed_packet=500000");
+
+            execSQL("DROP TABLE IF EXISTS test");
+            execSQL("CREATE TABLE test (id INT(10), image BLOB)");
+
+            try
+            {
+                byte[] image = Utils.CreateBlob(1000000);
+                MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES(NULL, ?image)", conn);
+                cmd.Parameters.Add("?image", image);
+                cmd.ExecuteNonQuery();
+                Assert.Fail("This should have thrown an exception");
+            }
+            catch (Exception)
+            {
+                Assert.AreEqual(ConnectionState.Open, conn.State);
+            }
+            finally
+            {
+                execSQL("set @@global.max_allowed_packet=1000000");
+            }
+        }
+     }
+
     #region Configs
 
     public class BlobTestsSocketCompressed : BlobTests
@@ -396,7 +427,6 @@
         }
     }
 
-    [Explicit]
     public class BlobTestsSharedMemory : BlobTests
     {
         protected override string GetConnectionInfo()
@@ -405,7 +435,6 @@
         }
     }
 
-    [Explicit]
     public class BlobTestsSharedMemoryCompressed : BlobTests
     {
         protected override string GetConnectionInfo()
@@ -416,4 +445,4 @@
 
     #endregion
 
-}
+}
\ No newline at end of file

Modified: trunk/TestSuite/CommandTests.cs
===================================================================
--- trunk/TestSuite/CommandTests.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/CommandTests.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -34,8 +34,6 @@
 		public void TestFixtureSetUp()
 		{
 			Open();
-			execSQL("DROP TABLE IF EXISTS Test");
-			execSQL("CREATE TABLE Test (id int NOT NULL, name VARCHAR(100))");
 		}
 
 		[TestFixtureTearDown]
@@ -44,6 +42,13 @@
 			Close();
 		}
 
+        protected override void Setup()
+        {
+            base.Setup();
+            execSQL("DROP TABLE IF EXISTS Test");
+            execSQL("CREATE TABLE Test (id int NOT NULL, name VARCHAR(100))");
+        }
+
 		[Test]
 		public void InsertTest()
 		{
@@ -132,16 +137,16 @@
 				// make sure we get the right value back out
 				MySqlCommand cmd = new MySqlCommand("DELETE FROM Test WHERE id=1 or id=2", conn);
 				int delcnt = cmd.ExecuteNonQuery();
-				Assert.AreEqual( 2, delcnt );
+				Assert.AreEqual(2, delcnt);
 			
 				// find out how many rows we have now
 				cmd.CommandText = "SELECT COUNT(*) FROM Test";
 				object after_cnt = cmd.ExecuteScalar();
-				Assert.AreEqual( 0, after_cnt );
+				Assert.AreEqual(0, after_cnt);
 			}
 			catch (Exception ex)
 			{
-				Assert.Fail( ex.Message );
+				Assert.Fail(ex.Message);
 			}
 		}
 
@@ -216,7 +221,7 @@
 			}
 			catch (Exception ex) 
 			{
-				Assert.Fail( ex.Message );
+				Assert.Fail(ex.Message);
 			}
 			finally 
 			{
@@ -396,6 +401,7 @@
             }
         }
 
+        [Category("5.0")]
         [Test]
         public void CancelSingleQuery()
         {
@@ -495,7 +501,7 @@
             {
                 object o = cmd.ExecuteScalar();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
             }
 

Modified: trunk/TestSuite/GetSchemaTests.cs
===================================================================
--- trunk/TestSuite/GetSchemaTests.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/GetSchemaTests.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -294,6 +294,7 @@
             Assert.AreEqual(2, dt.Rows[0]["ORDINAL_POSITION"]);
         }
 
+        [Category("5.0")]
         [Test]
         public void Views()
         {

Modified: trunk/TestSuite/PreparedStatements.cs
===================================================================
--- trunk/TestSuite/PreparedStatements.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/PreparedStatements.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -709,7 +709,7 @@
                 cmd.Prepare();
                 Assert.Fail("Should not reach here");
             }
-            catch (Exception ex)
+            catch (Exception)
             {
             }
         }
@@ -741,7 +741,6 @@
         }
     }
 
-    [Explicit]
     public class PreparedStatementsSharedMemory : PreparedStatements
     {
         protected override string GetConnectionInfo()
@@ -750,7 +749,6 @@
         }
     }
 
-    [Explicit]
     public class PreparedStatementsSharedMemoryCompressed : PreparedStatements
     {
         protected override string GetConnectionInfo()

Modified: trunk/TestSuite/StoredProcedure.cs
===================================================================
--- trunk/TestSuite/StoredProcedure.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/StoredProcedure.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -284,25 +284,27 @@
             Assert.IsTrue(result is Int32);
         }
 
-		[Test()]
+		[Test]
 		[Category("5.0")]
 		public void ExecuteReader()
 		{
 			// create our procedure
-			execSQL( "CREATE PROCEDURE spTest() " +
-				"BEGIN  SELECT * FROM mysql.db; END" );
+			execSQL( "CREATE PROCEDURE spTest(OUT p INT) " +
+				"BEGIN  SELECT * FROM mysql.db; SET p=2; END" );
 
 			MySqlCommand cmd = new MySqlCommand("spTest", conn);
-			cmd.Parameters.Add("?a", 3);
+            cmd.Parameters.Add("?p", MySqlDbType.Int32);
+            cmd.Parameters[0].Direction = ParameterDirection.Output;
 			cmd.CommandType = CommandType.StoredProcedure;
 			MySqlDataReader reader = cmd.ExecuteReader();
 			Assert.AreEqual(true, reader.Read());
 			Assert.AreEqual(false, reader.NextResult());
 			Assert.AreEqual(false, reader.Read());
 			reader.Close();
+            Assert.AreEqual(2, cmd.Parameters[0].Value);
 		}
 
-		[Test()]
+		[Test]
 		[Category("5.0")]
 		public void MultipleResultsets() 
 		{

Modified: trunk/TestSuite/StressTests.cs
===================================================================
--- trunk/TestSuite/StressTests.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/TestSuite/StressTests.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -141,7 +141,6 @@
         }
     }
 
-    [Explicit]
     public class StressTestsSharedMemory : StressTests
     {
         protected override string GetConnectionInfo()
@@ -150,7 +149,6 @@
         }
     }
 
-    [Explicit]
     public class StressTestsSharedMemoryCompressed : StressTests
     {
         protected override string GetConnectionInfo()

Modified: trunk/mysqlclient/PreparedStatement.cs
===================================================================
--- trunk/mysqlclient/PreparedStatement.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/mysqlclient/PreparedStatement.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -161,7 +161,7 @@
             foreach (string token in tokens)
             {
                 if ( token[0] != connection.ParameterMarker)
-                    newSQL.Append( token );
+                    newSQL.Append(token);
                 else
                 {
                     parameterMap.Add( token );

Modified: trunk/mysqlclient/command.cs
===================================================================
--- trunk/mysqlclient/command.cs	2006-09-28 17:43:01 UTC (rev 372)
+++ trunk/mysqlclient/command.cs	2006-09-28 21:21:01 UTC (rev 373)
@@ -140,12 +140,7 @@
 		public override int CommandTimeout
 		{
             get { return commandTimeout; }
-            set 
-            {
-                if (!connection.driver.Version.isAtLeast(5, 0, 0))
-                    throw new NotSupportedException(Resources.CancelNeeds50);
-                commandTimeout = value; 
-            }
+            set { commandTimeout = value; }
 		}
 
 		/// <include file='docs/mysqlcommand.xml' path='docs/CommandType/*'/>

Thread
Connector/NET commit: r373 - in trunk: . TestSuite mysqlclientrburnett28 Sep