From: <fab...@us...> - 2009-05-14 14:44:16
|
Revision: 4301 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4301&view=rev Author: fabiomaulo Date: 2009-05-14 14:44:13 +0000 (Thu, 14 May 2009) Log Message: ----------- Only because different CR-LF Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Fixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Domain.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Domain.cs 2009-05-14 11:43:14 UTC (rev 4300) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Domain.cs 2009-05-14 14:44:13 UTC (rev 4301) @@ -1,80 +1,80 @@ -using System; - -namespace NHibernate.Test.NHSpecificTest.NH1773 -{ - public class Person - { - private string _name; - private int _age; - private int _id; - private Country _country; - - public virtual int Id - { - get { return _id; } - set { _id = value; } - } - - public virtual string Name - { - get { return _name; } - set { _name = value; } - } - - public virtual int Age - { - get { return _age; } - set { _age = value; } - } - - public virtual Country Country - { - get { return _country; } - set { _country = value; } - } - } - - public class Country - { - private int _id; - private string _name; - - public virtual int Id - { - get { return _id; } - set { _id = value; } - } - - public virtual string Name - { - get { return _name; } - set { _name = value; } - } - } - - public class PersonResult - { - private Person _person; +using System; + +namespace NHibernate.Test.NHSpecificTest.NH1773 +{ + public class Person + { + private string _name; + private int _age; + private int _id; + private Country _country; + + public virtual int Id + { + get { return _id; } + set { _id = value; } + } + + public virtual string Name + { + get { return _name; } + set { _name = value; } + } + + public virtual int Age + { + get { return _age; } + set { _age = value; } + } + + public virtual Country Country + { + get { return _country; } + set { _country = value; } + } + } + + public class Country + { + private int _id; + private string _name; + + public virtual int Id + { + get { return _id; } + set { _id = value; } + } + + public virtual string Name + { + get { return _name; } + set { _name = value; } + } + } + + public class PersonResult + { + private Person _person; private DateTime _time; public PersonResult(Person x) { - } - - public PersonResult(Person person, DateTime time) - { - _person = person; - _time = time; - } - - public Person Person - { - get { return _person; } - } - - public DateTime Time - { - get { return _time; } - } - } -} + } + + public PersonResult(Person person, DateTime time) + { + _person = person; + _time = time; + } + + public Person Person + { + get { return _person; } + } + + public DateTime Time + { + get { return _time; } + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Fixture.cs 2009-05-14 11:43:14 UTC (rev 4300) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1773/Fixture.cs 2009-05-14 14:44:13 UTC (rev 4301) @@ -1,63 +1,63 @@ -using System; -using System.Collections; -using NUnit.Framework; - -namespace NHibernate.Test.NHSpecificTest.NH1773 -{ - [TestFixture] - public class Fixture : BugTestCase - { - protected override void Configure(NHibernate.Cfg.Configuration configuration) - { - base.Configure(configuration); - //configuration.SetProperty(NHibernate.Cfg.Environment.QueryTranslator, typeof(NHibernate.Hql.Classic.ClassicQueryTranslatorFactory).AssemblyQualifiedName); - } - - protected override string MappingsAssembly - { - get { return "NHibernate.Test"; } - } - - protected override IList Mappings - { - get { return new[] { "NHSpecificTest.NH1773.Person.hbm.xml"}; } - } - - [Test] - public void CustomHQLFunctionsShouldBeRecognizedByTheParser() - { - using (ISession s = OpenSession()) - { - using (ITransaction tx = s.BeginTransaction()) - { - Country c = new Country() {Id = 100, Name = "US"}; - Person p = new Person() {Age = 35, Name = "My Name", Id=1, Country = c}; - s.Save(c); - s.Save(p); - tx.Commit(); - } - } - - using (ISession s = OpenSession()) - using (ITransaction tx = s.BeginTransaction()) +using System; +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1773 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void Configure(NHibernate.Cfg.Configuration configuration) + { + base.Configure(configuration); + configuration.SetProperty(NHibernate.Cfg.Environment.QueryTranslator, typeof(NHibernate.Hql.Classic.ClassicQueryTranslatorFactory).AssemblyQualifiedName); + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override IList Mappings + { + get { return new[] { "NHSpecificTest.NH1773.Person.hbm.xml"}; } + } + + [Test] + public void CustomHQLFunctionsShouldBeRecognizedByTheParser() + { + using (ISession s = OpenSession()) { + using (ITransaction tx = s.BeginTransaction()) + { + Country c = new Country() {Id = 100, Name = "US"}; + Person p = new Person() {Age = 35, Name = "My Name", Id=1, Country = c}; + s.Save(c); + s.Save(p); + tx.Commit(); + } + } + + using (ISession s = OpenSession()) + using (ITransaction tx = s.BeginTransaction()) + { IList result = s.CreateQuery("select new PersonResult(p, current_timestamp()) from Person p left join fetch p.Country").List(); - - Assert.AreEqual("My Name", ((PersonResult)result[0]).Person.Name); - Assert.IsTrue(NHibernateUtil.IsInitialized(((PersonResult)result[0]).Person.Country)); - tx.Commit(); - } - } - - protected override void OnTearDown() - { - using (ISession s = OpenSession()) - using (ITransaction tx = s.BeginTransaction()) - { - s.Delete("from Person"); - s.Delete("from Country"); - tx.Commit(); - } - } - } -} + + Assert.AreEqual("My Name", ((PersonResult)result[0]).Person.Name); + Assert.IsTrue(NHibernateUtil.IsInitialized(((PersonResult)result[0]).Person.Country)); + tx.Commit(); + } + } + + protected override void OnTearDown() + { + using (ISession s = OpenSession()) + using (ITransaction tx = s.BeginTransaction()) + { + s.Delete("from Person"); + s.Delete("from Country"); + tx.Commit(); + } + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |