CloneSet142


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
55230.971class_member_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15510
src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.cs
25511
src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs
Clone Instance
1
Line Count
55
Source Line
10
Source File
src/NHibernate.Test/NHSpecificTest/Futures/FutureCriteriaFixture.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);
                }
            }
        }



Clone Instance
2
Line Count
55
Source Line
11
Source File
src/NHibernate.Test/NHSpecificTest/Futures/FutureQueryFixture.cs

        [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);
                }
            }
        }



Clone AbstractionParameter Count: 3Parameter Bindings

[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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#5639d280]]
CanUseFutureCriteria 
12[[#5639d280]]
CanUseFutureQuery 
21[[#68761ea0]]
CreateCriteria 
22[[#68761ea0]]
CreateQuery 
31[[#7005aa80]]
typeof(Person) 
32[[#7005aa80]]
"from Person"