From 6a34dce4ef30c800713ae17e1534bdee349d936b Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Mon, 15 Feb 2010 12:57:52 -0800 Subject: [PATCH] Changing namespace of Migrations to Builders Refactoring to be what's needed at the moment --HG-- branch : dev --- .../Setup/SetupControllerTests.cs | 2 +- .../SessionFactoryBuilderTests.cs} | 40 +++++++++---------- src/Orchard.Tests/DataUtility.cs | 2 +- src/Orchard.Tests/Orchard.Tests.csproj | 2 +- src/Orchard.Web/Config/Diagnostics.config | 2 +- .../Controllers/SetupController.cs | 2 +- .../AbstractBuilder.cs | 2 +- .../ISessionFactoryBuilder.cs | 2 +- .../{Migrations => Builders}/SQLiteBuilder.cs | 2 +- .../SessionFactoryBuilder.cs | 2 +- .../SqlServerBuilder.cs | 2 +- src/Orchard/Data/SessionFactoryHolder.cs | 2 +- .../SafeModeShellContainerFactory.cs | 2 +- src/Orchard/Orchard.csproj | 10 ++--- 14 files changed, 37 insertions(+), 37 deletions(-) rename src/Orchard.Tests/Data/{Migrations/DatabaseManagerTests.cs => Builders/SessionFactoryBuilderTests.cs} (58%) rename src/Orchard/Data/{Migrations => Builders}/AbstractBuilder.cs (96%) rename src/Orchard/Data/{Migrations => Builders}/ISessionFactoryBuilder.cs (91%) rename src/Orchard/Data/{Migrations => Builders}/SQLiteBuilder.cs (93%) rename src/Orchard/Data/{Migrations => Builders}/SessionFactoryBuilder.cs (93%) rename src/Orchard/Data/{Migrations => Builders}/SqlServerBuilder.cs (92%) diff --git a/src/Orchard.Tests.Modules/Setup/SetupControllerTests.cs b/src/Orchard.Tests.Modules/Setup/SetupControllerTests.cs index 87a86d320..e72a06851 100644 --- a/src/Orchard.Tests.Modules/Setup/SetupControllerTests.cs +++ b/src/Orchard.Tests.Modules/Setup/SetupControllerTests.cs @@ -7,7 +7,7 @@ using Autofac.Builder; using JetBrains.Annotations; using Moq; using NUnit.Framework; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment; using Orchard.Environment.Configuration; using Orchard.Setup.Controllers; diff --git a/src/Orchard.Tests/Data/Migrations/DatabaseManagerTests.cs b/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs similarity index 58% rename from src/Orchard.Tests/Data/Migrations/DatabaseManagerTests.cs rename to src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs index 5e19fdbd1..37679bff5 100644 --- a/src/Orchard.Tests/Data/Migrations/DatabaseManagerTests.cs +++ b/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs @@ -1,13 +1,13 @@ using System.Data.SqlClient; using System.IO; using NUnit.Framework; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment; using Orchard.Tests.Records; -namespace Orchard.Tests.Data.Migrations { +namespace Orchard.Tests.Data.Builders { [TestFixture] - public class DatabaseManagerTests { + public class SessionFactoryBuilderTests { private string _tempDataFolder; [SetUp] @@ -47,16 +47,16 @@ namespace Orchard.Tests.Data.Migrations { [Test] public void SQLiteSchemaShouldBeGeneratedAndUsable() { - var recordDescriptors = new[] { - new RecordDescriptor {Prefix = "Hello", Type = typeof (Foo)} - }; + var recordDescriptors = new[] { + new RecordDescriptor {Prefix = "Hello", Type = typeof (Foo)} + }; var manager = (ISessionFactoryBuilder)new SessionFactoryBuilder(); var sessionFactory = manager.BuildSessionFactory(new SessionFactoryParameters { - Provider = "SQLite", - DataFolder = _tempDataFolder, - UpdateSchema = true, - RecordDescriptors = recordDescriptors - }); + Provider = "SQLite", + DataFolder = _tempDataFolder, + UpdateSchema = true, + RecordDescriptors = recordDescriptors + }); var session = sessionFactory.OpenSession(); @@ -77,17 +77,17 @@ namespace Orchard.Tests.Data.Migrations { CreateSqlServerDatabase(databasePath); var recordDescriptors = new[] { - new RecordDescriptor {Prefix = "Hello", Type = typeof (Foo)} - }; + new RecordDescriptor {Prefix = "Hello", Type = typeof (Foo)} + }; var manager = (ISessionFactoryBuilder)new SessionFactoryBuilder(); var sessionFactory = manager.BuildSessionFactory(new SessionFactoryParameters { - Provider = "SQLite", - DataFolder = _tempDataFolder, - ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;", - UpdateSchema = true, - RecordDescriptors = recordDescriptors, - }); + Provider = "SQLite", + DataFolder = _tempDataFolder, + ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;", + UpdateSchema = true, + RecordDescriptors = recordDescriptors, + }); @@ -102,4 +102,4 @@ namespace Orchard.Tests.Data.Migrations { sessionFactory.Close(); } } -} +} \ No newline at end of file diff --git a/src/Orchard.Tests/DataUtility.cs b/src/Orchard.Tests/DataUtility.cs index b33704327..4235de057 100644 --- a/src/Orchard.Tests/DataUtility.cs +++ b/src/Orchard.Tests/DataUtility.cs @@ -9,7 +9,7 @@ using FluentNHibernate.Cfg.Db; using NHibernate; using NHibernate.Tool.hbm2ddl; using Orchard.Data; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment; namespace Orchard.Tests { diff --git a/src/Orchard.Tests/Orchard.Tests.csproj b/src/Orchard.Tests/Orchard.Tests.csproj index b17aec404..61c86e9a8 100644 --- a/src/Orchard.Tests/Orchard.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Tests.csproj @@ -135,7 +135,7 @@ Code - + diff --git a/src/Orchard.Web/Config/Diagnostics.config b/src/Orchard.Web/Config/Diagnostics.config index 3458c5b4e..124536a7d 100644 --- a/src/Orchard.Web/Config/Diagnostics.config +++ b/src/Orchard.Web/Config/Diagnostics.config @@ -13,7 +13,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index c720c894e..24bd82093 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -7,7 +7,7 @@ using Orchard.Core.Common.Models; using Orchard.Core.Navigation.Models; using Orchard.Core.Settings.Models; using Orchard.Data; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment; using Orchard.Environment.Configuration; using Orchard.Security; diff --git a/src/Orchard/Data/Migrations/AbstractBuilder.cs b/src/Orchard/Data/Builders/AbstractBuilder.cs similarity index 96% rename from src/Orchard/Data/Migrations/AbstractBuilder.cs rename to src/Orchard/Data/Builders/AbstractBuilder.cs index f4d8869c9..fb4dad706 100644 --- a/src/Orchard/Data/Migrations/AbstractBuilder.cs +++ b/src/Orchard/Data/Builders/AbstractBuilder.cs @@ -13,7 +13,7 @@ using Orchard.ContentManagement.Records; using Orchard.Data.Conventions; using Orchard.Environment; -namespace Orchard.Data.Migrations { +namespace Orchard.Data.Builders { public abstract class AbstractBuilder { protected abstract IPersistenceConfigurer GetPersistenceConfigurer(); diff --git a/src/Orchard/Data/Migrations/ISessionFactoryBuilder.cs b/src/Orchard/Data/Builders/ISessionFactoryBuilder.cs similarity index 91% rename from src/Orchard/Data/Migrations/ISessionFactoryBuilder.cs rename to src/Orchard/Data/Builders/ISessionFactoryBuilder.cs index b0dc469bb..6ff177f62 100644 --- a/src/Orchard/Data/Migrations/ISessionFactoryBuilder.cs +++ b/src/Orchard/Data/Builders/ISessionFactoryBuilder.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using NHibernate; using Orchard.Environment; -namespace Orchard.Data.Migrations { +namespace Orchard.Data.Builders { public interface ISessionFactoryBuilder : IDependency { ISessionFactory BuildSessionFactory(SessionFactoryParameters sessionFactoryParameters); diff --git a/src/Orchard/Data/Migrations/SQLiteBuilder.cs b/src/Orchard/Data/Builders/SQLiteBuilder.cs similarity index 93% rename from src/Orchard/Data/Migrations/SQLiteBuilder.cs rename to src/Orchard/Data/Builders/SQLiteBuilder.cs index 8e4d1d944..126c843eb 100644 --- a/src/Orchard/Data/Migrations/SQLiteBuilder.cs +++ b/src/Orchard/Data/Builders/SQLiteBuilder.cs @@ -1,7 +1,7 @@ using System.IO; using FluentNHibernate.Cfg.Db; -namespace Orchard.Data.Migrations { +namespace Orchard.Data.Builders { public class SQLiteBuilder : AbstractBuilder { private readonly string _dataFolder; private readonly string _connectionString; diff --git a/src/Orchard/Data/Migrations/SessionFactoryBuilder.cs b/src/Orchard/Data/Builders/SessionFactoryBuilder.cs similarity index 93% rename from src/Orchard/Data/Migrations/SessionFactoryBuilder.cs rename to src/Orchard/Data/Builders/SessionFactoryBuilder.cs index 67f6f7f6c..2f2307eb2 100644 --- a/src/Orchard/Data/Migrations/SessionFactoryBuilder.cs +++ b/src/Orchard/Data/Builders/SessionFactoryBuilder.cs @@ -1,7 +1,7 @@ using System; using NHibernate; -namespace Orchard.Data.Migrations { +namespace Orchard.Data.Builders { public class SessionFactoryBuilder : ISessionFactoryBuilder { public ISessionFactory BuildSessionFactory(SessionFactoryParameters sessionFactoryParameters) { AbstractBuilder builder; diff --git a/src/Orchard/Data/Migrations/SqlServerBuilder.cs b/src/Orchard/Data/Builders/SqlServerBuilder.cs similarity index 92% rename from src/Orchard/Data/Migrations/SqlServerBuilder.cs rename to src/Orchard/Data/Builders/SqlServerBuilder.cs index 0e1b2d591..c4d15719a 100644 --- a/src/Orchard/Data/Migrations/SqlServerBuilder.cs +++ b/src/Orchard/Data/Builders/SqlServerBuilder.cs @@ -1,7 +1,7 @@ using System; using FluentNHibernate.Cfg.Db; -namespace Orchard.Data.Migrations { +namespace Orchard.Data.Builders { public class SqlServerBuilder : AbstractBuilder { private readonly string _dataFolder; private readonly string _connectionString; diff --git a/src/Orchard/Data/SessionFactoryHolder.cs b/src/Orchard/Data/SessionFactoryHolder.cs index a5f41b99b..14f51d0bd 100644 --- a/src/Orchard/Data/SessionFactoryHolder.cs +++ b/src/Orchard/Data/SessionFactoryHolder.cs @@ -1,6 +1,6 @@ using System.IO; using NHibernate; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment; using Orchard.Environment.Configuration; using Orchard.Logging; diff --git a/src/Orchard/Environment/ShellBuilders/SafeModeShellContainerFactory.cs b/src/Orchard/Environment/ShellBuilders/SafeModeShellContainerFactory.cs index 83812e863..2482e7c0c 100644 --- a/src/Orchard/Environment/ShellBuilders/SafeModeShellContainerFactory.cs +++ b/src/Orchard/Environment/ShellBuilders/SafeModeShellContainerFactory.cs @@ -8,7 +8,7 @@ using System.Web.Routing; using Autofac; using Orchard.ContentManagement; using Orchard.ContentManagement.Handlers; -using Orchard.Data.Migrations; +using Orchard.Data.Builders; using Orchard.Environment.Configuration; using Orchard.Extensions; using Orchard.Localization; diff --git a/src/Orchard/Orchard.csproj b/src/Orchard/Orchard.csproj index 0930cbe6b..72922849d 100644 --- a/src/Orchard/Orchard.csproj +++ b/src/Orchard/Orchard.csproj @@ -133,11 +133,11 @@ - - - - - + + + + +