From e55cff760d74c61dfe8ba6f2da55aba6e5a72c04 Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Wed, 14 Jul 2010 22:34:57 -0700 Subject: [PATCH] Fix SpecFlow tests --HG-- branch : dev --- .../Bindings/OrchardSiteFactory.cs | 7 +++--- src/Orchard.Specs/Bindings/WebAppHosting.cs | 9 ------- .../Hosting/Orchard.Web/Web.config | 1 + src/Orchard.Specs/Hosting/WebHost.cs | 24 +++++++++++++++++++ src/Orchard.Specs/Util/PathExtensions.cs | 7 ++++++ 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs index f7d7e61e2..b3d53d0ca 100644 --- a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs +++ b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs @@ -16,15 +16,16 @@ namespace Orchard.Specs.Bindings { var webApp = Binding(); webApp.GivenIHaveACleanSiteWith(TableData( - new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Themes, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Tags, TinyMce" }, - new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Scheduling, Settings, XmlRpc" }, + new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Themes, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Tags, TinyMce" }, + new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, PublishLater, Routable, Scheduling, Settings, XmlRpc" }, new { extension = "theme", names = "SafeMode, Classic" })); webApp.WhenIGoTo("Setup"); webApp.WhenIFillIn(TableData( new { name = "SiteName", value = "My Site" }, - new { name = "AdminPassword", value = "6655321" })); + new { name = "AdminPassword", value = "6655321" }, + new { name = "ConfirmPassword", value = "6655321" })); webApp.WhenIHit("Finish Setup"); } diff --git a/src/Orchard.Specs/Bindings/WebAppHosting.cs b/src/Orchard.Specs/Bindings/WebAppHosting.cs index 622bc5eef..d05ebe5e8 100644 --- a/src/Orchard.Specs/Bindings/WebAppHosting.cs +++ b/src/Orchard.Specs/Bindings/WebAppHosting.cs @@ -1,22 +1,13 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; using System.IO; using System.Linq; -using System.Reflection; -using System.Runtime.Remoting; -using System.Web; -using System.Web.Hosting; -using System.Xml.Linq; using Castle.Core.Logging; using HtmlAgilityPack; using log4net.Appender; using log4net.Core; -using log4net.Repository; using NUnit.Framework; using Orchard.Specs.Hosting; -using Orchard.Specs.Util; using TechTalk.SpecFlow; namespace Orchard.Specs.Bindings { diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index e639d249e..511702cc2 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -202,6 +202,7 @@ + diff --git a/src/Orchard.Specs/Hosting/WebHost.cs b/src/Orchard.Specs/Hosting/WebHost.cs index 0ddb11405..50bd0ac7f 100644 --- a/src/Orchard.Specs/Hosting/WebHost.cs +++ b/src/Orchard.Specs/Hosting/WebHost.cs @@ -31,6 +31,19 @@ namespace Orchard.Specs.Hosting { .ShallowCopy("*.dll", _tempSite.Combine("bin")) .ShallowCopy("*.pdb", _tempSite.Combine("bin")); + // Copy SqlCe binaries + if (_orchardWebPath.Combine("bin").Combine("x86").IsDirectory) { + _orchardWebPath.Combine("bin").Combine("x86") + .ShallowCopy("*.dll", _tempSite.Combine("bin").Combine("x86")) + .ShallowCopy("*.pdb", _tempSite.Combine("bin").Combine("x86")); + } + + if (_orchardWebPath.Combine("bin").Combine("amd64").IsDirectory) { + _orchardWebPath.Combine("bin").Combine("amd64") + .ShallowCopy("*.dll", _tempSite.Combine("bin").Combine("amd64")) + .ShallowCopy("*.pdb", _tempSite.Combine("bin").Combine("amd64")); + } + baseDir .ShallowCopy("*.dll", _tempSite.Combine("bin")) .ShallowCopy("*.exe", _tempSite.Combine("bin")) @@ -54,7 +67,18 @@ namespace Orchard.Specs.Hosting { public void CopyExtension(string extensionFolder, string extensionName) { var sourceModule = _orchardWebPath.Combine(extensionFolder).Combine(extensionName); var targetModule = _tempSite.Combine(extensionFolder).Combine(extensionName); + sourceModule.ShallowCopy("*.txt", targetModule); + + //sourceModule.ShallowCopy("*.csproj", targetModule); + //sourceModule.DeepCopy("*.cs", targetModule); + + if (sourceModule.Combine("bin").IsDirectory) { + sourceModule.Combine("bin").ShallowCopy("*.dll", targetModule.Combine("bin")); + sourceModule.Combine("bin").ShallowCopy("*.exe", targetModule.Combine("bin")); + sourceModule.Combine("bin").ShallowCopy("*.pdb", targetModule.Combine("bin")); + } + if (sourceModule.Combine("Views").IsDirectory) sourceModule.Combine("Views").DeepCopy(targetModule.Combine("Views")); } diff --git a/src/Orchard.Specs/Util/PathExtensions.cs b/src/Orchard.Specs/Util/PathExtensions.cs index f15afc5b7..df369adfd 100644 --- a/src/Orchard.Specs/Util/PathExtensions.cs +++ b/src/Orchard.Specs/Util/PathExtensions.cs @@ -21,6 +21,13 @@ namespace Orchard.Specs.Util { return sourcePath; } + public static Path DeepCopy(this Path sourcePath, string pattern, Path targetPath) { + sourcePath + .GetFiles(pattern, true /*recursive*/) + .ForEach(file => FileCopy(sourcePath, targetPath, file)); + return sourcePath; + } + public static Path ShallowCopy(this Path sourcePath, string pattern, Path targetPath) { sourcePath .GetFiles(pattern, false /*recursive*/)