From: <dar...@us...> - 2009-02-04 04:21:18
|
Revision: 4031 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4031&view=rev Author: darioquintana Date: 2009-02-04 04:21:16 +0000 (Wed, 04 Feb 2009) Log Message: ----------- renaming the fixture and using removed Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs 2009-02-04 04:18:37 UTC (rev 4030) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs 2009-02-04 04:21:16 UTC (rev 4031) @@ -1,124 +0,0 @@ -using NHibernate.Criterion; -using NHibernate.Impl; -using NUnit.Framework; - -namespace NHibernate.Test.NHSpecificTest.Futures -{ - using System.Collections; - - [TestFixture] - public class Fixture : TestCase - { - - protected override IList Mappings - { - get { return new string[] { "NHSpecificTest.Futures.Mappings.hbm.xml" }; } - } - - protected override string MappingsAssembly - { - get { return "NHibernate.Test"; } - } - - [Test] - public void CanUseFutureCriteria() - { - using (var s = sessions.OpenSession()) - { - if(((SessionFactoryImpl)sessions) - .ConnectionProvider.Driver.SupportsMultipleQueries == false) - { - Assert.Ignore("Not applicable for dialects that do not support multiple queries"); - } - - var persons10 = s.CreateCriteria(typeof(Person)) - .SetMaxResults(10) - .Future<Person>(); - var persons5 = s.CreateCriteria(typeof(Person)) - .SetMaxResults(5) - .Future<int>(); - - using (var logSpy = new SqlLogSpy()) - { - foreach (var person in persons5) - { - - } - - foreach (var person in persons10) - { - - } - - var events = logSpy.Appender.GetEvents(); - Assert.AreEqual(1, events.Length); - } - } - } - - [Test] - public void TwoFuturesRunInTwoRoundTrips() - { - using (var s = sessions.OpenSession()) - { - if (((SessionFactoryImpl)sessions) - .ConnectionProvider.Driver.SupportsMultipleQueries == false) - { - Assert.Ignore("Not applicable for dialects that do not support multiple queries"); - } - - using (var logSpy = new SqlLogSpy()) - { - var persons10 = s.CreateCriteria(typeof(Person)) - .SetMaxResults(10) - .Future<Person>(); - - foreach (var person in persons10) { } // fire first future round-trip - - var persons5 = s.CreateCriteria(typeof(Person)) - .SetMaxResults(5) - .Future<int>(); - - foreach (var person in persons5) { } // fire second future round-trip - - var events = logSpy.Appender.GetEvents(); - Assert.AreEqual(2, events.Length); - } - } - } - - [Test] - public void CanCombineSingleFutureValueWithEnumerableFutures() - { - using (var s = sessions.OpenSession()) - { - if (((SessionFactoryImpl)sessions) - .ConnectionProvider.Driver.SupportsMultipleQueries == false) - { - Assert.Ignore("Not applicable for dialects that do not support multiple queries"); - } - - var persons = s.CreateCriteria(typeof(Person)) - .SetMaxResults(10) - .Future<Person>(); - - var personCount = s.CreateCriteria(typeof(Person)) - .SetProjection(Projections.RowCount()) - .FutureValue<int>(); - - using (var logSpy = new SqlLogSpy()) - { - int count = personCount.Value; - - foreach (var person in persons) - { - - } - - var events = logSpy.Appender.GetEvents(); - Assert.AreEqual(1, events.Length); - } - } - } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs (from rev 4029, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs 2009-02-04 04:21:16 UTC (rev 4031) @@ -0,0 +1,124 @@ +using NHibernate.Criterion; +using NHibernate.Impl; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.Futures +{ + using System.Collections; + + [TestFixture] + public class FutureCriteriaFixture : TestCase + { + + protected override IList Mappings + { + get { return new string[] { "NHSpecificTest.Futures.Mappings.hbm.xml" }; } + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + [Test] + public void CanUseFutureCriteria() + { + using (var s = sessions.OpenSession()) + { + if(((SessionFactoryImpl)sessions) + .ConnectionProvider.Driver.SupportsMultipleQueries == false) + { + Assert.Ignore("Not applicable for dialects that do not support multiple queries"); + } + + var persons10 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(10) + .Future<Person>(); + var persons5 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(5) + .Future<int>(); + + using (var logSpy = new SqlLogSpy()) + { + foreach (var person in persons5) + { + + } + + foreach (var person in persons10) + { + + } + + var events = logSpy.Appender.GetEvents(); + Assert.AreEqual(1, events.Length); + } + } + } + + [Test] + public void TwoFuturesRunInTwoRoundTrips() + { + using (var s = sessions.OpenSession()) + { + if (((SessionFactoryImpl)sessions) + .ConnectionProvider.Driver.SupportsMultipleQueries == false) + { + Assert.Ignore("Not applicable for dialects that do not support multiple queries"); + } + + using (var logSpy = new SqlLogSpy()) + { + var persons10 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(10) + .Future<Person>(); + + foreach (var person in persons10) { } // fire first future round-trip + + var persons5 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(5) + .Future<int>(); + + foreach (var person in persons5) { } // fire second future round-trip + + var events = logSpy.Appender.GetEvents(); + Assert.AreEqual(2, events.Length); + } + } + } + + [Test] + public void CanCombineSingleFutureValueWithEnumerableFutures() + { + using (var s = sessions.OpenSession()) + { + if (((SessionFactoryImpl)sessions) + .ConnectionProvider.Driver.SupportsMultipleQueries == false) + { + Assert.Ignore("Not applicable for dialects that do not support multiple queries"); + } + + var persons = s.CreateCriteria(typeof(Person)) + .SetMaxResults(10) + .Future<Person>(); + + var personCount = s.CreateCriteria(typeof(Person)) + .SetProjection(Projections.RowCount()) + .FutureValue<int>(); + + using (var logSpy = new SqlLogSpy()) + { + int count = personCount.Value; + + foreach (var person in persons) + { + + } + + var events = logSpy.Appender.GetEvents(); + Assert.AreEqual(1, events.Length); + } + } + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs 2009-02-04 04:18:37 UTC (rev 4030) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs 2009-02-04 04:21:16 UTC (rev 4031) @@ -1,5 +1,4 @@ -using NHibernate.Criterion; -using NHibernate.Impl; +using NHibernate.Impl; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.Futures Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-02-04 04:18:37 UTC (rev 4030) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-02-04 04:21:16 UTC (rev 4031) @@ -381,7 +381,7 @@ <Compile Include="NHSpecificTest\BugTestCase.cs" /> <Compile Include="NHSpecificTest\CollectionFixture.cs" /> <Compile Include="NHSpecificTest\Futures\FutureQueryFixture.cs" /> - <Compile Include="NHSpecificTest\Futures\Fixture.cs" /> + <Compile Include="NHSpecificTest\Futures\FutureCriteriaFixture.cs" /> <Compile Include="NHSpecificTest\Futures\Person.cs" /> <Compile Include="NHSpecificTest\DateTime2AndDateTimeOffSet\AllDates.cs" /> <Compile Include="NHSpecificTest\DateTime2AndDateTimeOffSet\DateTime2AndDateTimeOffSetFixture.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |