diff --git a/src/main/java/com/regnosys/testing/pipeline/PipelineTestPackWriter.java b/src/main/java/com/regnosys/testing/pipeline/PipelineTestPackWriter.java index 49a009ee..0ff610c4 100644 --- a/src/main/java/com/regnosys/testing/pipeline/PipelineTestPackWriter.java +++ b/src/main/java/com/regnosys/testing/pipeline/PipelineTestPackWriter.java @@ -34,6 +34,7 @@ import com.regnosys.rosetta.common.transform.PipelineModel; import com.regnosys.rosetta.common.transform.TestPackModel; import com.regnosys.rosetta.common.transform.TransformType; +import com.regnosys.rosetta.common.util.UrlUtils; import com.regnosys.rosetta.common.validation.ValidationReport; import com.regnosys.testing.reports.ObjectMapperGenerator; import com.regnosys.testing.validation.ValidationSummariser; @@ -207,7 +208,7 @@ private TestPackModel writeTestPackSamples(Path resourcesPath, String baseFileName = getBaseFileName(inputSample.toUri().toURL()); String displayName = baseFileName.replace("-", " "); - TestPackModel.SampleModel sampleModel = new TestPackModel.SampleModel(baseFileName.toLowerCase(), displayName, inputSample.toString(), outputPath.toString(), assertions); + TestPackModel.SampleModel sampleModel = new TestPackModel.SampleModel(baseFileName.toLowerCase(), displayName, UrlUtils.toPortableString(inputSample), UrlUtils.toPortableString(outputPath), assertions); sampleModels.add(sampleModel); Files.createDirectories(resourcesPath.resolve(outputPath).getParent()); @@ -279,7 +280,7 @@ private Map> filterAndGroupingByTestPackId(Path resourcesPath private String testPackId(Path resourcesPath, Path inputPath, Path samplePath) { Path parent = samplePath.getParent(); Path relativePath = resourcesPath.relativize(inputPath).relativize(parent); - return relativePath.toString().replace(File.separatorChar, '-'); + return UrlUtils.toPortableString(relativePath).replace(File.separatorChar, '-'); } private @NotNull Map> filterTestPacks(PipelineNode pipelineNode, PipelineTestPackFilter pipelineTestPackFilter, Map> testPackToSamples) { diff --git a/src/main/java/com/regnosys/testing/schemeimport/SchemeImporterTestHelper.java b/src/main/java/com/regnosys/testing/schemeimport/SchemeImporterTestHelper.java index 9f5111f8..0f71c5e0 100644 --- a/src/main/java/com/regnosys/testing/schemeimport/SchemeImporterTestHelper.java +++ b/src/main/java/com/regnosys/testing/schemeimport/SchemeImporterTestHelper.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/test/java/com/regnosys/testing/schemeimport/LatestSchemesImportTest.java b/src/test/java/com/regnosys/testing/schemeimport/LatestSchemesImportTest.java index 82798c8e..20f9ca59 100644 --- a/src/test/java/com/regnosys/testing/schemeimport/LatestSchemesImportTest.java +++ b/src/test/java/com/regnosys/testing/schemeimport/LatestSchemesImportTest.java @@ -62,7 +62,7 @@ public void downloadLatestVersions() throws IOException, NoSuchAlgorithmExceptio deleteFileFolder(new File(LatestSchemesImportTest.CODE_LIST_ZIP)); deleteFileFolder(new File(LatestSchemesImportTest.CODE_LIST)); } - assertEquals("39a7fdb456d6c5b38272bd973fd0203a", checksum, "CodeList zip has been updated, run again with WRITE_EXPECTATIONS enabled then update expected checksum"); + assertEquals("c8d253d3d7ef86d2c88e10cf8a2ce50a", checksum, "CodeList zip has been updated, run again with WRITE_EXPECTATIONS enabled then update expected checksum"); } } @@ -142,7 +142,8 @@ private void moveFilesToFpml() { System.out.println("copying " + path.toString()); Path d2 = destinationDir.resolve(path.getFileName()); System.out.println("destination File=" + d2); - Files.move(path, d2, StandardCopyOption.REPLACE_EXISTING); + if (Files.notExists(d2)) + Files.move(path, d2, StandardCopyOption.REPLACE_EXISTING); } } catch (IOException ex) { ex.printStackTrace();