From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CompositeId In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/CompositeId Modified Files: ClassWithCompositeIdFixture.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: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CompositeId/ClassWithCompositeIdFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassWithCompositeIdFixture.cs 11 Dec 2004 20:08:18 -0000 1.1 --- ClassWithCompositeIdFixture.cs 5 May 2005 19:27:53 -0000 1.2 *************** *** 59,63 **** // insert the new objects ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 59,63 ---- // insert the new objects ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 76,80 **** // verify they were inserted and test the SELECT ! ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); --- 76,80 ---- // verify they were inserted and test the SELECT ! ISession s2 = OpenSession(); ITransaction t2 = s2.BeginTransaction(); *************** *** 111,115 **** // lets verify the update went through ! ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); --- 111,115 ---- // lets verify the update went through ! ISession s3 = OpenSession(); ITransaction t3 = s3.BeginTransaction(); *************** *** 129,133 **** // lets verify the delete went through ! ISession s4 = sessions.OpenSession(); try --- 129,133 ---- // lets verify the delete went through ! ISession s4 = OpenSession(); try *************** *** 147,150 **** --- 147,151 ---- Assert.AreEqual(0, results.Count); + s4.Close(); } *************** *** 158,167 **** // add the new instance to the session so I have something to get results // back for ! ISession s = sessions.OpenSession(); s.Save(cId); s.Flush(); s.Close(); ! s = sessions.OpenSession(); ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); c.Add( Expression.Expression.Eq("Id", id) ); --- 159,168 ---- // add the new instance to the session so I have something to get results // back for ! ISession s = OpenSession(); s.Save(cId); s.Flush(); s.Close(); ! s = OpenSession(); ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); c.Add( Expression.Expression.Eq("Id", id) ); *************** *** 179,183 **** { // insert the new objects ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 180,184 ---- { // insert the new objects ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 194,198 **** s.Close(); ! ISession s2 = sessions.OpenSession(); IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString"); --- 195,199 ---- s.Close(); ! ISession s2 = OpenSession(); IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString"); *************** *** 204,207 **** --- 205,209 ---- Assert.AreEqual(1, results.Count); + s2.Close(); } |