From 33bfbac9c30818dabeb6bd4a64546f671749a834 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 12 May 2023 16:58:57 +0200 Subject: Actually really properly fix test and handle UUID changes again --- ...urationLogicDozModServerToStatelessClientTest.java | 2 +- .../logic/ConfigurationLogicTestUtils.java | 19 ++++++++++++++++--- .../virtualbox_default-ubuntu_transform-editable.vbox | 6 +++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java index 2271e9c..57df203 100644 --- a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java +++ b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java @@ -71,7 +71,7 @@ public class ConfigurationLogicDozModServerToStatelessClientTest final String transformedConfig = config.getConfigurationAsString(); final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig ); - ConfigurationLogicTestUtils.assertXmlVirtualBoxEqual( expectedTransformedConfig, transformedConfig ); + ConfigurationLogicTestUtils.assertXmlEqual( expectedTransformedConfig, transformedConfig ); // do not validate the VirtualBox configuration afterwards, since the inserted // place holders do not match valid primitive values from the XML schema diff --git a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java index 466a1d6..d085960 100644 --- a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java +++ b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java @@ -38,7 +38,8 @@ public class ConfigurationLogicTestUtils new OperatingSystem( 11, "Windows 2000 Professional", null, "x86", 4096, 4 ) ) ); // @formatter:on - private static final String REGEX_SOURCE_FILE_PATHS = "()"; + private static final String REGEX_UUID = "<(Machine|HardDisk|Image)(.*)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; + private static final String REGEX_SOURCE_FILE_PATHS = "( - + - + @@ -36,7 +36,7 @@ - + -- cgit v1.2.3-55-g7522