Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r7b3e9e5b2cf26281211e73384cd0369d93645637 -rd8ce6087cbb9ded36a8c93263ef345c2983ba27e --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 7b3e9e5b2cf26281211e73384cd0369d93645637) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision d8ce6087cbb9ded36a8c93263ef345c2983ba27e) @@ -28,7 +28,6 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Controls.TreeView; using Core.Common.Controls.Views; using Core.Common.Util; @@ -41,7 +40,6 @@ using Core.Gui.Forms.ViewHost; using Core.Gui.Helpers; using Core.Gui.Plugin; -using log4net; using Riskeer.AssemblyTool.Data; using Riskeer.Common.Data; using Riskeer.Common.Data.AssemblyTool; @@ -63,7 +61,6 @@ using Riskeer.Common.Forms.Views; using Riskeer.Common.IO.FileImporters; using Riskeer.Common.IO.FileImporters.MessageProviders; -using Riskeer.Common.IO.HydraRing; using Riskeer.Common.IO.ReferenceLines; using Riskeer.Common.Plugin; using Riskeer.Common.Plugin.FileImporters; @@ -129,8 +126,6 @@ /// public class RiskeerPlugin : PluginBase { - private static readonly ILog log = LogManager.GetLogger(typeof(PluginBase)); - private static readonly FontFamily fontFamily = new FontFamily( new Uri($"{PackUriHelper.UriSchemePack}://application:,,,/Riskeer.Integration.Plugin;component/Resources/"), "./#Symbols"); @@ -147,7 +142,6 @@ { if (base.Gui != null) { - base.Gui.ProjectOpened -= VerifyHydraulicBoundaryDatabasePath; base.Gui.ViewHost.ViewOpened -= OnViewOpened; base.Gui.ViewHost.ViewClosed -= OnViewClosed; } @@ -156,7 +150,6 @@ if (value != null) { - value.ProjectOpened += VerifyHydraulicBoundaryDatabasePath; base.Gui.ViewHost.ViewOpened += OnViewOpened; base.Gui.ViewHost.ViewClosed += OnViewClosed; } @@ -1196,31 +1189,6 @@ }; } - private static void VerifyHydraulicBoundaryDatabasePath(IProject project) - { - var riskeerProject = project as RiskeerProject; - if (riskeerProject == null) - { - return; - } - - AssessmentSection assessmentSection = riskeerProject.AssessmentSection; - if (assessmentSection.HydraulicBoundaryData.IsLinked()) - { - string validationProblem = HydraulicBoundaryDataHelper.ValidateFilesForCalculation( - assessmentSection.HydraulicBoundaryData.FilePath, - assessmentSection.HydraulicBoundaryData.HydraulicLocationConfigurationDatabase.FilePath, - assessmentSection.HydraulicBoundaryData.HydraulicLocationConfigurationDatabase.UsePreprocessorClosure); - - if (validationProblem != null) - { - log.WarnFormat( - RiskeerCommonServiceResources.Hydraulic_boundary_database_connection_failed_0_, - validationProblem); - } - } - } - private void OnViewOpened(object sender, ViewChangeEventArgs e) { IEnumerable observers = Enumerable.Empty(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs =================================================================== diff -u -rbd9857561de05958b06f90ef92f317415d568d9d -rd8ce6087cbb9ded36a8c93263ef345c2983ba27e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision bd9857561de05958b06f90ef92f317415d568d9d) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision d8ce6087cbb9ded36a8c93263ef345c2983ba27e) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading; using System.Windows.Media; @@ -108,90 +107,6 @@ } [Test] - [Apartment(ApartmentState.STA)] - public void GivenPluginWithGuiSet_WhenProjectOnGuiChangesToProjectWithHydraulicBoundaryDatabaseLinkedToExistingLocation_ThenNoWarning() - { - // Given - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - mocks.ReplayAll(); - - string testDataDir = TestHelper.GetTestDataPath(TestDataPath.Riskeer.Common.IO, nameof(HydraulicBoundaryData)); - string hrdFilePath = Path.Combine(testDataDir, "complete.sqlite"); - string hlcdFilePath = Path.Combine(testDataDir, "hlcd.sqlite"); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, new RiskeerProjectFactory(() => null), new GuiCoreSettings())) - { - SetPlugins(gui); - gui.Run(); - - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) - { - HydraulicBoundaryData = - { - FilePath = hrdFilePath, - HydraulicLocationConfigurationDatabase = - { - FilePath = hlcdFilePath - } - } - }; - - var project = new RiskeerProject(assessmentSection); - - // When - void Action() => gui.SetProject(project, null); - - // Then - TestHelper.AssertLogMessagesCount(Action, 0); - } - - mocks.VerifyAll(); - Dispatcher.CurrentDispatcher.InvokeShutdown(); - } - - [Test] - [Apartment(ApartmentState.STA)] - public void GivenPluginWithGuiSet_WhenProjectOnGuiChangesToProjectWithHydraulicBoundaryDatabaseLinkedToNonExistingLocation_ThenWarning() - { - // Given - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - mocks.ReplayAll(); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, new RiskeerProjectFactory(() => null), new GuiCoreSettings())) - { - SetPlugins(gui); - gui.Run(); - - const string nonExistingFile = "not_existing_file"; - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) - { - HydraulicBoundaryData = - { - FilePath = nonExistingFile - } - }; - var project = new RiskeerProject(assessmentSection); - - // When - void Action() => gui.SetProject(project, null); - - // Then - var fileMissingMessage = $"Fout bij het lezen van bestand '{nonExistingFile}': het bestand bestaat niet."; - string message = string.Format( - RiskeerCommonServiceResources.Hydraulic_boundary_database_connection_failed_0_, - fileMissingMessage); - TestHelper.AssertLogMessageWithLevelIsGenerated(Action, Tuple.Create(message, LogLevelConstant.Warn)); - } - - mocks.VerifyAll(); - Dispatcher.CurrentDispatcher.InvokeShutdown(); - } - - [Test] public void GetStateInfos_ReturnsSupportedStateInfos() { // Setup