CloneSet88


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
56260.956class_member_declarations[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15658
src/NHibernate.Test/NHSpecificTest/NH372/Fixture.cs
256158
src/NHibernate.Test/NHSpecificTest/NH372/Fixture.cs
Clone Instance
1
Line Count
56
Source Line
58
Source File
src/NHibernate.Test/NHSpecificTest/NH372/Fixture.cs

                private void ComponentFieldNotUpdated_Generic(System.Type type)
                {
                        int id;
                        int fieldInitialValue = 10;
                        int fieldNewValue = 30;

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) Activator.CreateInstance(type);
                                p.Component.FieldNotUpdated = fieldInitialValue;
                                session.Save(p);

                                tx.Commit();

                                id = p.Id;
                        }

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) session.Get(type, id);

                                Assert.AreEqual(fieldInitialValue, p.Component.FieldNotUpdated,
                                                String.Format("Field should have initial inserted value of {0}.", fieldInitialValue));

                                p.Component.FieldNotUpdated = fieldNewValue;
                                p.Component.NormalField = 10;

                                tx.Commit();
                        }

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) session.Get(type, id);

                                Assert.AreEqual(fieldInitialValue, p.Component.FieldNotUpdated,
                                                "Field should not have been updated.");

                                tx.Commit();
                        }
                }

                [Test]
                public void ComponentFieldNotUpdated()
                {
                        isDynamic = false;
                        ComponentFieldNotUpdated_Generic( typeof(Parent));
                }

                [Test]
                public void ComponentFieldNotUpdated_Dynamic()
                {
                        isDynamic = true;
                        ComponentFieldNotUpdated_Generic( typeof(DynamicParent));
                }



Clone Instance
2
Line Count
56
Source Line
158
Source File
src/NHibernate.Test/NHSpecificTest/NH372/Fixture.cs

                private void SubComponentFieldNotUpdated_Generic(System.Type type)
                {
                        int id;
                        int fieldInitialValue = 10;
                        int fieldNewValue = 30;

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) Activator.CreateInstance(type);
                                p.Component.SubComponent.FieldNotUpdated = fieldInitialValue;
                                session.Save(p);

                                tx.Commit();

                                id = p.Id;
                        }

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) session.Get(type, id);

                                Assert.AreEqual(fieldInitialValue, p.Component.SubComponent.FieldNotUpdated,
                                                String.Format("Field should have initial inserted value of {0}.", fieldInitialValue));

                                p.Component.SubComponent.FieldNotUpdated = fieldNewValue;
                                p.Component.SubComponent.NormalField = 10;

                                tx.Commit();
                        }

                        using (ISession session = OpenSession())
                        using (ITransaction tx = session.BeginTransaction())
                        {
                                BaseParent p = (BaseParent) session.Get(type, id);

                                Assert.AreEqual(fieldInitialValue, p.Component.SubComponent.FieldNotUpdated,
                                                "Field should not have been updated.");

                                tx.Commit();
                        }
                }

                [Test]
                public void SubComponentFieldNotUpdated()
                {
                        isDynamic = false;
                        SubComponentFieldNotUpdated_Generic( typeof(Parent));
                }

                [Test]
                public void SubComponentFieldNotUpdated_Dynamic()
                {
                        isDynamic = false;
                        SubComponentFieldNotUpdated_Generic( typeof(DynamicParent));
                }



Clone AbstractionParameter Count: 6Parameter Bindings

private void [[#variable68462240]](System.Type type)
{
   int id;
   int fieldInitialValue = 10;
   int fieldNewValue = 30;
   using (ISession session = OpenSession())
      using (ITransaction tx = session.BeginTransaction())
      {
         BaseParent p = (BaseParent)Activator.CreateInstance(type);
          [[#variable684621e0]]. [[#variable68462220]].FieldNotUpdated = fieldInitialValue;
         session.Save(p);
         tx.Commit();
         id = p.Id;
      }
   using (ISession session = OpenSession())
      using (ITransaction tx = session.BeginTransaction())
      {
         BaseParent p = (BaseParent)session.Get(type, id);
         Assert.AreEqual(fieldInitialValue, [[#variable684621e0]]. [[#variable68462220]].FieldNotUpdated, String.Format("Field should have initial inserted value of {0}.", fieldInitialValue));
          [[#variable684621e0]]. [[#variable68462220]].FieldNotUpdated = fieldNewValue;
          [[#variable684621e0]]. [[#variable68462220]].NormalField = 10;
         tx.Commit();
      }
   using (ISession session = OpenSession())
      using (ITransaction tx = session.BeginTransaction())
      {
         BaseParent p = (BaseParent)session.Get(type, id);
         Assert.AreEqual(fieldInitialValue, [[#variable684621e0]]. [[#variable68462220]].FieldNotUpdated, "Field should not have been updated.");
         tx.Commit();
      }
}

[Test]
public void [[#variable68462100]]()
{
   isDynamic = false;
    [[#variable68462240]]( typeof(Parent));
}

[Test]
public void [[#variable68462120]]()
{
   isDynamic = [[#variable50663f60]];
    [[#variable68462240]]( typeof(DynamicParent));
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#68462240]]
ComponentFieldNotUpdated_Generic 
12[[#68462240]]
SubComponentFieldNotUpdated_Generic 
21[[#684621e0]]
p 
22[[#684621e0]]
p.Component 
31[[#68462220]]
Component 
32[[#68462220]]
SubComponent 
41[[#68462100]]
ComponentFieldNotUpdated 
42[[#68462100]]
SubComponentFieldNotUpdated 
51[[#68462120]]
ComponentFieldNotUpdated_Dynamic 
52[[#68462120]]
SubComponentFieldNotUpdated_Dynamic 
61[[#50663f60]]
true 
62[[#50663f60]]
false