CloneSet81


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
43210.999statement_list[34]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14347
src/NHibernate.Test/DynamicEntity/Interceptor/InterceptorDynamicEntity.cs
24363
src/NHibernate.Test/DynamicEntity/Tuplizer/TuplizerDynamicEntity.cs
Clone Instance
1
Line Count
43
Source Line
47
Source File
src/NHibernate.Test/DynamicEntity/Interceptor/InterceptorDynamicEntity.cs

                        customer = session.Load < Customer > (customer.Id);
                        Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");

                        customer.Name = "other";
                        session.Flush();
                        Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");

                        session.Refresh(customer);
                        Assert.AreEqual("other", customer.Name, "name not updated");
                        Assert.AreEqual("acme", customer.Company.Name, "company association not correct");

                        session.Transaction.Commit();
                        session.Close();

                        // Test detached entity re-attachment with these dyna-proxies
                        customer.Name = "Steve";
                        session = OpenSession();
                        session.BeginTransaction();
                        session.Update(customer);
                        session.Flush();
                        session.Refresh(customer);
                        Assert.AreEqual("Steve", customer.Name, "name not updated");
                        session.Transaction.Commit();
                        session.Close();

                        // Test querying
                        session = OpenSession();
                        session.BeginTransaction();
                        int count = session.CreateQuery("from Customer").List().Count;
                        Assert.AreEqual(1, count, "querying dynamic entity");
                        session.Clear();
                        count = session.CreateQuery("from Person").List().Count;
                        Assert.AreEqual(1, count, "querying dynamic entity");
                        session.Transaction.Commit();
                        session.Close();

                        // test deleteing
                        session = OpenSession();
                        session.BeginTransaction();
                        session.Delete(company);
                        session.Delete(customer);
                        session.Transaction.Commit();
                        session.Close();


Clone Instance
2
Line Count
43
Source Line
63
Source File
src/NHibernate.Test/DynamicEntity/Tuplizer/TuplizerDynamicEntity.cs

                        customer = session.Load < Customer > (customer.Id);
                        Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");

                        customer.Name = "other";
                        session.Flush();
                        Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");

                        session.Refresh(customer);
                        Assert.AreEqual("other", customer.Name, "name not updated");
                        Assert.AreEqual("acme", customer.Company.Name, "company association not correct");

                        session.Transaction.Commit();
                        session.Close();

                        // Test detached entity re-attachment with these dyna-proxies
                        customer.Name = "Steve";
                        session = OpenSession();
                        session.BeginTransaction();
                        session.Update(customer);
                        session.Flush();
                        session.Refresh(customer);
                        Assert.AreEqual("Steve", customer.Name, "name not updated");
                        session.Transaction.Commit();
                        session.Close();

                        // Test querying
                        session = OpenSession();
                        session.BeginTransaction();
                        int count = session.CreateQuery("from Customer").List().Count;
                        Assert.AreEqual(1, count, "querying dynamic entity");
                        session.Clear();
                        count = session.CreateQuery("from Person").List().Count;
                        Assert.AreEqual(3, count, "querying dynamic entity");
                        session.Transaction.Commit();
                        session.Close();

                        // test deleteing
                        session = OpenSession();
                        session.BeginTransaction();
                        session.Delete(company);
                        session.Delete(customer);
                        session.Transaction.Commit();
                        session.Close();


Clone AbstractionParameter Count: 1Parameter Bindings

customer = session.Load < Customer > (customer.Id);
Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");
customer.Name = "other";
session.Flush();
Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");
session.Refresh(customer);
Assert.AreEqual("other", customer.Name, "name not updated");
Assert.AreEqual("acme", customer.Company.Name, "company association not correct");
session.Transaction.Commit();
session.Close();
// Test detached entity re-attachment with these dyna-proxies
customer.Name = "Steve";
session = OpenSession();
session.BeginTransaction();
session.Update(customer);
session.Flush();
session.Refresh(customer);
Assert.AreEqual("Steve", customer.Name, "name not updated");
session.Transaction.Commit();
session.Close();
// Test querying
session = OpenSession();
session.BeginTransaction();
int count = session.CreateQuery("from Customer").List().Count;
Assert.AreEqual(1, count, "querying dynamic entity");
session.Clear();
count = session.CreateQuery("from Person").List().Count;
Assert.AreEqual( [[#variable6fee4100]], count, "querying dynamic entity");
session.Transaction.Commit();
session.Close();
// test deleteing
session = OpenSession();
session.BeginTransaction();
session.Delete(company);
session.Delete(customer);
session.Transaction.Commit();
session.Close();
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6fee4100]]
1 
12[[#6fee4100]]
3