Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
56 | 2 | 6 | 0.956 | class_member_declarations[3] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 56 | 58 | src/NHibernate.Test/NHSpecificTest/NH372/Fixture.cs |
2 | 56 | 158 | 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)); } |
| ||||
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)); } |
| |||
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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#68462240]] | ComponentFieldNotUpdated_Generic |
1 | 2 | [[#68462240]] | SubComponentFieldNotUpdated_Generic |
2 | 1 | [[#684621e0]] | p |
2 | 2 | [[#684621e0]] | p.Component |
3 | 1 | [[#68462220]] | Component |
3 | 2 | [[#68462220]] | SubComponent |
4 | 1 | [[#68462100]] | ComponentFieldNotUpdated |
4 | 2 | [[#68462100]] | SubComponentFieldNotUpdated |
5 | 1 | [[#68462120]] | ComponentFieldNotUpdated_Dynamic |
5 | 2 | [[#68462120]] | SubComponentFieldNotUpdated_Dynamic |
6 | 1 | [[#50663f60]] | true |
6 | 2 | [[#50663f60]] | false |