Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5747/NHibernate.Test/NHSpecificTest
Modified Files:
Tag: alpha_avalon-proxy
AvalonProxyFixture.cs
Log Message:
Trying to find problem with FooBarTest.PersistCollections by duplicating
scenarios that could be causing it. I believe it might be internal to
Castle.DynamicProxy but need to find a way to duplicate it with a less
complex scenario than the current test.
Index: AvalonProxyFixture.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/Attic/AvalonProxyFixture.cs,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** AvalonProxyFixture.cs 11 Nov 2004 22:37:21 -0000 1.1.2.3
--- AvalonProxyFixture.cs 15 Nov 2004 05:26:21 -0000 1.1.2.4
***************
*** 70,73 ****
--- 70,94 ----
}
+ [Test]
+ public void SerializeNotFoundProxy()
+ {
+ ISession s = sessions.OpenSession();
+ // this does not actually exists in db
+ AvalonProxy notThere = (AvalonProxy)s.Load( typeof(AvalonProxyImpl), 5 );
+ Assert.AreEqual( 5, notThere.Id );
+ s.Disconnect();
+
+ // serialize and then deserialize the session.
+ System.IO.Stream stream = new System.IO.MemoryStream();
+ System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter( );
+ formatter.Serialize(stream, s);
+ stream.Position = 0;
+ s = (ISession)formatter.Deserialize(stream);
+ stream.Close();
+
+ Assert.IsNotNull( s.Load( typeof(AvalonProxyImpl), 5 ), "should be proxy - even though it doesn't exists in db" );
+ s.Close();
+ }
+
}
}
|