Author: gbayon
Date: Sun Sep 18 08:04:46 2005
New Revision: 289929
URL: http://svn.apache.org/viewcvs?rev=289929&view=rev
Log:
- Fixed IBATISNET-110 (Added 2 Nunit tests)
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.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.csproj
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj?rev=289929&r1=289928&r2=289929&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
Sun Sep 18 08:04:46 2005
@@ -90,11 +90,6 @@
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
- Name = "nunit.framework"
- AssemblyName = "nunit.framework"
- HintPath = "..\External-Bin\Net\1.1\nunit.framework.dll"
- />
- <Reference
Name = "log4net"
AssemblyName = "log4net"
HintPath = "..\External-Bin\Net\1.1\log4net.dll"
@@ -103,6 +98,12 @@
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath =
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+ />
+ <Reference
+ Name = "nunit.framework"
+ AssemblyName = "nunit.framework"
+ HintPath = "D:\Program Files\NUnit
2.2\bin\nunit.framework.dll"
+ AssemblyFolderKey = "hklm\dn\nunit.framework"
/>
</References>
</Build>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml?rev=289929&r1=289928&r2=289929&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
Sun Sep 18 08:04:46 2005
@@ -503,11 +503,33 @@
Account_ID = #Id#
</select>
- <select id="GetAllAccountsViaCustomTypeHandler"
+ <select id="GetAllAccountsViaCustomTypeHandler"
resultMap="account-result">
select * from Accounts
order by Account_ID
</select>
+
+ <!-- JIRA-110 -->
+ <select id="GetManyAccound" resultClass="Account">
+ <![CDATA[
+ SELECT
+ Account_ID as Id,
+ Account_FirstName as FirstName,
+ Account_LastName as LastName,
+ Account_Email as EmailAddress
+ FROM Accounts
+ ]]>
+ </select>
+
+ <select id="Get1Account" extends="GetManyAccound"
resultClass="Account">WHERE Account_ID=1</select>
+
+ <statement id="GetAccounts" resultMap="account-result">
+ <![CDATA[SELECT * ]]>
+ <![CDATA[FROM ]]>
+ Accounts
+ </statement>
+
+ <!-- JIRA-110 -->
<!-- For procedure, the parameters of the parameterMap must in
the same order
as for the procedure paramaters-->
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs?rev=289929&r1=289928&r2=289929&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
Sun Sep 18 08:04:46 2005
@@ -1144,6 +1144,28 @@
AssertAccount1(account);
}
+ /// <summary>
+ /// Test : Whitespace is not maintained properly when CDATA
tags are used
+ /// </summary>
+ [Test]
+ public void TestJIRA110()
+ {
+ Account account = sqlMap.QueryForObject("Get1Account",
null) as Account;
+ AssertAccount1(account);
+ }
+
+ /// <summary>
+ /// Test : Whitespace is not maintained properly when CDATA
tags are used
+ /// </summary>
+ [Test]
+ public void TestJIRA110Bis()
+ {
+ IList list = sqlMap.QueryForList("GetAccounts", null);
+
+ AssertAccount1((Account) list[0]);
+ Assert.AreEqual(5, list.Count);
+ }
+
#endregion
#region CustomTypeHandler tests
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=289929&r1=289928&r2=289929&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
Sun Sep 18 08:04:46 2005
@@ -129,7 +129,7 @@
<provider
name="MySql"
description="MySQL, MySQL provider V1.0.5.13785"
- enabled="true"
+ enabled="false"
assemblyName="MySql.Data, Version=1.0.5.13785, Culture=neutral,
PublicKeyToken=c5687fc88969c44d"
connectionClass="MySql.Data.MySqlClient.MySqlConnection"
commandClass="MySql.Data.MySqlClient.MySqlCommand"
parameterClass="MySql.Data.MySqlClient.MySqlParameter"
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=289929&r1=289928&r2=289929&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
Sun Sep 18 08:04:46 2005
@@ -1382,7 +1382,7 @@
XmlNode child = children[i];
if ( (child.NodeType == XmlNodeType.CDATA) ||
(child.NodeType == XmlNodeType.Text) )
{
- string data =
child.InnerText.Replace('\n', ' ').Replace('\r', ' ').Replace('\t', '
').Trim(); //??
+ string data =
child.InnerText.Replace('\n', ' ').Replace('\r', ' ').Replace('\t', ' '); //??
data =
NodeUtils.ParsePropertyTokens(data, _configScope.Properties);
@@ -1462,6 +1462,8 @@
}
ISql sql = null;
+
+ newSql = newSql.Trim();
if (SimpleDynamicSql.IsSimpleDynamicSql(newSql))
{