Changing namespace of Migrations to Builders

Refactoring to be what's needed at the moment

--HG--
branch : dev
This commit is contained in:
Louis DeJardin
2010-02-15 12:57:52 -08:00
parent 91a34a35ff
commit 6a34dce4ef
14 changed files with 37 additions and 37 deletions

View File

@@ -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;

View File

@@ -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();
}
}
}
}

View File

@@ -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 {

View File

@@ -135,7 +135,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="DataUtility.cs" />
<Compile Include="Data\Migrations\DatabaseManagerTests.cs" />
<Compile Include="Data\Builders\SessionFactoryBuilderTests.cs" />
<Compile Include="Data\RepositoryTests.cs" />
<Compile Include="Data\StubLocator.cs" />
<Compile Include="Environment\Configuration\AppDataFolderTests.cs" />

View File

@@ -13,7 +13,7 @@
<add name="WebPageTrace"/>
</listeners>
</source>
<source name="Orchard.Localization" switchValue="Information">
<source name="Orchard.Data.SessionLocator" switchValue="Information">
<listeners>
<add name="OrchardDebugTextLog" />
<add name="WebPageTrace"/>

View File

@@ -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;

View File

@@ -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();

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -133,11 +133,11 @@
<Compile Include="ContentManagement\Handlers\RemoveContentContext.cs" />
<Compile Include="ContentManagement\Handlers\VersionContentContext.cs" />
<Compile Include="Data\Conventions\RecordTableNameConvention.cs" />
<Compile Include="Data\Migrations\AbstractBuilder.cs" />
<Compile Include="Data\Migrations\SessionFactoryBuilder.cs" />
<Compile Include="Data\Migrations\ISessionFactoryBuilder.cs" />
<Compile Include="Data\Migrations\SQLiteBuilder.cs" />
<Compile Include="Data\Migrations\SqlServerBuilder.cs" />
<Compile Include="Data\Builders\AbstractBuilder.cs" />
<Compile Include="Data\Builders\SessionFactoryBuilder.cs" />
<Compile Include="Data\Builders\ISessionFactoryBuilder.cs" />
<Compile Include="Data\Builders\SQLiteBuilder.cs" />
<Compile Include="Data\Builders\SqlServerBuilder.cs" />
<Compile Include="Data\SessionFactoryHolder.cs" />
<Compile Include="Environment\Configuration\AppDataFolder.cs" />
<Compile Include="Environment\Configuration\ShellSettingsLoader.cs" />