8221596: test/hotspot/jtreg/runtime/containers/docker/TestCPUSets.java failed with FileAlreadyExistsException
authormseledtsov
Fri, 29 Mar 2019 18:25:39 -0700
changeset 54345 1042cac8bc2a
parent 54344 8cd2af66ac7c
child 54346 b7ebff3e4e69
8221596: test/hotspot/jtreg/runtime/containers/docker/TestCPUSets.java failed with FileAlreadyExistsException Summary: Using StandardCopyOption.REPLACE_EXISTING to copy whitebox.jar Reviewed-by: dholmes, mseledtsov Contributed-by: jiefu <fujie@loongson.cn>
test/lib/jdk/test/lib/containers/docker/Common.java
--- a/test/lib/jdk/test/lib/containers/docker/Common.java	Thu Mar 28 13:53:41 2019 -0400
+++ b/test/lib/jdk/test/lib/containers/docker/Common.java	Fri Mar 29 18:25:39 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.io.File;
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
 import jdk.test.lib.containers.docker.DockerRunOptions;
 import jdk.test.lib.containers.docker.DockerTestUtils;
 import jdk.test.lib.Utils;
@@ -46,7 +47,7 @@
 
     public static void prepareWhiteBox() throws Exception {
         Files.copy(Paths.get(new File("whitebox.jar").getAbsolutePath()),
-                   Paths.get(Utils.TEST_CLASSES, "whitebox.jar"));
+                   Paths.get(Utils.TEST_CLASSES, "whitebox.jar"), StandardCopyOption.REPLACE_EXISTING);
     }