| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 45 | 2 | 0 | 1.000 | class_member_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 45 | 90 | src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ProxyFixture.cs |
| 2 | 45 | 90 | 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();
}
|
| ||||
[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();
}
|
| |||
[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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| None | |||