public override void Process(IInstanceResourceContext data, ITestOutputContext output)
        {
            Assert.ArgumentNotNull(data, nameof(data));

            var ecmVersion = EcmHelper.GetEcmVersion(data);

            if (ecmVersion == null)
            {
                return;
            }

            if (ecmVersion.Major == 3 && ecmVersion.Minor >= 3)
            {
                Error(data, output, "exm.web");
                Error(data, output, "EXM.CryptographicKey");
                Error(data, output, "EXM.AuthenticationKey");

                if (data.Databases.ConnectionStrings.ContainsKey("master"))
                {
                    Error(data, output, "exm.master");
                }

                if (data.ServerRoles.Contains(ServerRole.ContentDelivery) &&
                    !data.ServerRoles.Contains(ServerRole.ContentManagement))
                {
                    Error(data, output, "EXM.InternalApiKey");
                    Error(data, output, "EmailCampaignClientService");
                }

                return;
            }

            if (!data.ServerRoles.Contains(ServerRole.ContentManagement))
            {
                return;
            }

            if (ecmVersion.Major == 3 && ecmVersion.Minor >= 1)
            {
                if (!data.Databases.Sql.DatabaseNames.Contains("exm.dispatch"))
                {
                    output.Error(GetErrorMessage("exm.dispatch"));
                }
            }

            if (ecmVersion.Major == 2 && ecmVersion.Minor == 2 || ecmVersion.Major == 3 && ecmVersion.Minor == 0)
            {
                if (!data.Databases.Mongo.DatabaseNames.Contains("ecm.dispatch"))
                {
                    output.Error(GetErrorMessage("ecm.dispatch"));
                }
            }
        }
        public override void Process(IInstanceResourceContext data, ITestOutputContext output)
        {
            Assert.ArgumentNotNull(data, nameof(data));

            var ecmVersion = EcmHelper.GetEcmVersion(data);

            if (ecmVersion == null || ecmVersion.Major != 3 || ecmVersion.Minor != 1)
            {
                return;
            }

            var logs       = data.Logs.GetSitecoreLogEntries(LogLevel.Error);
            var errorFound = logs.Any(entry => entry.Exception.Message.Contains("Could not load type 'Sitecore.Modules.EmailCampaign.Layouts.SubscriptionForm'"));

            if (errorFound)
            {
                Report(output);
            }
        }
Example #3
0
        /// <inheritdoc />
        public override bool IsActual(IReadOnlyCollection <ServerRole> roles, ISitecoreVersion sitecoreVersion, IInstanceResourceContext data)
        {
            if (EcmHelper.GetEcmVersion(data) == null)
            {
                return(false);
            }

            try
            {
                if (data.SitecoreInfo.Configuration.SelectSingleElement("/configuration/sitecore/TypeResolver") == null)
                {
                    return(false);
                }
            }
            catch
            {
                // ignored
            }

            return(true);
        }
        public override void Process(IInstanceResourceContext data, ITestOutputContext output)
        {
            Assert.ArgumentNotNull(data, nameof(data));

            var ecmVersion = EcmHelper.GetEcmVersion(data);

            Assert.IsNotNull(ecmVersion);

            var majorMinor = ecmVersion.MajorMinorInt;

            if (majorMinor >= 31)
            {
                var httpHandlersNode = data.SitecoreInfo.Configuration.SelectSingleNode($"/configuration/system.web/httpHandlers/add[@path='{ecmSpeakHandlerPath}']");
                if (httpHandlersNode != null)
                {
                    output.Warning(GetErrorMessage("<httpHandlers>", false));
                }
                var handlersNode = data.SitecoreInfo.Configuration.SelectSingleNode($"/configuration/system.webSerber/handlers/add[@path='{ecmSpeakHandlerPath}']");
                if (handlersNode != null)
                {
                    output.Warning(GetErrorMessage("<handlers>", false));
                }
            }
            if (majorMinor == 22 || majorMinor == 30)
            {
                var httpHandlersNode = data.SitecoreInfo.Configuration.SelectSingleNode($"/configuration/system.web/httpHandlers/add[@path='{ecmSpeakHandlerPath}']");
                if (httpHandlersNode == null)
                {
                    output.Warning(GetErrorMessage("<httpHandlers>", true));
                }
                var handlersNode = data.SitecoreInfo.Configuration.SelectSingleNode($"/configuration/system.webSerber/handlers/add[@path='{ecmSpeakHandlerPath}']");
                if (handlersNode == null)
                {
                    output.Warning(GetErrorMessage("<handlers>", true));
                }
            }
        }
 protected override bool IsActual(IInstanceResourceContext data)
 {
     return(EcmHelper.GetEcmVersion(data) != null);
 }
        protected override bool IsActual(IInstanceResourceContext data)
        {
            var exmMajor = EcmHelper.GetEcmVersion(data)?.Major;

            return(exmMajor == 3 || exmMajor == 2);
        }