From 17878523609a8df301c994efaafa7ab2450ffd1c Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 2 Mar 2012 11:58:31 -0800 Subject: [PATCH] Monitoring provider will no longer throw on Ensure priority. Fix: Issue where an uncritical subsystem could crash the app. --- NzbDrone.App.Test/MonitoringProviderTest.cs | 20 ++++++++------ NzbDrone.App.Test/NzbDrone.App.Test.csproj | 3 +++ NzbDrone.App.Test/packages.config | 1 + .../media/images/Sorting icons.psd | Bin 27490 -> 0 bytes .../DataTables-1.9.0/media/images/favicon.ico | Bin 894 -> 0 bytes NzbDrone/Providers/MonitoringProvider.cs | 25 +++++++++++------- 6 files changed, 32 insertions(+), 17 deletions(-) delete mode 100644 NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd delete mode 100644 NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico diff --git a/NzbDrone.App.Test/MonitoringProviderTest.cs b/NzbDrone.App.Test/MonitoringProviderTest.cs index 5e23e898d..615d4101f 100644 --- a/NzbDrone.App.Test/MonitoringProviderTest.cs +++ b/NzbDrone.App.Test/MonitoringProviderTest.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Linq; using FizzWare.NBuilder; @@ -8,7 +9,6 @@ using NzbDrone.Common; using NzbDrone.Common.Model; using NzbDrone.Providers; using NzbDrone.Test.Common; -using NzbDrone.Test.Common.AutoMoq; namespace NzbDrone.App.Test { @@ -19,17 +19,21 @@ namespace NzbDrone.App.Test [Test] public void Ensure_priority_doesnt_fail_on_invalid_iis_proccess_id() { - var processMock = Mocker.GetMock(); - processMock.Setup(c => c.GetCurrentProcess()) + Mocker.GetMock().Setup(c => c.GetCurrentProcess()) .Returns(Builder.CreateNew().With(c => c.Priority == ProcessPriorityClass.Normal).Build()); - processMock.Setup(c => c.GetProcessById(It.IsAny())).Returns((ProcessInfo)null); + Mocker.GetMock().Setup(c => c.GetProcessById(It.IsAny())).Returns((ProcessInfo)null); - var subject = Mocker.Resolve(); + Mocker.Resolve().EnsurePriority(null); + } + [Test] + public void Ensure_should_log_warn_exception_rather_than_throw() + { + Mocker.GetMock().Setup(c => c.GetCurrentProcess()).Throws(); + Mocker.Resolve().EnsurePriority(null); - //Act - subject.EnsurePriority(null); + ExceptionVerification.ExpectedWarns(1); } diff --git a/NzbDrone.App.Test/NzbDrone.App.Test.csproj b/NzbDrone.App.Test/NzbDrone.App.Test.csproj index 136fe17a6..fa5e7c237 100644 --- a/NzbDrone.App.Test/NzbDrone.App.Test.csproj +++ b/NzbDrone.App.Test/NzbDrone.App.Test.csproj @@ -46,6 +46,9 @@ ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll + + ..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll + False ..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll diff --git a/NzbDrone.App.Test/packages.config b/NzbDrone.App.Test/packages.config index 0cc98eebb..fc23577cf 100644 --- a/NzbDrone.App.Test/packages.config +++ b/NzbDrone.App.Test/packages.config @@ -4,5 +4,6 @@ + \ No newline at end of file diff --git a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd b/NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd deleted file mode 100644 index 53b2e06850767cb57c52b316f0b845b1a8e0ca0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27490 zcmeG^33yY*)^oGAX}T}$5K3uTx@2jaq_m}N($WHj(w42FkS4cnARAd|!3_{mfhUTH zY|1K#_&`w>abZmhao`qBLJ(pzsNq?Pf|62BSCWcgaLqBHCE&EOUv}>Xi$*(!wu`FiTD>VJ z{+AE7#EbO0ocN&`rQ%YHimuZaPq5Mz69!ajCydc5b@9D(1=$T*4MvNRwrfNUMuW+g z)sPdf(V461EPydOEnY-e>|=7`WvP->Ns2@wjn5T`M51h~t|qHoUF4F4R8D-I-EPTB zORKN1Ppy}wnys~I5~Wg^CYGj2r76IXVjFL=YZ_8awl0hkw;nZ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Oa^+9)txu4vRiw9mB+h)3)ib0{2Ra^EQK#(gXIKlZ>+Jx&IuVGyz1;4OHue)7zPeI zZxUW6!lP+4o}|Hj072p1eGKCoPb@xO}Z42v7m+^=r`>R0}K6X5@f9e;wf&uh#(`TaAm;T0=FiF9#P3r}d^9{1!{B ziqm6EW8B?_$-`!;@unNJ2E2RhW3QS9s|9e_MlCPA3y$9s@HTIl%QAflQ#`Q@ykSBr z9_Q?38L%w5?%Og#wYlCTqD^?*$JNF9T-L$w9zvuBo796%MC9KP8hA-E0Myb#d@T1M zEtDs9I)B@La_OKQW1AEK>QKpX=O%)i%s-SL|MQ79DhlmUUi#Rl<;h_aP zx97r~Mu$O!s4X5GGYslJsCegLSRi7KabUa(u>JX#DAg}Z*|Y? zVD0*Teixkg^MhgVe?=Q=Afvt0S;ad+pdAQRVW3G2?Y#qlIe3s0H#sl0!vLD|DR zqISayHM#Ko5I<~N*zDR2-`^cLUb^PWc!->AWwHKYd0TAcPzPY=)!HkCK$=U231X{2~oTgP@Nq&5v<}={o$mV#5d6m7{_io(VQCqambK- Y16@Zf7?Q8!JB-NJ(KYBs*Ff|C0Zg4MIsgCw diff --git a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico b/NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico deleted file mode 100644 index 6eeaa2a0d393190ce748107222d9a026f992e4a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 894 zcmZQzU<5(|0R|u`!H~hsz#zuJz@P!dKp_SNAO?xUfG{@$0|>*weY}F;x;`B~@Mg`jC-vo5%k$%{OoKy1zkdA+(K2o3 zEDKGQQ~gcX+N!TtEj1|9e2tL(rheJva*5dKY#gZsIRxM zB;!h75Wi?9l5?>z>S-`t`=OAFp5C?(007k>qM(bnVuyja#;c*qL9N z(Q%=@`f7d2?T&^wySIHjy#MKh?rZrO7i!Bt-@f(!@WDrwB`uD&)%Eqcd3o(gVV7ri zp6ji@(BF7(+uE0x&)(R!?s#YIg_7JW1=-KHZv1@s(DSxD9<^am-%+f#!uU}z9=j>5*%b{WE2`20#tutPWS1# zz4s39d~xOMwaqJzOl{rMU%#oo=xj&xyY1WF&71o?Hs-LOkAD^4SRbV?yXz(e#efNwKXpT1J^s+yE;1`KXoe5&f?1A$tYso}un=1c3AzCL>B&D=RpqN3i1hL&lnclP!D`u*G0#bsJv!oAH) z-rc|T`^Wdkrw?7(xb)_p%`Y#WdAn`Pvz+W#0Rbo6-Ha3zp1gPgjDkZ)k6Gz!@9D0( zG^hL4?)Be4zWep#`{$>RUhUoaq@wgyfd9*oU{6tz+SXQhl3284sj;T&{L=I*bGxt4 z@4vfX%A<*$FN^a&MMa!