8151914: java/util/jar/JarFile/MultiReleaseJar* tests do not declare module dependences

Reviewed-by: chegar
This commit is contained in:
Alexandre Iline 2016-05-10 13:48:07 -07:00
parent 9c17407e9e
commit e7e64ceea3
7 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,9 @@
* @bug 8132734 * @bug 8132734
* @summary Test the System properties for JarFile that support multi-release jar files * @summary Test the System properties for JarFile that support multi-release jar files
* @library /lib/testlibrary/java/util/jar * @library /lib/testlibrary/java/util/jar
* @modules jdk.jartool
* jdk.compiler
* jdk.httpserver
* @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer * @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer
* @run testng MultiReleaseJarHttpProperties * @run testng MultiReleaseJarHttpProperties
* @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties

View File

@ -0,0 +1,3 @@
modules = \
jdk.compiler \
jdk.jartool

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ class Compiler {
// so do it the old fashioned way // so do it the old fashioned way
// options = Arrays.asList("-release", String.valueOf(release)); // options = Arrays.asList("-release", String.valueOf(release));
String target = String.valueOf(release); String target = String.valueOf(release);
options = Arrays.asList("-source", target, "-target", target); options = Arrays.asList("-source", target, "-target", target, "-classpath", "");
return this; return this;
} }
@ -53,7 +53,9 @@ class Compiler {
Map<String,ClassFileObject> cfos = createClassFileObjects(); Map<String,ClassFileObject> cfos = createClassFileObjects();
JavaCompiler jc = ToolProvider.getSystemJavaCompiler(); JavaCompiler jc = ToolProvider.getSystemJavaCompiler();
JavaFileManager jfm = new CustomFileManager(jc.getStandardFileManager(null, null, null), cfos); JavaFileManager jfm = new CustomFileManager(jc.getStandardFileManager(null, null, null), cfos);
jc.getTask(null, jfm, null, options, null, cunits).call(); if(!jc.getTask(null, jfm, null, options, null, cunits).call()) {
throw new RuntimeException("Compilation failed");
}
return createOutput(cfos); return createOutput(cfos);
} }