Index: Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql =================================================================== diff -u -rf900d040576ffe6607e028aafc2912ba21c29b8c -r2ef23cfcb32102f57f0e225f9aa9f76fb84292ca --- Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision f900d040576ffe6607e028aafc2912ba21c29b8c) +++ Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision 2ef23cfcb32102f57f0e225f9aa9f76fb84292ca) @@ -55,7 +55,41 @@ 0, NULL FROM [SOURCEPROJECT].ClosingStructuresSectionResultEntity; -INSERT INTO DikeProfileEntity SELECT * FROM [SOURCEPROJECT].DikeProfileEntity; +INSERT INTO DikeProfileEntity ( + [DikeProfileEntityId], + [FailureMechanismEntityId], + [Id], + [Name], + [Orientation], + [BreakWaterType], + [BreakWaterHeight], + [ForeshoreXml], + [DikeGeometryXml], + [DikeHeight], + [X], + [Y], + [X0], + [Order]) +SELECT + [DikeProfileEntityId], + [FailureMechanismEntityId], + [Id], + [Name], + [Orientation], + [BreakWaterType], + [BreakWaterHeight], + [ForeshoreXml], + REPLACE( + REPLACE(DikeGeometryXml, ' xmlns="http://schemas.datacontract.org/2004/07/Application.Ringtoets.Storage.Serializers"', ''), + 'RoughnessPointXmlSerializer.SerializableRoughnessPoint', + 'SerializableRoughnessPoint' + ), + [DikeHeight], + [X], + [Y], + [X0], + [Order] +FROM [SOURCEPROJECT].DikeProfileEntity; INSERT INTO DuneErosionSectionResultEntity ( [DuneErosionSectionResultEntityId], [FailureMechanismSectionEntityId], Index: Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs =================================================================== diff -u -rf900d040576ffe6607e028aafc2912ba21c29b8c -r2ef23cfcb32102f57f0e225f9aa9f76fb84292ca --- Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision f900d040576ffe6607e028aafc2912ba21c29b8c) +++ Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision 2ef23cfcb32102f57f0e225f9aa9f76fb84292ca) @@ -126,6 +126,7 @@ AssertWaveConditionsCalculations(reader, sourceFilePath); MigratedSerializedDataTestHelper.AssertSerializedMacroStabilityInwardsOutput(reader); + MigratedSerializedDataTestHelper.AssertSerializedDikeProfile(reader); } AssertLogDatabase(logFilePath); @@ -768,48 +769,6 @@ reader.AssertReturnedDataIsValid(validateMetaEntity); } - #region Serializers - - /// - /// Testhelper to assert the migrated values of serialized data. - /// - private static class MigratedSerializedDataTestHelper - { - private const string oldNamespace = "Application.Ringtoets.Storage.Serializers"; - - /// - /// Asserts the migrated serialized data related to macro stability inwards output. - /// - /// The reader to read the migrated database. - /// Thrown when: - /// - /// The namespace is still present. - /// The class name of the serialized data is still present. - /// - public static void AssertSerializedMacroStabilityInwardsOutput(MigratedDatabaseReader reader) - { - string validateSlidingCurves = - "SELECT " + - "COUNT() = 0 " + - "FROM MacroStabilityInwardsCalculationOutputEntity " + - "WHERE LIKE('%MacroStabilityInwardsSliceXmlSerializer%', SlidingCurveSliceXml) " + - $"OR LIKE('%{oldNamespace}%', SlidingCurveSliceXml)"; - - reader.AssertReturnedDataIsValid(validateSlidingCurves); - - string validateTangentLines = - "SELECT " + - "COUNT() = 0 " + - "FROM MacroStabilityInwardsCalculationOutputEntity " + - "WHERE LIKE('%TangentLinesXmlSerializer%', SlipPlaneTangentLinesXml) " + - $"OR LIKE('%{oldNamespace}%', SlipPlaneTangentLinesXml)"; - - reader.AssertReturnedDataIsValid(validateTangentLines); - } - } - - #endregion - #region Dune Locations /// @@ -1000,6 +959,69 @@ #endregion + #region Serializers + + /// + /// Testhelper to assert the migrated values of serialized data. + /// + private static class MigratedSerializedDataTestHelper + { + private const string oldNamespace = "Application.Ringtoets.Storage.Serializers"; + + /// + /// Asserts the migrated serialized data related to macro stability inwards output. + /// + /// The reader to read the migrated database. + /// Thrown when: + /// + /// The namespace is still present. + /// The class name of the serialized data is still present. + /// + public static void AssertSerializedMacroStabilityInwardsOutput(MigratedDatabaseReader reader) + { + string validateSlidingCurves = + "SELECT " + + "COUNT() = 0 " + + "FROM MacroStabilityInwardsCalculationOutputEntity " + + "WHERE LIKE('%MacroStabilityInwardsSliceXmlSerializer%', SlidingCurveSliceXML) " + + $"OR LIKE('%{oldNamespace}%', SlidingCurveSliceXML)"; + + reader.AssertReturnedDataIsValid(validateSlidingCurves); + + string validateTangentLines = + "SELECT " + + "COUNT() = 0 " + + "FROM MacroStabilityInwardsCalculationOutputEntity " + + "WHERE LIKE('%TangentLinesXmlSerializer%', SlipPlaneTangentLinesXml) " + + $"OR LIKE('%{oldNamespace}%', SlipPlaneTangentLinesXml)"; + + reader.AssertReturnedDataIsValid(validateTangentLines); + } + + /// + /// Asserts the migrated serialized data related to dike profiles. + /// + /// The reader to read the migrated database. + /// Thrown when: + /// + /// The namespace is still present. + /// The class name of the serialized data is still present. + /// + public static void AssertSerializedDikeProfile(MigratedDatabaseReader reader) + { + string validateDikeGeometry = + "SELECT " + + "COUNT() = 0 " + + "FROM DikeProfileEntity " + + "WHERE LIKE('%RoughnessPointXmlSerializer%', DikeGeometryXml) " + + $"OR LIKE('%{oldNamespace}%', DikeGeometryXml)"; + + reader.AssertReturnedDataIsValid(validateDikeGeometry); + } + } + + #endregion + #region Failure Mechanism Section Result Entities private static void AssertHeightStructuresSectionResultEntity(MigratedDatabaseReader reader, string sourceFilePath)