Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideBishopGridTest.cs =================================================================== diff -u -r4219 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideBishopGridTest.cs (.../StabilityInsideBishopGridTest.cs) (revision 4219) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideBishopGridTest.cs (.../StabilityInsideBishopGridTest.cs) (revision 4220) @@ -70,8 +70,10 @@ public void CalculateStabilityInsideBishopGridUsingTestFilesHasExpectedResultsInOutputFile(int maxCores) { const double cTolerance = 0.0005; - GeneralHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, - output1AFilename, calculationParametersIntegrationFilename, + var generalHelper = new GeneralHelper(); + string testFileName = "CalculateStabilityInsideBishopGrid"+ maxCores; + generalHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, + output1AFilename, testFileName, calculationParametersIntegrationFilename, projectIntegrationFilename, out runner, out locations); //SetupStabilityProject(maxCores); runner.Initialize(); @@ -86,7 +88,7 @@ runner.Run(); runner.OutputTimeSeriesCollection.Save("BishopGridOutputFile" + maxCores); - GeneralHelper.AssertNoErrors(runner); + generalHelper.AssertNoErrors(runner); // Assertions Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanBeeSwarmTest.cs =================================================================== diff -u -r4219 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanBeeSwarmTest.cs (.../StabilityInsideUpliftVanBeeSwarmTest.cs) (revision 4219) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanBeeSwarmTest.cs (.../StabilityInsideUpliftVanBeeSwarmTest.cs) (revision 4220) @@ -28,8 +28,12 @@ using Deltares.Dam.Application.Live; using Deltares.Dam.Data; using Deltares.DamEngine.Interface; +using Deltares.DamEngine.Io; +using Deltares.DamEngine.Io.XmlInput; using Deltares.DamLive.TestHelper; using NUnit.Framework; +using Location = Deltares.Dam.Data.Location; +using TimeSerie = Deltares.Dam.Data.TimeSerie; namespace Deltares.DamLive.Tests; @@ -49,15 +53,15 @@ [SetUp] public void SetupFixture() { - IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMinCores); // to be sure no test directory exist from previous tests - IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMaxCores); + //IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMinCores); // to be sure no test directory exist from previous tests + //IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMaxCores); } [TearDown] public void TearDownFixture() { - IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMinCores); - IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMaxCores); + // IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMinCores); + // IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMaxCores); } [SetUp] @@ -71,8 +75,10 @@ public void CalculateStabilityInsideUpliftVanBeeSwarmUsingTestFilesHasExpectedResultsInOutputFile(int maxCores) { const double cTolerance = 0.0005; - GeneralHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, - output1AFilename, calculationParametersIntegrationFilename, + string testFileName = "CalculateStabilityInsideUpliftVanBeeSwarm"+ maxCores; + var generalHelper = new GeneralHelper(); + generalHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, + output1AFilename, testFileName, calculationParametersIntegrationFilename, projectIntegrationFilename, out runner, out locations); //SetupStabilityProject(maxCores); runner.Initialize(); @@ -86,7 +92,7 @@ runner.Run(); runner.OutputTimeSeriesCollection.Save("UpliftVanBeeSwarmOutputFile" + maxCores); - GeneralHelper.AssertNoErrors(runner); + generalHelper.AssertNoErrors(runner); // Assertions @@ -196,13 +202,19 @@ [TestCase(24)] public void OperationalBeeSwarmMultiCoreWithXmlInputFile(int maxCores) { - const string inputFilename = "InputForDebuggingBeeSwarm.xml"; // or put your own name here; + const string inputFilename = "InputForDebuggingBeeSwarm.xml"; string fullInputFilename = Path.Combine(testIntegrationDataFolder, inputFilename); Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; string inputString = File.ReadAllText(fullInputFilename); + string testName = "InputForDebuggingBeeSwarm"+ maxCores + " .xml"; + //testName = Path.Combine(testIntegrationDataFolder, testName); + var engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); engineInterface.DamProjectData.MaxCalculationCores = maxCores; + engineInterface.DamProjectData.ProjectPath = testWorkingFolder + maxCores; + Input input = DamXmlSerialization.LoadInputFromXmlString(inputString); + DamXmlSerialization.SaveInputAsXmlFile(testName, input); string result = engineInterface.Validate(); Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); string outputString = engineInterface.Run(); Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/Deltares.DamLive.Tests.csproj =================================================================== diff -u -r4219 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/Deltares.DamLive.Tests.csproj (.../Deltares.DamLive.Tests.csproj) (revision 4219) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/Deltares.DamLive.Tests.csproj (.../Deltares.DamLive.Tests.csproj) (revision 4220) @@ -10,6 +10,9 @@ ..\..\lib\DamEngine\Deltares.DamEngine.Interface.dll + + ..\..\lib\DamEngine\Deltares.DamEngine.Io.dll + ..\..\lib\DSL-Geographic\Deltares.Geographic.dll Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanGridTest.cs =================================================================== diff -u -r4219 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanGridTest.cs (.../StabilityInsideUpliftVanGridTest.cs) (revision 4219) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/StabilityInsideUpliftVanGridTest.cs (.../StabilityInsideUpliftVanGridTest.cs) (revision 4220) @@ -69,8 +69,10 @@ public void CalculateStabilityInsideUpliftVanGridUsingTestFilesHasExpectedResultsInOutputFile(int maxCores) { const double cTolerance = 0.0005; - GeneralHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, - output1AFilename, calculationParametersIntegrationFilename, + var generalHelper = new GeneralHelper(); + string testFileName = "CalculateStabilityInsideUpliftVanGrid"+ maxCores; + generalHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, + output1AFilename, testFileName, calculationParametersIntegrationFilename, projectIntegrationFilename, out runner, out locations); runner.Initialize(); runner.MaxCalculationCores = maxCores; @@ -83,7 +85,7 @@ runner.Run(); runner.OutputTimeSeriesCollection.Save("UpliftVanOutputFile" + maxCores); - GeneralHelper.AssertNoErrors(runner); + generalHelper.AssertNoErrors(runner); // Assertions Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/PipingWtiInsideTest.cs =================================================================== diff -u -r4153 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/PipingWtiInsideTest.cs (.../PipingWtiInsideTest.cs) (revision 4153) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/PipingWtiInsideTest.cs (.../PipingWtiInsideTest.cs) (revision 4220) @@ -56,12 +56,6 @@ IoHelper.RemoveTestWorkingDirectory(testWorkingFolder + GeneralHelper.CMaxCores); } - [TearDown] - public void TearDownTest() - { - GeneralHelper.AssertNoErrors(runner); - } - [SetUp] public void SetupTest() {} @@ -73,8 +67,10 @@ public void CalculatePipingInsideWt1ModelUsingTestFilesHasExpectedResultsInOutputFile(int maxCores) { const double cTolerance = 0.0005; - GeneralHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, - output1AFilename, calculationParametersIntegrationFilename, + var generalHelper = new GeneralHelper(); + string testFileName = "CalculatePipingInsideWt1Model"+ maxCores; + generalHelper.SetupIntegrationProject(maxCores, testWorkingFolder, testIntegrationDataFolder, input1AFilename, + output1AFilename, testFileName, calculationParametersIntegrationFilename, projectIntegrationFilename, out runner, out locations); //SetupPipingProject(maxCores); runner.Initialize(); @@ -87,7 +83,7 @@ runner.Run(); //runner.WriteResultsToFile(outputFile); - GeneralHelper.AssertNoErrors(runner); + generalHelper.AssertNoErrors(runner); // Assertions Index: DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs =================================================================== diff -u -r4154 -r4220 --- DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs (.../DamEngineRunner.cs) (revision 4154) +++ DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs (.../DamEngineRunner.cs) (revision 4220) @@ -136,6 +136,8 @@ /// public string Filter { get; set; } + public string TestFileName { get; set; } + /// /// Gets a value indicating whether this instance has errors. /// @@ -209,6 +211,8 @@ protected internal FileInfo FewsInputFile { get; set; } protected internal FileInfo FewsOutputFile { get; set; } protected internal FileInfo ParametersFile { get; set; } + + protected void WriteResultsToFile(string fileName) { @@ -358,7 +362,7 @@ { Input input = FillXmlInputFromDamUi.CreateInput(DamProjectData); #if DEBUG - const string inputFilename = "InputFile.xml"; + string inputFilename = TestFileName + "InputFile.xml"; DamXmlSerialization.SaveInputAsXmlFile(inputFilename, input); #endif string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs =================================================================== diff -u -r4153 -r4220 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs (.../GeneralHelper.cs) (revision 4153) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs (.../GeneralHelper.cs) (revision 4220) @@ -33,8 +33,8 @@ public const int CMinCores = 1; public const int CMaxCores = 20; - public static void SetupIntegrationProject(int maxCores, string testWorkingFolder, string testIntegrationDataFolder, - string input1aFilename, string output1aFilename, + public void SetupIntegrationProject(int maxCores, string testWorkingFolder, string testIntegrationDataFolder, + string input1aFilename, string output1aFilename, string testFileName, string calculationParametersIntegrationFilename, string projectIntegrationFilename, out DamEngineRunner runner, out List locations) { @@ -64,11 +64,12 @@ FewsInputFile = new FileInfo(inputFile), FewsOutputFile = new FileInfo(outputFile), Filter = "", - InputTimeSeriesCollection = inputTimeSeries + InputTimeSeriesCollection = inputTimeSeries, + TestFileName = testFileName }; } - public static void AssertNoErrors(DamEngineRunner runner) + public void AssertNoErrors(DamEngineRunner runner) { if (runner.HasErrors) {