From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/JoinedSubclass Modified Files: JoinedSubclassFixture.cs Person.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclassFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JoinedSubclassFixture.cs 17 Jan 2005 03:40:51 -0000 1.3 --- JoinedSubclassFixture.cs 5 May 2005 19:27:55 -0000 1.4 *************** *** 27,31 **** public void TestJoinedSubclass() { ! ISession s = sessions.OpenSession(); Employee mark = new Employee(); --- 27,31 ---- public void TestJoinedSubclass() { ! ISession s = OpenSession(); Employee mark = new Employee(); *************** *** 64,68 **** // in later versions of hibernate a Clear method was added to session s.Close(); ! s = sessions.OpenSession(); IList customers = s.CreateQuery( "from Customer c left join fetch c.Salesperson" ).List(); --- 64,68 ---- // in later versions of hibernate a Clear method was added to session s.Close(); ! s = OpenSession(); IList customers = s.CreateQuery( "from Customer c left join fetch c.Salesperson" ).List(); *************** *** 75,79 **** Assert.AreEqual( 1, customers.Count ); s.Close(); ! s = sessions.OpenSession(); customers = s.CreateQuery( "from Customer" ).List(); --- 75,79 ---- Assert.AreEqual( 1, customers.Count ); s.Close(); ! s = OpenSession(); customers = s.CreateQuery( "from Customer" ).List(); *************** *** 87,91 **** s.Close(); ! s = sessions.OpenSession(); mark = (Employee)s.Load( typeof(Employee), mark.Id ); --- 87,91 ---- s.Close(); ! s = OpenSession(); mark = (Employee)s.Load( typeof(Employee), mark.Id ); *************** *** 108,112 **** { // test the Save ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 108,112 ---- { // test the Save ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 132,141 **** // get a proxied - initialized version of manager ! s = sessions.OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); NHibernateUtil.Initialize( pointyhair ); s.Close(); ! s = sessions.OpenSession(); IQuery q = s.CreateQuery( "from Employee as e where e.Manager = :theMgr" ); q.SetParameter( "theMgr", pointyhair ); --- 132,141 ---- // get a proxied - initialized version of manager ! s = OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); NHibernateUtil.Initialize( pointyhair ); s.Close(); ! s = OpenSession(); IQuery q = s.CreateQuery( "from Employee as e where e.Manager = :theMgr" ); q.SetParameter( "theMgr", pointyhair ); *************** *** 160,164 **** // test the Save ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 160,164 ---- // test the Save ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 181,185 **** // lets verify the correct classes were saved ! s = sessions.OpenSession(); t = s.BeginTransaction(); --- 181,185 ---- // lets verify the correct classes were saved ! s = OpenSession(); t = s.BeginTransaction(); *************** *** 213,217 **** // lets test the Criteria interface for subclassing ! s = sessions.OpenSession(); t = s.BeginTransaction(); --- 213,217 ---- // lets test the Criteria interface for subclassing ! s = OpenSession(); t = s.BeginTransaction(); Index: Person.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Person.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Person.cs 5 Jan 2005 02:44:18 -0000 1.2 --- Person.cs 5 May 2005 19:27:55 -0000 1.3 *************** *** 10,14 **** private int _id = 0; private string _name; ! private char _sex; private Address _address = new Address(); --- 10,14 ---- private int _id = 0; private string _name; ! private char _sex = 'M'; private Address _address = new Address(); |