Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
22 | 2 | 2 | 0.987 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 22 | 631 | src/NHibernate.Test/Operations/MergeFixture.cs |
2 | 22 | 655 | src/NHibernate.Test/Operations/MergeFixture.cs |
| ||||
[Test] public void PersistThenMergeInSameTxnWithTimestamp() { ISession s = OpenSession(); ITransaction tx = s.BeginTransaction(); var entity = new TimestampedEntity { Id = "test", Name = "test" } ; s.Persist(entity); s.Merge(new TimestampedEntity { Id = "test", Name = "test-2" } ); try { // control operation... s.SaveOrUpdate(new TimestampedEntity { Id = "test", Name = "test-3" } ); Assert.Fail("saveOrUpdate() should fail here"); } catch (NonUniqueObjectException) { // expected behavior } tx.Commit(); s.Close(); } |
| ||||
[Test] public void PersistThenMergeInSameTxnWithVersion() { ISession s = OpenSession(); ITransaction tx = s.BeginTransaction(); var entity = new VersionedEntity { Id = "test", Name = "test" } ; s.Persist(entity); s.Merge(new VersionedEntity { Id = "test", Name = "test-2" } ); try { // control operation... s.SaveOrUpdate(new VersionedEntity { Id = "test", Name = "test-3" } ); Assert.Fail("saveOrUpdate() should fail here"); } catch (NonUniqueObjectException) { // expected behavior } tx.Commit(); s.Close(); } |
| |||
[Test] public void [[#variable529211e0]]() { ISession s = OpenSession(); ITransaction tx = s.BeginTransaction(); var entity = new [[#variable4facb5a0]]{ Id = "test", Name = "test" } ; s.Persist(entity); s.Merge(new [[#variable4facb5a0]]{ Id = "test", Name = "test-2" } ); try { // control operation... s.SaveOrUpdate(new [[#variable4facb5a0]]{ Id = "test", Name = "test-3" } ); Assert.Fail("saveOrUpdate() should fail here"); } catch (NonUniqueObjectException) { // expected behavior } tx.Commit(); s.Close(); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#529211e0]] | PersistThenMergeInSameTxnWithTimestamp |
1 | 2 | [[#529211e0]] | PersistThenMergeInSameTxnWithVersion |
2 | 1 | [[#4facb5a0]] | TimestampedEntity |
2 | 2 | [[#4facb5a0]] | VersionedEntity |