Revert examine to use composers, until we have migrated that to .net standard

This commit is contained in:
Bjarke Berg
2021-04-27 07:35:47 +02:00
parent a4400f04a5
commit 80bd5257bc
8 changed files with 47 additions and 7 deletions

View File

@@ -6,7 +6,6 @@
/// <remarks>
/// <para>User composers compose after core composers, and before the final composer.</para>
/// </remarks>
[ComposeAfter(typeof(IComposer))]
public interface IUserComposer : IComposer
{ }
}

View File

@@ -0,0 +1,18 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Examine
{
// We want to run after core composers since we are replacing some items
public sealed class ExamineLuceneComposer :IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.AddExamineLucene();
}
}
}

View File

@@ -0,0 +1,17 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Examine
{
// examine's Lucene final composer composes after all user composers
// and *also* after ICoreComposer (in case IUserComposer is disabled)
[ComposeAfter(typeof(IUserComposer))]
public class ExamineLuceneFinalComposer : IComposer
{
public void Compose(IUmbracoBuilder builder) => builder.AddExamineIndexConfiguration();
}
}

View File

@@ -90,9 +90,13 @@ namespace Umbraco.Cms.Tests.Integration.Testing
s_firstTestInSession = false;
// Ensure CoreRuntime stopped (now it's a HostedService)
IHost host = Services.GetRequiredService<IHost>();
await host.StopAsync();
host.Dispose();
IHost host = Services?.GetService<IHost>();
if (host is not null)
{
await host.StopAsync();
host.Dispose();
}
}
[TearDown]

View File

@@ -52,7 +52,6 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
protected override void CustomTestSetup(IUmbracoBuilder builder)
{
builder.Services.AddUnique<IServerMessenger, ScopedRepositoryTests.LocalServerMessenger>();
// builder.AddCoreNotifications();
}
private void AssertJsonStartsWith(int id, string expected)

View File

@@ -464,6 +464,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Components
{
}
public class Composer4 : TestComposerBase
{
}
@@ -524,6 +525,8 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Components
{
}
[ComposeAfter(typeof(Composer2))]
[ComposeAfter(typeof(Composer4))]
public class Composer9 : TestComposerBase, ITestComposer
{
}

View File

@@ -298,7 +298,8 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
}
/**
* Based on the current state of the application, this configures the scope variables that control the main tree and language drop down
* Based on the current state of the application, this configures the scope variables that
* l the main tree and language drop down
*/
function configureTreeAndLanguages() {

View File

@@ -44,7 +44,6 @@ namespace Umbraco.Cms.Web.UI.NetCore
.AddBackOffice()
.AddWebsite()
.AddComposers()
.AddExamineIndexConfiguration()
.Build();
#pragma warning restore IDE0022 // Use expression body for methods