CloneSet122


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
40310.998compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1401
src/NHibernate.ByteCode.Castle.Tests/TestConfigurationHelper.cs
2401
src/NHibernate.ByteCode.LinFu.Tests/TestConfigurationHelper.cs
3401
src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs
Clone Instance
1
Line Count
40
Source Line
1
Source File
src/NHibernate.ByteCode.Castle.Tests/TestConfigurationHelper.cs

using System;
using System.IO;
using NHibernate.Cfg;

namespace NHibernate.ByteCode.Castle.Tests
{
        public static class TestConfigurationHelper
        {
                public static readonly string hibernateConfigFile;

                static TestConfigurationHelper()
                {
                        // Verify if hibernate.cfg.xml exists
                        hibernateConfigFile = GetDefaultConfigurationFilePath();
                }

                public static string GetDefaultConfigurationFilePath()
                {
                        string baseDir = AppDomain.CurrentDomain.BaseDirectory;
                        string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
                        string binPath = relativeSearchPath == null ? baseDir:  Path.Combine(baseDir, relativeSearchPath);
                        string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName);
                        return File.Exists(fullPath) ? fullPath:  null;
                }

                /// <summary>
                /// Standar Configuration for tests.
                /// </summary>
                /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns>
                public static Configuration GetDefaultConfiguration()
                {
                        var result = new Configuration();
                        if (hibernateConfigFile != null)
                        {
                                result.Configure(hibernateConfigFile);
                        }
                        return result;
                }

        }
}


Clone Instance
2
Line Count
40
Source Line
1
Source File
src/NHibernate.ByteCode.LinFu.Tests/TestConfigurationHelper.cs

using System;
using System.IO;
using NHibernate.Cfg;

namespace NHibernate.ByteCode.LinFu.Tests
{
        public static class TestConfigurationHelper
        {
                public static readonly string hibernateConfigFile;

                static TestConfigurationHelper()
                {
                        // Verify if hibernate.cfg.xml exists
                        hibernateConfigFile = GetDefaultConfigurationFilePath();
                }

                public static string GetDefaultConfigurationFilePath()
                {
                        string baseDir = AppDomain.CurrentDomain.BaseDirectory;
                        string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
                        string binPath = relativeSearchPath == null ? baseDir:  Path.Combine(baseDir, relativeSearchPath);
                        string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName);
                        return File.Exists(fullPath) ? fullPath:  null;
                }

                /// <summary>
                /// Standar Configuration for tests.
                /// </summary>
                /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns>
                public static Configuration GetDefaultConfiguration()
                {
                        var result = new Configuration();
                        if (hibernateConfigFile != null)
                        {
                                result.Configure(hibernateConfigFile);
                        }
                        return result;
                }

        }
}


Clone Instance
3
Line Count
40
Source Line
1
Source File
src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs

using System;
using System.IO;
using NHibernate.Cfg;

namespace NHibernate.ByteCode.Spring.Tests
{
        public static class TestConfigurationHelper
        {
                public static readonly string hibernateConfigFile;

                static TestConfigurationHelper()
                {
                        // Verify if hibernate.cfg.xml exists
                        hibernateConfigFile = GetDefaultConfigurationFilePath();
                }

                public static string GetDefaultConfigurationFilePath()
                {
                        string baseDir = AppDomain.CurrentDomain.BaseDirectory;
                        string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
                        string binPath = relativeSearchPath == null ? baseDir:  Path.Combine(baseDir, relativeSearchPath);
                        string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName);
                        return File.Exists(fullPath) ? fullPath:  null;
                }

                /// <summary>
                /// Standard Configuration for tests.
                /// </summary>
                /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns>
                public static Configuration GetDefaultConfiguration()
                {
                        var result = new Configuration();
                        if (hibernateConfigFile != null)
                        {
                                result.Configure(hibernateConfigFile);
                        }
                        return result;
                }

        }
}


Clone AbstractionParameter Count: 1Parameter Bindings

using System;
using System.IO;
using NHibernate.Cfg;
namespace NHibernate.ByteCode. [[#variable65269ae0]].Tests
{
   public static class TestConfigurationHelper
   {
      public static readonly string hibernateConfigFile;

      static TestConfigurationHelper()
      {
         // Verify if hibernate.cfg.xml exists
         hibernateConfigFile = GetDefaultConfigurationFilePath();
      }

      public static string GetDefaultConfigurationFilePath()
      {
         string baseDir = AppDomain.CurrentDomain.BaseDirectory;
         string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
         string binPath = relativeSearchPath == null ?
                          baseDir: Path.Combine(baseDir, relativeSearchPath);
         string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName);
         return File.Exists(fullPath) ?
                fullPath: null;
      }

      /// <summary>
      /// Standar Configuration for tests.
      /// Standard Configuration for tests.
      /// </summary>
      /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns>
      public static Configuration GetDefaultConfiguration()
      {
         var result = new Configuration();
         if (hibernateConfigFile != null)
         {
            result.Configure(hibernateConfigFile);
         }
         return result;
      }

   }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#65269ae0]]
Castle 
12[[#65269ae0]]
LinFu 
13[[#65269ae0]]
Spring