Author: gbayon
Date: Thu Feb  2 10:12:16 2006
New Revision: 374450

URL: http://svn.apache.org/viewcvs?rev=374450&view=rev
Log:
- Fixed message error 
- Fixed SqlClient provider for .NET 2.0
- Added fix in tests for obsolete API

Modified:
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/CacheKeyTest.cs
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
 Thu Feb  2 10:12:16 2006
@@ -82,6 +82,7 @@
     <Reference Include="System">
       <Name>System</Name>
     </Reference>
+    <Reference Include="System.configuration" />
     <Reference Include="System.Data">
       <Name>System.Data</Name>
     </Reference>

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs 
Thu Feb  2 10:12:16 2006
@@ -43,8 +43,14 @@
                /// </summary>
                static BaseTest()
                {
-                       ScriptDirectory = 
Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, 
".."), ".."), "Scripts"), ConfigurationSettings.AppSettings["database"]) + 
Path.DirectorySeparatorChar;
-               }
+#if dotnet2
+                       ScriptDirectory = 
Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, 
".."), ".."), "Scripts"),
+                ConfigurationManager.AppSettings["database"]) + 
Path.DirectorySeparatorChar;
+#else
+            ScriptDirectory = 
Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, 
".."), ".."), "Scripts"), 
+                ConfigurationSettings.AppSettings["database"]) + 
Path.DirectorySeparatorChar;
+#endif
+        }
 
                /// <summary>
                /// Initialize an sqlMap
@@ -55,8 +61,13 @@
                        //DateTime start = DateTime.Now;
 
                        DomSqlMapBuilder builder = new DomSqlMapBuilder();
+#if dotnet2
+            string fileName = "sqlmap" + "_" + 
ConfigurationManager.AppSettings["database"] + "_" + 
ConfigurationManager.AppSettings["providerType"] + ".config";
+#else
                        string fileName = "sqlmap" + "_" + 
ConfigurationSettings.AppSettings["database"] + "_" + 
ConfigurationSettings.AppSettings["providerType"] + ".config";
-                       sqlMap = builder.Configure(fileName);
+
+#endif
+            sqlMap = builder.Configure(fileName);
 
                        if ( 
sqlMap.DataSource.DbProvider.Name.IndexOf("PostgreSql")>=0)
                        {

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/CacheKeyTest.cs
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/CacheKeyTest.cs?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/CacheKeyTest.cs
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/CacheKeyTest.cs
 Thu Feb  2 10:12:16 2006
@@ -48,12 +48,12 @@
                        key1.Update("HS1CS001");
                        key2.Update("HS1D4001");
 
-            #if dotnet2
+#if dotnet2
             Assert.Ignore("Will not work in .NET 2.0");
-            #else
+#else
                        Assert.AreEqual( key1.GetHashCode(), 
key2.GetHashCode(), "Expect same hashcode.");
                        Assert.IsFalse( key1.Equals(key2),"Expect not equal");
-            #endif
+#endif
         }
 
                [Test]

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
 Thu Feb  2 10:12:16 2006
@@ -25,8 +25,13 @@
                [SetUp] 
                public void Init() 
                {
-                       _fileName = "sqlmap" + "_" + 
ConfigurationSettings.AppSettings["database"] + "_" + 
ConfigurationSettings.AppSettings["providerType"] + ".config";
-               }
+#if dotnet2
+            _fileName = "sqlmap" + "_" + 
ConfigurationManager.AppSettings["database"] + "_" + 
ConfigurationManager.AppSettings["providerType"] + ".config";
+#else
+                       _fileName = "sqlmap" + "_" + 
ConfigurationSettings.AppSettings["database"] + "_" + 
ConfigurationSettings.AppSettings["providerType"] + ".config";               
+#endif
+
+        }
                #endregion 
 
                #region Relatives Path tests
@@ -271,7 +276,11 @@
                {
                        // embeddedResource = 
"bin.Debug.SqlMap_MSSQL_SqlClient.config, IBatisNet.DataMapper.Test";
                        
+#if dotnet2
+            Assembly assembly = Assembly.Load("IBatisNet.DataMapper.Test");
+#else
                        Assembly assembly = Assembly.LoadWithPartialName 
("IBatisNet.DataMapper.Test");
+#endif
                        Stream stream = 
assembly.GetManifestResourceStream("IBatisNet.DataMapper.Test.bin.Debug.SqlMap_MSSQL_SqlClient.config");
 
                        DomSqlMapBuilder builder = new DomSqlMapBuilder();

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config 
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config 
Thu Feb  2 10:12:16 2006
@@ -39,8 +39,8 @@
 <provider
         name="sqlServer2.0"
         enabled="false"
-        description="Microsoft SQL Server 2005, provider V2.0.50215.0 in 
framework .NET V2.0" 
-        assemblyName="System.Data, Version=2.0.50215.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089" 
+        description="Microsoft SQL Server 2005, provider V2.0.0.0 in framework 
.NET V2.0" 
+        assemblyName="System.Data, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089" 
         connectionClass="System.Data.SqlClient.SqlConnection" 
         commandClass="System.Data.SqlClient.SqlCommand"
         parameterClass="System.Data.SqlClient.SqlParameter"

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs?rev=374450&r1=374449&r2=374450&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs 
Thu Feb  2 10:12:16 2006
@@ -971,7 +971,7 @@
                                else
                                {
                                        throw new ConfigurationException(
-                                               string.Format("Error while 
configuring the Provider named \"{0}\". Cause : The provider is not in 
'providers.config'.",
+                                               string.Format("Error while 
configuring the Provider named \"{0}\". Cause : The provider is not in 
'providers.config' or is not enabled.",
                                                        providerName));
                                }
                        }


Reply via email to