CloneSet135


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
45201.000class_member_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14590
src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ProxyFixture.cs
24590
src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs
Clone Instance
1
Line Count
45
Source Line
90
Source File
src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ProxyFixture.cs

                [Test]
                public void ProxySerialize()
                {
                        ISession s = OpenSession();
                        IMyProxy ap = new MyProxyImpl { Id = 1, Name = "first proxy"
                                                      } ;
                        s.Save(ap);
                        s.Flush();
                        s.Close();
                        s = OpenSession();
                        ap = (IMyProxy) s.Load( typeof( MyProxyImpl), ap.Id);
                        Assert.AreEqual(1, ap.Id);
                        s.Disconnect();

                        SerializeAndDeserialize( ref s);

                        s.Reconnect();
                        s.Disconnect();

                        // serialize and then deserialize the session again - make sure Castle.DynamicProxy
                        // has no problem with serializing two times - earlier versions of it did.
                        SerializeAndDeserialize( ref s);

                        s.Close();

                        s = OpenSession();
                        s.Delete(ap);
                        s.Flush();
                        s.Close();
                }

                [Test]
                public void SerializeNotFoundProxy()
                {
                        ISession s = OpenSession();
                        // this does not actually exists in db
                        var notThere = (IMyProxy) s.Load( typeof( MyProxyImpl), 5);
                        Assert.AreEqual(5, notThere.Id);
                        s.Disconnect();

                        // serialize and then deserialize the session.
                        SerializeAndDeserialize( ref s);

                        Assert.IsNotNull(s.Load( typeof( MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db");
                        s.Close();
                }



Clone Instance
2
Line Count
45
Source Line
90
Source File
src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs

                [Test]
                public void ProxySerialize()
                {
                        ISession s = OpenSession();
                        IMyProxy ap = new MyProxyImpl { Id = 1, Name = "first proxy"
                                                      } ;
                        s.Save(ap);
                        s.Flush();
                        s.Close();
                        s = OpenSession();
                        ap = (IMyProxy) s.Load( typeof( MyProxyImpl), ap.Id);
                        Assert.AreEqual(1, ap.Id);
                        s.Disconnect();

                        SerializeAndDeserialize( ref s);

                        s.Reconnect();
                        s.Disconnect();

                        // serialize and then deserialize the session again - make sure Castle.DynamicProxy
                        // has no problem with serializing two times - earlier versions of it did.
                        SerializeAndDeserialize( ref s);

                        s.Close();

                        s = OpenSession();
                        s.Delete(ap);
                        s.Flush();
                        s.Close();
                }

                [Test]
                public void SerializeNotFoundProxy()
                {
                        ISession s = OpenSession();
                        // this does not actually exists in db
                        var notThere = (IMyProxy) s.Load( typeof( MyProxyImpl), 5);
                        Assert.AreEqual(5, notThere.Id);
                        s.Disconnect();

                        // serialize and then deserialize the session.
                        SerializeAndDeserialize( ref s);

                        Assert.IsNotNull(s.Load( typeof( MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db");
                        s.Close();
                }



Clone AbstractionParameter Count: 0Parameter Bindings

[Test]
public void ProxySerialize()
{
   ISession s = OpenSession();
   IMyProxy ap = new MyProxyImpl {
                                    Id = 1, Name = "first proxy"
                                 } ;
   s.Save(ap);
   s.Flush();
   s.Close();
   s = OpenSession();
   ap = (IMyProxy)s.Load( typeof(MyProxyImpl), ap.Id);
   Assert.AreEqual(1, ap.Id);
   s.Disconnect();
   SerializeAndDeserialize( ref s);
   s.Reconnect();
   s.Disconnect();
   // serialize and then deserialize the session again - make sure Castle.DynamicProxy
   // has no problem with serializing two times - earlier versions of it did.
   SerializeAndDeserialize( ref s);
   s.Close();
   s = OpenSession();
   s.Delete(ap);
   s.Flush();
   s.Close();
}

[Test]
public void SerializeNotFoundProxy()
{
   ISession s = OpenSession();
   // this does not actually exists in db
   var notThere = (IMyProxy)s.Load( typeof(MyProxyImpl), 5);
   Assert.AreEqual(5, notThere.Id);
   s.Disconnect();
   // serialize and then deserialize the session.
   SerializeAndDeserialize( ref s);
   Assert.IsNotNull(s.Load( typeof(MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db");
   s.Close();
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None