Index: Application/Application.Ringtoets/Application.Ringtoets.csproj =================================================================== diff -u -reee6c7815d1e418eac38c1c552fb279c0887ef55 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Application/Application.Ringtoets/Application.Ringtoets.csproj (.../Application.Ringtoets.csproj) (revision eee6c7815d1e418eac38c1c552fb279c0887ef55) +++ Application/Application.Ringtoets/Application.Ringtoets.csproj (.../Application.Ringtoets.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -87,29 +87,11 @@ 3.5 - - - - - ..\..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.dll - - - ..\..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll - - - ..\..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.Themes.Expression.dll - - - ..\..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll - - - ..\..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll - @@ -141,18 +123,6 @@ {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} Core.Common.Utils - - {016dbd27-99bf-489a-81b5-50d66964bb90} - Core.GIS.GeoAPI.Extensions - - - {ffb69466-79de-466a-ada7-5c47c5c5ca3a} - Core.GIS.GeoAPI - - - {5770daa9-84e5-4770-af43-f6b815894368} - Core.GIS.NetTopologySuite - {c90b77da-e421-43cc-b82e-529651bc21ac} Core.Common.Version Index: Application/Application.Ringtoets/packages.config =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Application/Application.Ringtoets/packages.config (.../packages.config) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Application/Application.Ringtoets/packages.config (.../packages.config) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -1,7 +1,4 @@  - - - Index: Core/Common/src/Core.Common.Controls.Swf/Core.Common.Controls.Swf.csproj =================================================================== diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/src/Core.Common.Controls.Swf/Core.Common.Controls.Swf.csproj (.../Core.Common.Controls.Swf.csproj) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755) +++ Core/Common/src/Core.Common.Controls.Swf/Core.Common.Controls.Swf.csproj (.../Core.Common.Controls.Swf.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -397,9 +397,9 @@ - + {FFB69466-79DE-466A-ADA7-5C47C5C5CA3A} - Core.GIS.GeoApi + Core.GIS.GeoAPI {5770DAA9-84E5-4770-AF43-F6B815894368} Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj =================================================================== diff -u -reee6c7815d1e418eac38c1c552fb279c0887ef55 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision eee6c7815d1e418eac38c1c552fb279c0887ef55) +++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -265,7 +265,7 @@ {016DBD27-99BF-489A-81B5-50D66964BB90} - Core.GIS.GeoApi.Extensions + Core.GIS.GeoAPI.Extensions {A3C9DF74-978A-44B1-B55D-A72AC4221E3A} Index: Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj =================================================================== diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj (.../Core.Common.Base.Tests.csproj) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755) +++ Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj (.../Core.Common.Base.Tests.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -170,11 +170,11 @@ {016DBD27-99BF-489A-81B5-50D66964BB90} - Core.GIS.GeoApi.Extensions + Core.GIS.GeoAPI.Extensions {FFB69466-79DE-466A-ADA7-5C47C5C5CA3A} - Core.GIS.GeoApi + Core.GIS.GeoAPI {3DBD23CE-5C4A-4A49-B51C-B268CB2B510E} @@ -190,11 +190,11 @@ {A3C9DF74-978A-44B1-B55D-A72AC4221E3A} - SharpMap.Api + Core.GIS.SharpMap.Api {C83777FC-AABB-47D9-911F-D76255D4D541} - SharpMap + Core.GIS.SharpMap {EFA25023-CF6A-4FF7-8C42-B24D7F9509E1} Index: Core/Common/test/Core.Common.Integration.Tests/App.config =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/App.config (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/App.config (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,27 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/Core.Common.Integration.Tests.csproj =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/Core.Common.Integration.Tests.csproj (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/Core.Common.Integration.Tests.csproj (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,198 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A6A434E0-AE5A-4D5B-97D7-532B00FBDFE9} + Library + Properties + Core.Common.Integration.Tests + Core.Common.Integration.Tests + v4.0 + 512 + + + 3.5 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + True + + + true + bin\Debug\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE;DEBUG; + + + bin\Release\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE; + true + + + + ..\..\..\..\lib\log4net.dll + + + ..\..\..\..\lib\nunit.framework.dll + + + + + ..\..\..\..\lib\Rhino.Mocks.dll + + + ..\..\..\..\lib\SharpTestsEx.dll + + + + 3.5 + + + + + + + + + + + + + + + + {016DBD27-99BF-489A-81B5-50D66964BB90} + Core.GIS.GeoAPI.Extensions + + + {FFB69466-79DE-466A-ADA7-5C47C5C5CA3A} + Core.GIS.GeoAPI + + + {5770DAA9-84E5-4770-AF43-F6B815894368} + Core.GIS.NetTopologySuite + + + {a3c9df74-978a-44b1-b55d-a72ac4221e3a} + Core.GIS.SharpMap.Api + + + {dd1cc1db-4bf9-4c88-a100-733d84795f3a} + Core.GIS.SharpMap.UI + + + {c83777fc-aabb-47d9-911f-d76255d4d541} + Core.GIS.SharpMap + + + {93e73fab-fae8-49c6-9abb-27d24df761f6} + Core.Plugins.CommonTools.Gui + + + {befdcc44-2638-4972-b353-42d14c7da2c6} + Core.Plugins.CommonTools + + + {ed20dba9-d577-423f-a68d-a0a8130fb10b} + Core.Plugins.ProjectExplorer + + + {0bc3751e-ec42-40a0-a7d3-b7c2aa66976e} + Core.Plugins.SharpMapGis.Gui + + + {696daaee-d1d8-42d0-86ac-471b970fb17e} + Core.Plugins.SharpMapGis + + + {4A7D6720-4AA1-4F0B-A796-A0436DB3D7D7} + Application.Ringtoets + + + {3DBD23CE-5C4A-4A49-B51C-B268CB2B510E} + Core.Common.Controls.Swf + + + {9A2D67E6-26AC-4D17-B11A-2B4372F2F572} + Core.Common.Controls + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + + + {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} + Core.Common.Gui + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Utils + + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtils + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + lib\DeltaShell\DeltaShell.Plugins.Data.NHibernate + lib\Common\SharpMap.Extensions + lib\DeltaShell\DeltaShell.Plugins.NetCdf + lib\DeltaShell\DeltaShell.Plugins.Scripting + + + + + + + \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,331 @@ +using System; +using System.Threading; +using Core.Common.Base.Workflow; +using Core.Common.Gui; +using Core.Common.TestUtils; +using Core.GIS.SharpMap.Map; +using Core.Plugins.CommonTools; +using Core.Plugins.CommonTools.Gui; +using Core.Plugins.ProjectExplorer; +using Core.Plugins.SharpMapGis; +using Core.Plugins.SharpMapGis.Gui; +using log4net; +using NUnit.Framework; +using Rhino.Mocks; +using SharpTestsEx; +using Control = System.Windows.Controls.Control; + +namespace Core.Common.Integration.Tests.DeltaShell.Application.Ringtoets +{ + [TestFixture] + public class DeltaShellGuiIntegrationTest + { + private readonly MockRepository mocks = new MockRepository(); + private static readonly ILog log = LogManager.GetLogger(typeof(DeltaShellGuiIntegrationTest)); + + [SetUp] + public void SetUp() + { + LogHelper.ResetLogging(); + } + + [Test] + public void DeleteProjectDataDirectoryShouldNotThrowExceptionOnNewProjectAndShouldNotHang() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new CommonToolsApplicationPlugin()); + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); + + gui.CommandHandler.TryCreateNewWTIProject(); + gui.CommandHandler.TryCreateNewWTIProject(); + } + } + + [Test] + [Ignore("potentially hangs")] + public void RunManyActivitiesCancelCheckForThreadingIssuesTools9791() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + gui.Run(); + + Action onShown = delegate + { + var smallActivity = new TestActivity2(); + + for (int i = 0; i < 1000; i++) + { + app.RunActivityInBackground(smallActivity); + + // cancel + while (!app.IsActivityRunning()) + { + Thread.Sleep(1); + } + app.ActivityRunner.CancelAll(); + while (app.IsActivityRunning()) + { + System.Windows.Forms.Application.DoEvents(); + } + } + }; + WpfTestHelper.ShowModal((Control) gui.MainWindow, onShown); + } + } + + [Test] + public void ProgressDialogIsModal() + { + if (!Environment.UserInteractive) + { + return; //progress dialog stuff isn't processed on non-interactive environment (see DeltaShellGui::UpdateProgressDialog) + } + + if (GuiTestHelper.IsBuildServer) + { + return; // bleh (fails if users log in etc..) + } + + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new CommonToolsApplicationPlugin()); + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); + + var mainWindow = (Control) gui.MainWindow; + Action onShown = delegate + { + var testActivity = new TestActivity(); + gui.Application.ActivityRunner.Enqueue(testActivity); + try + { + while (!gui.Application.ActivityRunner.IsRunningActivity(testActivity)) + { + Thread.Sleep(0); + } + + System.Windows.Forms.Application.DoEvents(); + + Assert.IsFalse(mainWindow.IsEnabled); + } + finally + { + testActivity.Done = true; + } + + while (gui.Application.ActivityRunner.IsRunningActivity(testActivity)) + { + Thread.Sleep(0); + } + + System.Windows.Forms.Application.DoEvents(); + + Assert.IsTrue(mainWindow.IsEnabled); + }; + + WpfTestHelper.ShowModal(mainWindow, onShown); + } + } + + [Test] + public void ClosingEmptyProjectShouldNotGiveException() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + app.Plugins.Add(new CommonToolsApplicationPlugin()); + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); + + gui.CommandHandler.TryCloseWTIProject(); //should not trigger exception + } + } + + [Test] + public void StartGuiWithToolboxDoesNotCrash() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new CommonToolsApplicationPlugin()); + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + + gui.Run(); + } + } + + [Test] + public void StartWithCommonPluginsShouldBeFast() + { + TestHelper.AssertIsFasterThan(7500, StartWithCommonPlugins); + } + + [Test] + public void CreateNewProjectAfterStartWithCommonPluginsShouldBeFast() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + app.Plugins.Add(new CommonToolsApplicationPlugin()); + gui.Plugins.Add(new SharpMapGisGuiPlugin()); + gui.Plugins.Add(new CommonToolsGuiPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + + gui.Run(); + + Action onShown = () => TestHelper.AssertIsFasterThan(300, gui.Application.CreateNewProject); + + WpfTestHelper.ShowModal((Control) gui.MainWindow, onShown); + } + } + + [Test] + public void ExitShouldBeFast() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new CommonToolsApplicationPlugin()); + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + + gui.Run(); + + app.UserSettings["autosaveWindowLayout"] = false; // skip damagin of window layout + + gui.MainWindow.Show(); + + for (int i = 0; i < 20; i++) + { + var map = new Map(); + app.Project.Items.Add(map); + gui.CommandHandler.OpenView(map); + } + app.SaveProjectAs(TestHelper.GetCurrentMethodName() + ".dsproj"); + + TestHelper.AssertIsFasterThan(200, gui.Exit); + } + } + + [Test] + public void GuiSelectionIsSetToProjectAfterStartWithProjectExplorer() + { + // initialize + using (var gui = new DeltaShellGui()) + { + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); + + gui.Selection.Should().Be.EqualTo(gui.Application.Project); + } + } + + [Test] + public void FormActionIsRunForMainWindow() + { + //testing testhelper + visible changed event of mainwindow. + //could be tested separately but the combination is vital to many tests. That's why this test is here. + using (var gui = new DeltaShellGui()) + { + gui.Run(); + int callCount = 0; + WpfTestHelper.ShowModal((Control) gui.MainWindow, () => callCount++); + Assert.AreEqual(1, callCount); + } + } + + private class TestActivity2 : Activity + { + private bool shouldCancel; + + public override void Execute() + { + if (shouldCancel) + { + Status = ActivityStatus.Cancelled; + shouldCancel = false; + return; + } + + base.Execute(); + } + + public override void Cancel() + { + shouldCancel = true; + } + + protected override void OnInitialize() {} + + protected override void OnExecute() + { + Thread.Sleep(100); + } + + protected override void OnCancel() + { + throw new NotImplementedException(); + } + + protected override void OnCleanUp() + { + shouldCancel = false; + } + + protected override void OnFinish() {} + } + + private class TestActivity : Activity + { + public bool Done { get; set; } + + protected override void OnInitialize() + { + while (!Done) + { + Thread.Sleep(0); + } + + Status = ActivityStatus.Done; + } + + protected override void OnExecute() {} + + protected override void OnCancel() {} + + protected override void OnCleanUp() {} + + protected override void OnFinish() {} + } + + private static void StartWithCommonPlugins() + { + using (var gui = new DeltaShellGui()) + { + var app = gui.Application; + + app.Plugins.Add(new SharpMapGisApplicationPlugin()); + app.Plugins.Add(new CommonToolsApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + + gui.Run(); + + WpfTestHelper.ShowModal((Control) gui.MainWindow); + } + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/GuiImportHandlerTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/GuiImportHandlerTest.cs (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Application.Ringtoets/GuiImportHandlerTest.cs (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,318 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base; +using Core.Common.Controls.Swf; +using Core.Common.Gui; +using Core.Common.TestUtils; +using Core.Plugins.CommonTools; +using Core.Plugins.SharpMapGis; +using log4net.Core; +using NUnit.Framework; +using Rhino.Mocks; +using MessageBox = Core.Common.Controls.Swf.MessageBox; + +namespace Core.Common.Integration.Tests.DeltaShell.Application.Ringtoets +{ + [TestFixture] + public class GuiImportHandlerTest + { + private MockRepository mocks; + private IGui gui; + private IApplication realApp; + + private readonly ApplicationPlugin commonToolsPlugin = new CommonToolsApplicationPlugin(); + + [SetUp] + public void SetUp() + { + LogHelper.SetLoggingLevel(Level.Error); + + mocks = new MockRepository(); + + gui = mocks.Stub(); + + realApp = new DeltaShellApplication(); + realApp.Plugins.Add(commonToolsPlugin); + realApp.Plugins.Add(new SharpMapGisApplicationPlugin()); + realApp.Run(); + + gui.Application = realApp; + } + + [TearDown] + public void TearDown() + { + realApp.Dispose(); + } + + [Test] + public void NoImporterAvailableGivesMessageBox() //are we even interested in this? + { + var messageBox = mocks.StrictMock(); + MessageBox.CustomMessageBox = messageBox; + messageBox.Expect(mb => mb.Show(null, null, MessageBoxButtons.OK)).Return(DialogResult.OK).IgnoreArguments() + .Repeat.Once(); + messageBox.Replay(); + + var importHandler = new GuiImportHandler(gui); + + var item = importHandler.GetSupportedImporterForTargetType(typeof(Int64)); + + Assert.IsNull(item); + + messageBox.VerifyAllExpectations(); + } + + [Test] + public void FileFilteringWorks() + { + var application = mocks.Stub(); + var fileImporter = mocks.Stub(); + var targetItemImporter = mocks.Stub(); + var plugin = mocks.Stub(); + + application.Stub(a => a.Plugins).Return(new[] + { + plugin + }); + application.Stub(a => a.ProjectFilePath).Return(Directory.GetCurrentDirectory()).Repeat.Any(); + gui.Application = application; + + IEnumerable importers = new[] + { + targetItemImporter, + fileImporter + }; + + fileImporter.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }).Repeat.Any(); + fileImporter.Expect(fi => fi.FileFilter).Return("known|*.bla").Repeat.Any(); + fileImporter.Expect(fi => fi.Name).Return("1").Repeat.Any(); + fileImporter.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + targetItemImporter.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }).Repeat.Any(); + targetItemImporter.Expect(fi => fi.FileFilter).Return("known|*.ext").Repeat.Any(); + targetItemImporter.Expect(fi => fi.Name).Return("2").Repeat.Any(); + targetItemImporter.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + application.Expect(a => a.FileImporters).IgnoreArguments().Repeat.Any().Return(importers); + + mocks.ReplayAll(); + + var guiImportHandler = new GuiImportHandler(gui); + + var one = (long) 1.0; + var returnedImporter1 = guiImportHandler.GetSupportedImporterForTargetTypeAndSelectedFiles(one, new[] + { + "testfile.ext" + }); + + Assert.AreEqual(targetItemImporter, returnedImporter1); + + var two = (long) 2.0; + var returnedImporter2 = guiImportHandler.GetSupportedImporterForTargetTypeAndSelectedFiles(two, new[] + { + "testfile.unknown" + }); + + Assert.IsNull(returnedImporter2); + + mocks.VerifyAll(); + } + + [Test] + public void NonRootLevelImportersAreNotReturnedForNullType() + { + var application = mocks.Stub(); + var fileImporter = mocks.Stub(); + var targetItemImporter = mocks.Stub(); + var targetItemImporter2 = mocks.Stub(); + var plugin = mocks.Stub(); + + application.Stub(a => a.Plugins).Return(new[] + { + plugin + }); + application.Stub(a => a.ProjectFilePath).Return(Directory.GetCurrentDirectory()).Repeat.Any(); + gui.Application = application; + + IEnumerable importers = new[] + { + fileImporter, + targetItemImporter, + targetItemImporter2 + }; + + fileImporter.Expect(fi => fi.CanImportOnRootLevel).Return(false); + targetItemImporter.Expect(fi => fi.CanImportOnRootLevel).Return(false); + targetItemImporter2.Expect(fi => fi.CanImportOnRootLevel).Return(true); + + application.Expect(a => a.FileImporters).IgnoreArguments().Repeat.Any().Return(importers); + + mocks.ReplayAll(); + + var guiImportHandler = new GuiImportHandler(gui); + + var fileImporters = guiImportHandler.GetImporters(null); + + Assert.AreEqual(1, fileImporters.Count); + Assert.AreSame(targetItemImporter2, fileImporters.First()); + + mocks.VerifyAll(); + } + + [Test] + public void TargetItemFileImporterAreReturnedWhenMatch() + { + var application = mocks.Stub(); + var fileImporter = mocks.Stub(); + var targetItemImporter = mocks.Stub(); + var targetItemImporterWhereCanImportIsFalse = mocks.Stub(); + application.Stub(a => a.ProjectFilePath).Return(Directory.GetCurrentDirectory()).Repeat.Any(); + gui.Application = application; + + IEnumerable importers = new[] + { + fileImporter, + targetItemImporter, + targetItemImporterWhereCanImportIsFalse + }; + + fileImporter.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }); + fileImporter.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + targetItemImporter.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }); + targetItemImporter.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + targetItemImporterWhereCanImportIsFalse.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }); + targetItemImporterWhereCanImportIsFalse.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(false).Repeat.Any(); + + application.Expect(a => a.FileImporters).IgnoreArguments().Repeat.Any().Return(importers); + + mocks.ReplayAll(); + + var guiImportHandler = new GuiImportHandler(gui); + + var fileImporters = guiImportHandler.GetImporters((long) 1.0); + + Assert.AreEqual(2, fileImporters.Count); + + mocks.VerifyAll(); + } + + [Test] + public void TargetItemFileImporterCanMatchOnSubtype() + { + //test verifies that an importer for type A matches on type B if B implements A + + var application = mocks.Stub(); + var targetItemImporter = mocks.Stub(); + var plugin = mocks.Stub(); + + application.Stub(a => a.Plugins).Return(new[] + { + plugin + }); + application.Stub(a => a.ProjectFilePath).Return(Directory.GetCurrentDirectory()).Repeat.Any(); + + gui.Application = application; + + IEnumerable importers = new[] + { + targetItemImporter + }; + + targetItemImporter.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(IList) + }); + targetItemImporter.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + application.Expect(a => a.FileImporters).IgnoreArguments().Repeat.Any().Return(importers); + + mocks.ReplayAll(); + + var guiImportHandler = new GuiImportHandler(gui); + + //get importers for subtype + var fileImporters = guiImportHandler.GetImporters(new List()); + + Assert.AreEqual(new[] + { + targetItemImporter + }, fileImporters); + + mocks.VerifyAll(); + } + + [Test] + public void AllPluginsAreSearchedForFileImportersAndOnlyMatchingImportersAreReturned() + { + var application = mocks.Stub(); + var fileImporter1 = mocks.Stub(); + var fileImporter2 = mocks.Stub(); + var fileImporter3 = mocks.Stub(); + var plugin1 = mocks.Stub(); + + application.Stub(a => a.Plugins).Return(new[] + { + plugin1 + }); + application.Stub(a => a.ProjectFilePath).Return(Directory.GetCurrentDirectory()).Repeat.Any(); + gui.Application = application; + + IEnumerable importers = new[] + { + fileImporter1, + fileImporter2, + fileImporter3 + }; + + fileImporter1.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int32) + }); + fileImporter2.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int64) + }); + fileImporter3.Expect(fi => fi.SupportedItemTypes).Return(new[] + { + typeof(Int16) + }); + + fileImporter1.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + fileImporter2.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + fileImporter3.Expect(fi => fi.CanImportOn(null)).IgnoreArguments().Return(true).Repeat.Any(); + + application.Expect(a => a.FileImporters).Repeat.Any().Return(importers).Repeat.Once(); + + mocks.ReplayAll(); + + var guiImportHandler = new GuiImportHandler(gui); + + var fileImporters = guiImportHandler.GetImporters((long) 1.0); + + Assert.AreEqual(1, fileImporters.Count); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Common.Core/DelftShellApplicationIntegrationTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Common.Core/DelftShellApplicationIntegrationTest.cs (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/DeltaShell/Common.Core/DelftShellApplicationIntegrationTest.cs (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,44 @@ +using System.Threading; +using Core.Common.Base; +using Core.Common.Base.Workflow; +using NUnit.Framework; + +namespace Core.Common.Integration.Tests.DeltaShell.Common.Core +{ + [TestFixture] + public class DeltaShellApplicationIntegrationTest + { + [Test] + public void RunManyActivitiesCheckForThreadingIssues() + { + var smallActivity = new SmallActivity(); + using (var app = new DeltaShellApplication + { + WaitMethod = System.Windows.Forms.Application.DoEvents + }) + { + for (int i = 0; i < 2000; i++) + { + app.RunActivity(smallActivity); + } + } + } + + private class SmallActivity : Activity + { + protected override void OnInitialize() {} + + protected override void OnExecute() + { + Thread.Sleep(2); + Status = ActivityStatus.Done; + } + + protected override void OnCancel() {} + + protected override void OnCleanUp() {} + + protected override void OnFinish() {} + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/Properties/AssemblyInfo.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/Properties/AssemblyInfo.cs (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/Properties/AssemblyInfo.cs (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,16 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using NUnit.Framework; + +[assembly: AssemblyTitle("Core.Common.Integration.Tests")] +[assembly: AssemblyProduct("Core.Common.Integration.Tests")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4a1c7014-8890-4030-a00e-24b8895caf67")] + +[assembly: RequiresSTA] \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/packages.config =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/packages.config (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/packages.config (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,4 @@ + + + + \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/test-data/.gitattributes =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/test-data/.gitattributes (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/test-data/.gitattributes (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1 @@ +*.nc filter=lfs diff=lfs merge=lfs -text \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/test-data/BigGrid.nc =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/test-data/BigGrid.nc (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/test-data/BigGrid.nc (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a085534fbff388554b234c6cce344073e4ef1d88c82a664e88a9397a4f3bc798 +size 128064848 Index: Core/Common/test/Core.Common.Integration.Tests/test-data/GDAL/1.bil =================================================================== diff -u Binary files differ Index: Core/Common/test/Core.Common.Integration.Tests/test-data/GDAL/1.hdr =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/test-data/GDAL/1.hdr (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/test-data/GDAL/1.hdr (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,16 @@ +BYTEORDER I +LAYOUT BIL +NROWS 3 +NCOLS 3 +NBANDS 1 +NBITS 32 +BANDROWBYTES 12 +TOTALROWBYTES 12 +BANDGAPBYTES 0 +SKIPBYTES 0 +ULXMAP 10 +ULYMAP 50 +XDIM 20 +YDIM 20 +NODATA -999 +PIXELTYPE FLOAT Index: Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/.gitattributes =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/.gitattributes (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/.gitattributes (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1 @@ +*.nc filter=lfs diff=lfs merge=lfs -text \ No newline at end of file Index: Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/NCEP-NAM-CONUS_80km_best.ncd.nc =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/NCEP-NAM-CONUS_80km_best.ncd.nc (revision 0) +++ Core/Common/test/Core.Common.Integration.Tests/test-data/NetCdf/NCEP-NAM-CONUS_80km_best.ncd.nc (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4e8959492a2526070a3228ca49c95aa8d938e55f6d04962747bed3427c132e0 +size 2544464 Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/App.config'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/Core.Common.IntegrationTests.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/DeltaShell/Application.Ringtoets/DeltaShellGuiIntegrationTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/DeltaShell/Application.Ringtoets/GuiImportHandlerTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/DeltaShell/Common.Core/DelftShellApplicationIntegrationTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/packages.config'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/test-data/.gitattributes'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/test-data/BigGrid.nc'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.IntegrationTests/test-data/GDAL/1.bil =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r8e258eec8318163d7ce452ffc0db1fab83f511c1 Binary files differ Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/test-data/GDAL/1.hdr'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/test-data/NetCdf/.gitattributes'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.IntegrationTests/test-data/NetCdf/NCEP-NAM-CONUS_80km_best.ncd.nc'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.TestUtils/Core.Common.TestUtils.csproj =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/test/Core.Common.TestUtils/Core.Common.TestUtils.csproj (.../Core.Common.TestUtils.csproj) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/test/Core.Common.TestUtils/Core.Common.TestUtils.csproj (.../Core.Common.TestUtils.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -123,9 +123,9 @@ {f49bd8b2-332a-4c91-a196-8cce0a2c7d98} Core.Common.Utils - + {FFB69466-79DE-466A-ADA7-5C47C5C5CA3A} - Core.GIS.GeoApi + Core.GIS.GeoAPI Index: Core/Common/uml/Core.Common.Controls.Swf.UML/ChartTools.cd =================================================================== diff -u -r79a816a478616907118e0d953a3bdd26a9c99af8 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/uml/Core.Common.Controls.Swf.UML/ChartTools.cd (.../ChartTools.cd) (revision 79a816a478616907118e0d953a3bdd26a9c99af8) +++ Core/Common/uml/Core.Common.Controls.Swf.UML/ChartTools.cd (.../ChartTools.cd) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -2,65 +2,38 @@ - - AECAAERABQAgAAAIAAAACAAACBAAAABAIAAAAECCACE= - Charting\Tools\AddPointTool.cs - + - - AAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Charting\Tools\ZoomUsingMouseWheelTool.cs - + - - AAEgAQAACIAAAIQAAACAQAAQABABAAAgIEAAQAAiAAE= - Charting\Tools\ChartViewSeriesToolBase.cs - + - - AEEAAAABECAAAAAACAAYSAAIBhAEUAAAIAEQIQOCAgE= - Charting\Tools\EditPointTool.cs - + - - AAAAAAAAAIAAAIAAAADAAAAAAAAAAAAgAAAAIAAAAIA= - Charting\Tools\ExportChartAsImageChartTool.cs - + - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAYAE= - Charting\Tools\PointEventArgs.cs - + - - AAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE= - Charting\Tools\SelectPointTool.cs - + - - AACACBQAAQAyiQIIBIAAyAAAAhCEQADABEAQAACCAgA= - Charting\Tools\SelectPointTool.cs - - - - + @@ -85,38 +58,23 @@ - - AAAAAAAAAIAAAIAAAACAAAAAAAAAAAAgAAAAAAAAAAA= - Charting\IChartViewTool.cs - + - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE= - Charting\IChartViewSeriesTool.cs - + - - AAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAA= - Charting\IChartViewContextMenuTool.cs - + - - AAAAAAAAAAAAAAAAAAAAAAAAAAggAgAAAAAAAAEAAAA= - Charting\Tools\SelectPointTool.cs - + - - - AAAAAAAAAAAAAAAAAAAAAAAQAAAAQAAAAAAAAAAAAAA= - Charting\Tools\PointEventArgs.cs - + + \ No newline at end of file Index: Core/Common/uml/Core.Common.Controls.Swf.UML/Core.Common.Controls.Swf.UML.csproj =================================================================== diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Core/Common/uml/Core.Common.Controls.Swf.UML/Core.Common.Controls.Swf.UML.csproj (.../Core.Common.Controls.Swf.UML.csproj) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755) +++ Core/Common/uml/Core.Common.Controls.Swf.UML/Core.Common.Controls.Swf.UML.csproj (.../Core.Common.Controls.Swf.UML.csproj) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -125,9 +125,6 @@ - - - + \ No newline at end of file Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.IntegrationTest/ImportSoilProfileFromDatabaseTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.IntegrationTest/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e258eec8318163d7ce452ffc0db1fab83f511c1 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.IntegrationTest/Ringtoets.Piping.IntegrationTest.csproj'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/uml/Ringtoets.Piping.UML/Properties/AssemblyInfo.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r8e258eec8318163d7ce452ffc0db1fab83f511c1 --- Ringtoets/Piping/uml/Ringtoets.Piping.UML/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Ringtoets/Piping/uml/Ringtoets.Piping.UML/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 8e258eec8318163d7ce452ffc0db1fab83f511c1) @@ -1,35 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UML")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("UML")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: AssemblyTitle("Ringtoets.Piping.UML")] +[assembly: AssemblyProduct("Ringtoets.Piping.UML")] [assembly: Guid("f7da5847-4d01-45be-a9c3-e18ef8af4755")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")]