From a7a030bad26f5c1fdb78fbde588dfeb9112518bb Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Fri, 30 Nov 2012 17:47:48 -0100 Subject: [PATCH] Adding a few known assembly types to the ignore list in the TypeFinder. Changing Migration test to use the Type and Attribute resolver. --- src/Umbraco.Core/TypeFinder.cs | 8 ++++++- .../Migrations/PluginManagerExtensions.cs | 5 +++-- src/Umbraco.Tests/Migrations/Stubs/Dummy.cs | 21 +++++++++++++++++++ src/Umbraco.Tests/Umbraco.Tests.csproj | 1 + 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 src/Umbraco.Tests/Migrations/Stubs/Dummy.cs diff --git a/src/Umbraco.Core/TypeFinder.cs b/src/Umbraco.Core/TypeFinder.cs index 5178cce95d..48c3a4deeb 100644 --- a/src/Umbraco.Core/TypeFinder.cs +++ b/src/Umbraco.Core/TypeFinder.cs @@ -240,7 +240,13 @@ namespace Umbraco.Core "umbraco.webservices", "Lucene.", "Examine,", - "Examine." + "Examine.", + "ServiceStack.", + "MySql.", + "HtmlAgilityPack.", + "TidyNet.", + "ICSharpCode.", + "CookComputing." }; public static IEnumerable FindClassesOfTypeWithAttribute() diff --git a/src/Umbraco.Tests/Migrations/PluginManagerExtensions.cs b/src/Umbraco.Tests/Migrations/PluginManagerExtensions.cs index 9dd23bbb02..77b63703b0 100644 --- a/src/Umbraco.Tests/Migrations/PluginManagerExtensions.cs +++ b/src/Umbraco.Tests/Migrations/PluginManagerExtensions.cs @@ -12,12 +12,13 @@ namespace Umbraco.Tests.Migrations { public static IEnumerable ResolveMigrationTypes(this PluginManager resolver) { - return resolver.ResolveTypes(); + return resolver.ResolveTypesWithAttribute(); } public static IEnumerable FindMigrations(this PluginManager resolver) { - return resolver.FindAndCreateInstances(); + var types = resolver.ResolveTypesWithAttribute(); + return resolver.CreateInstances(types); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs b/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs new file mode 100644 index 0000000000..3da848311c --- /dev/null +++ b/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs @@ -0,0 +1,21 @@ +using Umbraco.Core.Persistence.Migrations; + +namespace Umbraco.Tests.Migrations.Stubs +{ + /// + /// This is just a dummy class that is used to ensure that implementations + /// of IMigration is not found if it doesn't have the MigrationAttribute (like this class). + /// + public class Dummy : IMigration + { + public void Up() + { + throw new System.NotImplementedException(); + } + + public void Down() + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index f34db0a98b..0b86657215 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -137,6 +137,7 @@ +