|
From: <fab...@us...> - 2009-02-03 17:16:04
|
Revision: 4023
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4023&view=rev
Author: fabiomaulo
Date: 2009-02-03 17:16:02 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
Ignoring test (Multi-query)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1253/Fixture.cs
trunk/nhibernate/src/NHibernate.Test/ProjectionFixtures/Fixture.cs
Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1253/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1253/Fixture.cs 2009-02-03 16:43:11 UTC (rev 4022)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1253/Fixture.cs 2009-02-03 17:16:02 UTC (rev 4023)
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
+using NHibernate.Driver;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH1253
@@ -80,6 +81,12 @@
[Test]
public void MultiQuerySingleInList()
{
+ IDriver driver = sessions.ConnectionProvider.Driver;
+ if (!driver.SupportsMultipleQueries)
+ {
+ Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
+ }
+
using (ISession s = OpenSession())
{
using (ITransaction tx = s.BeginTransaction())
Modified: trunk/nhibernate/src/NHibernate.Test/ProjectionFixtures/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/ProjectionFixtures/Fixture.cs 2009-02-03 16:43:11 UTC (rev 4022)
+++ trunk/nhibernate/src/NHibernate.Test/ProjectionFixtures/Fixture.cs 2009-02-03 17:16:02 UTC (rev 4023)
@@ -1,7 +1,5 @@
-using System;
-using NHibernate;
using NHibernate.Criterion;
-using NHibernate.Test.PropertyRef;
+using NHibernate.Driver;
using NUnit.Framework;
namespace NHibernate.Test.ProjectionFixtures
@@ -65,12 +63,17 @@
[Test]
- [ExpectedException(typeof(ADOException), ExpectedMessage = @"could not execute query
-[ SELECT this_.Id as y0_, count(this_.Area) as y1_ FROM TreeNode this_ WHERE this_.Id = @p0 ]
-Positional parameters: #0>2
-[SQL: SELECT this_.Id as y0_, count(this_.Area) as y1_ FROM TreeNode this_ WHERE this_.Id = @p0]")]
public void ErrorFromDBWillGiveTheActualSQLExecuted()
{
+ string pName = ((ISqlParameterFormatter) sessions.ConnectionProvider.Driver).GetParameterName(0);
+ string expectedMessage =
+ string.Format(
+ @"could not execute query
+[ SELECT this_.Id as y0_, count(this_.Area) as y1_ FROM TreeNode this_ WHERE this_.Id = {0} ]
+Positional parameters: #0>2
+[SQL: SELECT this_.Id as y0_, count(this_.Area) as y1_ FROM TreeNode this_ WHERE this_.Id = {1}]",
+ pName, pName);
+
DetachedCriteria projection = DetachedCriteria.For<TreeNode>("child")
.Add(Restrictions.Eq("child.Key.Id", 2))
.SetProjection(
@@ -78,7 +81,8 @@
.Add(Projections.Property("child.Key.Id"))
.Add(Projections.Count("child.Key.Area"))
);
-
+ try
+ {
using (var s = sessions.OpenSession())
using (var tx = s.BeginTransaction())
{
@@ -87,6 +91,13 @@
tx.Commit();
}
+ Assert.Fail();
+ }
+ catch (ADOException e)
+ {
+ if(e.Message != expectedMessage)
+ throw;
+ }
}
[Test]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|