From f2d7e3549d3b2e6ae5165e478887015f4a4016f8 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 4 Apr 2013 15:24:29 -0200 Subject: [PATCH] XmlPublishedCache - fix casting exception messages --- src/Umbraco.Tests/LibraryTests.cs | 4 ++-- .../PublishedCache/PublishedContentCacheTests.cs | 2 +- src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs | 2 +- src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs | 2 +- src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs | 2 +- src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs | 2 +- src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Tests/LibraryTests.cs b/src/Umbraco.Tests/LibraryTests.cs index 6f1f13faa1..4880d3e2cd 100644 --- a/src/Umbraco.Tests/LibraryTests.cs +++ b/src/Umbraco.Tests/LibraryTests.cs @@ -94,8 +94,8 @@ namespace Umbraco.Tests private string LegacyGetItem(int nodeId, string alias) { var cache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); - var umbracoXML = cache.GetXml(UmbracoContext.Current); // = UmbracoContext.Current.GetXml(); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); + var umbracoXML = cache.GetXml(UmbracoContext.Current); string xpath = UmbracoSettings.UseLegacyXmlSchema ? "./data [@alias='{0}']" : "./{0}"; if (umbracoXML.GetElementById(nodeId.ToString()) != null) diff --git a/src/Umbraco.Tests/PublishedCache/PublishedContentCacheTests.cs b/src/Umbraco.Tests/PublishedCache/PublishedContentCacheTests.cs index f1c5db3d24..76c822643a 100644 --- a/src/Umbraco.Tests/PublishedCache/PublishedContentCacheTests.cs +++ b/src/Umbraco.Tests/PublishedCache/PublishedContentCacheTests.cs @@ -101,7 +101,7 @@ namespace Umbraco.Tests.PublishedCache Umbraco.Core.Configuration.UmbracoSettings.UseLegacyXmlSchema = true; var cache = _umbracoContext.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); cache.GetXmlDelegate = (user, preview) => { diff --git a/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs b/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs index b000466a85..054d21b244 100644 --- a/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs +++ b/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs @@ -86,7 +86,7 @@ namespace Umbraco.Tests.PublishedContent var ctx = GetUmbracoContext("/test", 1234); var cache = ctx.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var node = new DynamicNode( new DynamicBackingItem( diff --git a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs index 9deaa12f7b..a64de740af 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs @@ -73,7 +73,7 @@ namespace Umbraco.Tests.Routing } var cache = routingContext.UmbracoContext.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); Assert.AreEqual(8, cachedRoutes.Count); diff --git a/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs b/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs index 4ee5868e77..b01fd43c55 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs @@ -316,7 +316,7 @@ namespace Umbraco.Tests.Routing ignore = routingContext.UrlProvider.GetUrl(1002, new Uri("http://domain2.com"), false); var cache = routingContext.UmbracoContext.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); Assert.AreEqual(7, cachedRoutes.Count); diff --git a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs index 3e1eb98d3e..3dcb84eca3 100644 --- a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs +++ b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs @@ -39,7 +39,7 @@ namespace Umbraco.Tests.Routing // check that the proper route has been cached var cache = routingContext.UmbracoContext.ContentCache.InnerCache as PublishedContentCache; - if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the legacy one is supported."); + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); Assert.AreEqual("10011/1001-1-1", cachedRoutes[100111]); diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs index fe65aa25e4..dd355562a8 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs @@ -86,7 +86,7 @@ namespace umbraco.presentation var umbracoContext = Umbraco.Web.UmbracoContext.Current; var cache = umbracoContext.ContentCache.InnerCache as Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache; if (cache == null) - throw new InvalidOperationException("ContentCache is not XmlPublishedCache.PublishedContentCache."); + throw new InvalidOperationException("Unsupported IPublishedContentCache, only the Xml one is supported."); return cache.GetXml(umbracoContext); }