changeset 12490:b9c628b36422

8132704: [TESTBUG] jdk/internal/jimage/ExecutableTest.java incorrectly asserts all files to be executable Reviewed-by: rriggs, alanb
author simonis
date Fri, 31 Jul 2015 15:19:15 +0200
parents 339e2b4a5241
children 53c8268bb88f
files test/jdk/internal/jimage/ExecutableTest.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/internal/jimage/ExecutableTest.java	Fri Jul 31 15:07:18 2015 +0300
+++ b/test/jdk/internal/jimage/ExecutableTest.java	Fri Jul 31 15:19:15 2015 +0200
@@ -27,7 +27,9 @@
 import java.nio.file.Paths;
 import java.nio.file.attribute.PosixFilePermission;
 import static java.nio.file.attribute.PosixFilePermission.*;
+import java.util.Arrays;
 import java.util.EnumSet;
+import java.util.HashSet;
 import java.util.Set;
 
 /*
@@ -41,6 +43,11 @@
 
 public class ExecutableTest {
 
+    // The bin/ directory may contain non-executable files (see 8132704)
+    private static final String[] exclude = { "jmc.ini" };
+    private static final Set<String> excludeSet =
+        new HashSet<String>(Arrays.asList(exclude));
+
     public static void main(String args[]) throws Throwable {
         String JAVA_HOME = System.getProperty("java.home");
         Path binPath = Paths.get(JAVA_HOME, "bin");
@@ -48,6 +55,7 @@
         EnumSet<PosixFilePermission> execPerms =
             EnumSet.of(GROUP_EXECUTE, OTHERS_EXECUTE, OWNER_EXECUTE);
         for (Path entry : stream) {
+            if (excludeSet.contains(entry.getFileName().toString())) continue;
             if (Files.isRegularFile(entry)) {
                 if (!Files.isExecutable(entry)) {
                     throw new Error(entry + " is not executable!");