From: Michael D. <mik...@us...> - 2004-05-11 19:47:28
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21767 Modified Files: FooBarTest.cs Log Message: Added ignored test for Cache testing. Appears to be a problem with HQL and parsing of parameters. There is code using "[<" and ">]" as the parameter in code - saw a comment in HQL asking why and I have no idea. Going to fix AdoHack and WhereParser so it works with ? as the parameter. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** FooBarTest.cs 30 Apr 2004 15:51:11 -0000 1.19 --- FooBarTest.cs 11 May 2004 19:47:17 -0000 1.20 *************** *** 18,22 **** "Qux.hbm.xml", "Fum.hbm.xml", ! "Baz.hbm.xml" // "Simple.hbm.xml", // "Fumm.hbm.xml", --- 18,22 ---- "Qux.hbm.xml", "Fum.hbm.xml", ! "Baz.hbm.xml", // "Simple.hbm.xml", // "Fumm.hbm.xml", *************** *** 24,28 **** // "One.hbm.xml", // "Many.hbm.xml", ! // "Immutable.hbm.xml", // "Vetoer.hbm.xml", // "Holder.hbm.xml", --- 24,28 ---- // "One.hbm.xml", // "Many.hbm.xml", ! "Immutable.hbm.xml" // "Vetoer.hbm.xml", // "Holder.hbm.xml", *************** *** 41,44 **** --- 41,45 ---- [Test] + [Ignore("Fails because Proxies are not working.")] public void FetchInitializedCollection() { *************** *** 227,230 **** --- 228,258 ---- s.Close(); } + + [Test] + [Ignore("This is not working until I get parameters and HQL working better.")] + public void Cache() + { + ISession s = sessions.OpenSession(); + Immutable im = new Immutable(); + s.Save(im); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + s.Load( im, im.Id); + s.Close(); + + s = sessions.OpenSession(); + s.Load( im, im.Id); + + Immutable imFromFind = (Immutable)s.Find("from im in class Immutable where im = ?", im, NHibernate.Entity(typeof(Immutable)))[0]; + Immutable imFromLoad = (Immutable)s.Load(typeof(Immutable), im.Id); + + Assert.IsTrue(im==imFromFind, "cached object identity from Find "); + Assert.IsTrue(im==imFromLoad, "cached object identity from Load "); + + s.Close(); + + } } } |