Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
55 | 2 | 3 | 0.971 | class_member_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 55 | 10 | src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs |
2 | 55 | 11 | src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs |
| ||||
[Test] public void CanUseFutureCriteria() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); var persons10 = s.CreateCriteria( typeof(Person)). SetMaxResults(10). Future<Person> (); var persons5 = s.CreateCriteria( typeof(Person)). SetMaxResults(5). Future<int> (); using ( var logSpy = new SqlLogSpy()) { foreach ( var person in persons5) { } foreach ( var person in persons10) { } var events = logSpy.Appender.GetEvents(); Assert.AreEqual(1, events.Length); } } } [Test] public void TwoFuturesRunInTwoRoundTrips() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); using ( var logSpy = new SqlLogSpy()) { var persons10 = s.CreateCriteria( typeof(Person)). SetMaxResults(10). Future<Person> (); foreach ( var person in persons10) { } // fire first future round-trip var persons5 = s.CreateCriteria( typeof(Person)). SetMaxResults(5). Future<int> (); foreach ( var person in persons5) { } // fire second future round-trip var events = logSpy.Appender.GetEvents(); Assert.AreEqual(2, events.Length); } } } |
| ||||
[Test] public void CanUseFutureQuery() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); var persons10 = s.CreateQuery("from Person"). SetMaxResults(10). Future<Person> (); var persons5 = s.CreateQuery("from Person"). SetMaxResults(5). Future<int> (); using ( var logSpy = new SqlLogSpy()) { foreach ( var person in persons5) { } foreach ( var person in persons10) { } var events = logSpy.Appender.GetEvents(); Assert.AreEqual(1, events.Length); } } } [Test] public void TwoFuturesRunInTwoRoundTrips() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); using ( var logSpy = new SqlLogSpy()) { var persons10 = s.CreateQuery("from Person"). SetMaxResults(10). Future<Person> (); foreach ( var person in persons10) { } // fire first future round-trip var persons5 = s.CreateQuery("from Person"). SetMaxResults(5). Future<int> (); foreach ( var person in persons5) { } // fire second future round-trip var events = logSpy.Appender.GetEvents(); Assert.AreEqual(2, events.Length); } } } |
| |||
[Test] public void [[#variable5639d280]]() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); var persons10 = s. [[#variable68761ea0]]( [[#variable7005aa80]]).SetMaxResults(10).Future<Person> (); var persons5 = s. [[#variable68761ea0]]( [[#variable7005aa80]]).SetMaxResults(5).Future<int> (); using ( var logSpy = new SqlLogSpy()) { foreach ( var person in persons5) { } foreach ( var person in persons10) { } var events = logSpy.Appender.GetEvents(); Assert.AreEqual(1, events.Length); } } } [Test] public void TwoFuturesRunInTwoRoundTrips() { using ( var s = sessions.OpenSession()) { IgnoreThisTestIfMultipleQueriesArentSupportedByDriver(); using ( var logSpy = new SqlLogSpy()) { var persons10 = s. [[#variable68761ea0]]( [[#variable7005aa80]]).SetMaxResults(10).Future<Person> (); foreach ( var person in persons10) { } // fire first future round-trip var persons5 = s. [[#variable68761ea0]]( [[#variable7005aa80]]).SetMaxResults(5).Future<int> (); foreach ( var person in persons5) { } // fire second future round-trip var events = logSpy.Appender.GetEvents(); Assert.AreEqual(2, events.Length); } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5639d280]] | CanUseFutureCriteria |
1 | 2 | [[#5639d280]] | CanUseFutureQuery |
2 | 1 | [[#68761ea0]] | CreateCriteria |
2 | 2 | [[#68761ea0]] | CreateQuery |
3 | 1 | [[#7005aa80]] | typeof(Person) |
3 | 2 | [[#7005aa80]] | "from Person" |