8164887: update tests to remove use of old-style options
Reviewed-by: mchung
This commit is contained in:
parent
0b92f87233
commit
1386ffb4f2
@ -88,18 +88,18 @@
|
||||
<dirset dir="${src.dir}" includes="*.*"/>
|
||||
</pathconvert>
|
||||
|
||||
<pathconvert property="xpatch.rest" pathsep=" -Xpatch:">
|
||||
<pathconvert property="xpatch.rest" pathsep=" --patch-module=">
|
||||
<regexpmapper from="${file.separator}([^${file.separator}]+)$" to='\1="${build.modules}${file.separator}\1"' />
|
||||
<dirset dir="${src.dir}" includes="*.*"/>
|
||||
</pathconvert>
|
||||
|
||||
<pathconvert property="xpatch.noquotes.rest" pathsep=" -Xpatch:">
|
||||
<pathconvert property="xpatch.noquotes.rest" pathsep=" --patch-module=">
|
||||
<regexpmapper from="${file.separator}([^${file.separator}]+)$" to="\1=${build.modules}${file.separator}\1" />
|
||||
<dirset dir="${src.dir}" includes="*.*"/>
|
||||
</pathconvert>
|
||||
|
||||
<property name="xpatch.cmd" value="-Xpatch:${xpatch.rest}"/>
|
||||
<property name="xpatch.noquotes.cmd" value="-Xpatch:${xpatch.noquotes.rest}"/>
|
||||
<property name="xpatch.cmd" value="--patch-module=${xpatch.rest}"/>
|
||||
<property name="xpatch.noquotes.cmd" value="--patch-module=${xpatch.noquotes.rest}"/>
|
||||
|
||||
<!-- java.marker is set to a marker file to check for within a Java install dir.
|
||||
The best file to check for across Solaris/Linux/Windows/MacOS is one of the
|
||||
@ -207,7 +207,7 @@
|
||||
<arg line="-source ${javac.source} -target ${javac.target}" />
|
||||
<arg value="-d" />
|
||||
<arg value="${build.modules}" />
|
||||
<arg line="${javac.opts} -modulesourcepath ${src.dir}${file.separator}*${file.separator}share${file.separator}classes:${build.gensrc} -m ${modules.names}" />
|
||||
<arg line="${javac.opts} --module-source-path ${src.dir}${file.separator}*${file.separator}share${file.separator}classes:${build.gensrc} -m ${modules.names}" />
|
||||
</exec>
|
||||
<delete>
|
||||
<fileset dir="${build.modules}" includes="**/module-info.class"/>
|
||||
|
@ -80,12 +80,12 @@ By default, the reports will be generated in langtools/build/diags-examples/repo
|
||||
includeAntRuntime="no"
|
||||
debug="${javac.debug}"
|
||||
debuglevel="${javac.debuglevel}">
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
|
||||
<compilerarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
|
||||
<compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
@ -111,12 +111,12 @@ By default, the reports will be generated in langtools/build/diags-examples/repo
|
||||
<arg value="-showFiles"/>
|
||||
<arg value="-title"/>
|
||||
<arg value="Examples of javac diagnostics"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
|
||||
<jvmarg line="-XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
|
||||
<jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
|
||||
</java>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
@ -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.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,9 +41,9 @@ $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
|
||||
|
||||
ifeq ($(BOOT_JDK_MODULAR), true)
|
||||
COMPILECREATESYMBOLS_ADD_EXPORTS := \
|
||||
-XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
|
||||
-XaddExports:jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
|
||||
-XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
|
||||
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
|
||||
--add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
|
||||
--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
|
||||
endif
|
||||
|
||||
$(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
|
||||
|
@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="javah" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.sun.tools.javah.Main" />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ -XaddExports:jdk.compiler/com.sun.tools.javah=ALL-UNNAMED' />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.compiler/com.sun.tools.javah=ALL-UNNAMED' />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||
|
@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="javap" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.sun.tools.javap.Main" />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ -XaddExports:jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED' />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED' />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||
|
@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="jshell" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellTool" />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ -XaddExports:jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED' />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED' />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||
|
@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="sjavac" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.sun.tools.sjavac.Main" />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ -XaddExports:jdk.compiler/com.sun.tools.sjavac=ALL-UNNAMED' />
|
||||
<option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.compiler/com.sun.tools.sjavac=ALL-UNNAMED' />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||
|
@ -218,11 +218,11 @@
|
||||
|
||||
<sequential>
|
||||
<java fork="true" jvm="${langtools.jdk.home}/bin/java" classname="@{mainclass}">
|
||||
<jvmarg line="-Xpatch:java.compiler=@{build.modules}/java.compiler"/>
|
||||
<jvmarg line="-Xpatch:jdk.compiler=@{build.modules}/jdk.compiler"/>
|
||||
<jvmarg line="-Xpatch:jdk.javadoc=@{build.modules}/jdk.javadoc"/>
|
||||
<jvmarg line="-Xpatch:jdk.jdeps=@{build.modules}/jdk.jdeps"/>
|
||||
<jvmarg line="-Xpatch:jdk.jshell=@{build.modules}/jdk.jshell"/>
|
||||
<jvmarg line="--patch-module=java.compiler=@{build.modules}/java.compiler"/>
|
||||
<jvmarg line="--patch-module=jdk.compiler=@{build.modules}/jdk.compiler"/>
|
||||
<jvmarg line="--patch-module=jdk.javadoc=@{build.modules}/jdk.javadoc"/>
|
||||
<jvmarg line="--patch-module=jdk.jdeps=@{build.modules}/jdk.jdeps"/>
|
||||
<jvmarg line="--patch-module=jdk.jshell=@{build.modules}/jdk.jshell"/>
|
||||
<jvmarg line="@{jpda.jvmargs}"/>
|
||||
<arg line="@{args}"/>
|
||||
</java>
|
||||
|
@ -204,7 +204,7 @@ public class TestFramesNoFrames extends JavadocTester {
|
||||
@Test
|
||||
void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
|
||||
javadoc(base, fKind, oKind, hKind,
|
||||
"-modulesourcepath", gensrcModules.toString(),
|
||||
"--module-source-path", gensrcModules.toString(),
|
||||
"--module", "m1,m2,m3");
|
||||
|
||||
new Checker(fKind, oKind, hKind)
|
||||
|
@ -160,8 +160,8 @@ public class TestModules extends JavadocTester {
|
||||
@Test
|
||||
void testModuleSummary() {
|
||||
javadoc("-d", "out-moduleSummary", "-use",
|
||||
"-modulesourcepath", testSrc,
|
||||
"-addmods", "module1,module2",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "module1,module2",
|
||||
"testpkgmdl1", "testpkgmdl2", "module2/testpkg2mdl2");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleSummary();
|
||||
@ -174,8 +174,8 @@ public class TestModules extends JavadocTester {
|
||||
@Test
|
||||
void testModuleFilesAndLinks() {
|
||||
javadoc("-d", "out-modulelinks",
|
||||
"-modulesourcepath", testSrc,
|
||||
"-addmods", "module1",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "module1",
|
||||
"testpkgmdl1");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleFilesAndLinks(true);
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @summary Tests elements filtering options
|
||||
* @modules
|
||||
* jdk.javadoc/jdk.javadoc.internal.api
|
||||
* jdk.javadoc/jdk.javadoc.internal.doclets.standard
|
||||
* jdk.javadoc/jdk.javadoc.internal.tool
|
||||
* jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
@ -60,7 +59,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testDefault(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src, "--module", "m1");
|
||||
execTask("--module-source-path", src, "--module", "m1");
|
||||
|
||||
checkModulesSpecified("m1");
|
||||
checkModulesIncluded("m1");
|
||||
@ -70,7 +69,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testModuleModeApi(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1", "--show-module-contents:api");
|
||||
|
||||
checkModuleMode("API");
|
||||
@ -78,7 +77,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testModuleModeAll(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1", "--show-module-contents:all");
|
||||
|
||||
checkModuleMode("ALL");
|
||||
@ -86,7 +85,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowPackagesExported(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-packages:exported"); // default
|
||||
|
||||
@ -98,7 +97,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowPackagesAll(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-packages:all");
|
||||
checkModulesSpecified("m1");
|
||||
@ -111,7 +110,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowTypesPrivate(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-types:private");
|
||||
|
||||
@ -128,7 +127,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowTypesPackage(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-types:package");
|
||||
|
||||
@ -144,7 +143,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowTypesProtected(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-types:protected");
|
||||
|
||||
@ -161,7 +160,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowTypesPublic(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-types:public");
|
||||
|
||||
@ -178,7 +177,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowMembersPrivate(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-members:private");
|
||||
|
||||
@ -187,7 +186,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowMembersPackage(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-members:package");
|
||||
|
||||
@ -196,7 +195,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowMembersProtected(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-members:protected");
|
||||
|
||||
@ -205,7 +204,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testShowMembersPublic(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"--show-members:public");
|
||||
|
||||
@ -214,7 +213,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testLegacyPublic(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"-public");
|
||||
|
||||
@ -229,7 +228,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testLegacyDefault(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1");
|
||||
|
||||
checkModuleMode("API");
|
||||
@ -243,7 +242,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testLegacyProtected(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"-protected");
|
||||
|
||||
@ -258,7 +257,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testLegacyPackage(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"-package");
|
||||
|
||||
@ -277,7 +276,7 @@ public class FilterOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testLegacyPrivate(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", src,
|
||||
execTask("--module-source-path", src,
|
||||
"--module", "m1",
|
||||
"-private");
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @summary Tests primarily the module graph computations.
|
||||
* @modules
|
||||
* jdk.javadoc/jdk.javadoc.internal.api
|
||||
* jdk.javadoc/jdk.javadoc.internal.doclets.standard
|
||||
* jdk.javadoc/jdk.javadoc.internal.tool
|
||||
* jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
@ -58,7 +57,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package pub; /** Klass A */ public class A {}")
|
||||
.classes("package pro; /** Klass B */ public class B {}")
|
||||
.write(src);
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "m1");
|
||||
checkModulesSpecified("m1");
|
||||
checkPackagesIncluded("pub");
|
||||
@ -83,7 +82,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package m2pub; /** Klass A */ public class A {}")
|
||||
.classes("package m2pro; /** Klass B */ public class B {}")
|
||||
.write(src);
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "m1,m2");
|
||||
checkModulesSpecified("m1", "m2");
|
||||
checkPackagesIncluded("m1pub", "m2pub");
|
||||
@ -109,7 +108,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package m2pub; /** Klass A */ public class A {}")
|
||||
.classes("package m2pro; /** Klass B */ public class B {}")
|
||||
.write(src);
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "m1",
|
||||
"--module", "m2");
|
||||
checkModulesSpecified("m1", "m2");
|
||||
@ -152,7 +151,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
|
||||
.write(src);
|
||||
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "M");
|
||||
|
||||
checkModulesSpecified("M");
|
||||
@ -176,7 +175,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
|
||||
.write(src);
|
||||
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "M",
|
||||
"--expand-requires:public");
|
||||
|
||||
@ -201,7 +200,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
|
||||
.write(src);
|
||||
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"--module", "M",
|
||||
"--expand-requires:all");
|
||||
|
||||
@ -229,7 +228,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
|
||||
.write(src);
|
||||
|
||||
execNegativeTask("-modulesourcepath", src.toString(),
|
||||
execNegativeTask("--module-source-path", src.toString(),
|
||||
"--module", "MIA",
|
||||
"--expand-requires:all");
|
||||
|
||||
@ -251,7 +250,7 @@ public class Modules extends ModuleTestBase {
|
||||
.classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
|
||||
.write(src);
|
||||
|
||||
execNegativeTask("-modulesourcepath", src.toString(),
|
||||
execNegativeTask("--module-source-path", src.toString(),
|
||||
"--module", "M,N,L,MIA,O,P",
|
||||
"--expand-requires:all");
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @summary Test modules with packages and subpackages filtering
|
||||
* @modules
|
||||
* jdk.javadoc/jdk.javadoc.internal.api
|
||||
* jdk.javadoc/jdk.javadoc.internal.doclets.standard
|
||||
* jdk.javadoc/jdk.javadoc.internal.tool
|
||||
* jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
@ -52,8 +51,8 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testExportedNonQualifiedPackagesLegacyMode(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
"-addmods", "m1",
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--add-modules", "m1",
|
||||
"m1pub");
|
||||
|
||||
checkModulesNotSpecified("m1");
|
||||
@ -64,8 +63,8 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testExportedQualifiedPackagesLegacyMode(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
"-addmods", "m1",
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--add-modules", "m1",
|
||||
"m1/m1pub");
|
||||
|
||||
checkModulesNotSpecified("m1");
|
||||
@ -76,8 +75,8 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testNonExportedQualifedPackagesLegacyMode(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
"-addmods", "m1",
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--add-modules", "m1",
|
||||
"m1/m1pro.pro1" /* not exported, therefore qualify with module */);
|
||||
|
||||
checkModulesNotSpecified("m1");
|
||||
@ -92,8 +91,8 @@ public class PackageOptions extends ModuleTestBase {
|
||||
public void testTypesLegacyMode(Path base) throws Exception {
|
||||
Path srcPath = base.resolve("src");
|
||||
Path typPath = srcPath.resolve("m1/m1pub/A.java");
|
||||
execTask("-modulesourcepath", createSources(srcPath),
|
||||
"-addmods", "m1",
|
||||
execTask("--module-source-path", createSources(srcPath),
|
||||
"--add-modules", "m1",
|
||||
typPath.toString());
|
||||
checkModulesNotSpecified("m1");
|
||||
checkModulesIncluded("m1");
|
||||
@ -109,8 +108,8 @@ public class PackageOptions extends ModuleTestBase {
|
||||
public void testSubclassedTypesLegacyMode(Path base) throws Exception {
|
||||
Path srcPath = base.resolve("src");
|
||||
Path typPath = srcPath.resolve("m1/m1pub/B.java");
|
||||
execTask("-modulesourcepath", createSources(srcPath),
|
||||
"-addmods", "m1",
|
||||
execTask("--module-source-path", createSources(srcPath),
|
||||
"--add-modules", "m1",
|
||||
typPath.toString());
|
||||
checkModulesNotSpecified("m1");
|
||||
checkModulesIncluded("m1");
|
||||
@ -124,7 +123,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testDefaultPackages(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1");
|
||||
|
||||
checkModulesSpecified("m1");
|
||||
@ -149,20 +148,20 @@ public class PackageOptions extends ModuleTestBase {
|
||||
// I/O error encounted during the iteration
|
||||
throw ex.getCause();
|
||||
}
|
||||
execTask("-modulesourcepath", src.toString(),
|
||||
execTask("--module-source-path", src.toString(),
|
||||
"-subpackages", "m1/m1pro");
|
||||
|
||||
checkPackagesSpecified("m1pro", "m1pro.pro1", "m1pro.pro2");
|
||||
|
||||
// empty package directory should cause an error
|
||||
execNegativeTask("-modulesourcepath", src.toString(),
|
||||
execNegativeTask("--module-source-path", src.toString(),
|
||||
"m1/m1pro");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExportedQualifiedSubpackageWithMultipleModules(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src"), 2),
|
||||
execTask("--module-source-path", createSources(base.resolve("src"), 2),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1/m1pro.pro1:m1/m1pro.pro2:m2/m2pub.pub1");
|
||||
|
||||
@ -177,7 +176,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedUnqualifiedSubpackages(Path base) throws Exception {
|
||||
execNegativeTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execNegativeTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1pub.pub1:pro");
|
||||
|
||||
@ -186,7 +185,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedQualifiedPackage(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"m1/m1pro");
|
||||
|
||||
@ -201,7 +200,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedQualifiedSubpackage(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1/m1pro");
|
||||
|
||||
@ -216,7 +215,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedQualifiedSubpackageExcludeQualified(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1/m1pro",
|
||||
"-exclude", "m1/m1pro.pro1.pro11:m1/m1pro.pro2.pro21");
|
||||
@ -233,7 +232,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedQualifiedSubpackageExcludeUnqualified(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1/m1pro",
|
||||
"-exclude", "m1pro.pro1.pro11:m1pro.pro2.pro21");
|
||||
@ -250,7 +249,7 @@ public class PackageOptions extends ModuleTestBase {
|
||||
|
||||
@Test
|
||||
public void testUnexportedQualifiedSubpackages(Path base) throws Exception {
|
||||
execTask("-modulesourcepath", createSources(base.resolve("src")),
|
||||
execTask("--module-source-path", createSources(base.resolve("src")),
|
||||
"--module", "m1",
|
||||
"-subpackages", "m1/m1pro.pro1:m1/m1pro.pro2");
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, 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
|
||||
@ -44,7 +44,7 @@ public class VersionOpt {
|
||||
// Test functions by comparing the version string from javac against
|
||||
// a "golden" version generated automatically from the underlying JVM.
|
||||
// As such, it is only effective in testing the "standard" compiler,
|
||||
// and not any development version being tested via -Xpatch.
|
||||
// and not any development version being tested via --patch-modules.
|
||||
// Check the version of the compiler being used, and let the test pass
|
||||
// automatically if is is a development version.
|
||||
Class<?> javacClass = com.sun.tools.javac.Main.class;
|
||||
|
@ -21,5 +21,5 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// a file to be passed in where a directory is expected (-modulesourcepath option)
|
||||
// a file to be passed in where a directory is expected (--module-source-path option)
|
||||
// to trigger an error deliberately.
|
||||
|
@ -22,6 +22,6 @@
|
||||
*/
|
||||
|
||||
// key: compiler.err.module.not.found.in.module.source.path
|
||||
// options: -m m1 -modulesourcepath src
|
||||
// options: -m m1 --module-source-path src
|
||||
|
||||
class ModuleNotFoundInModuleSourcePath {}
|
||||
|
@ -22,6 +22,6 @@
|
||||
*/
|
||||
|
||||
// key: compiler.err.xmodule.no.module.sourcepath
|
||||
// options: -Xmodule:java.compiler -modulesourcepath src
|
||||
// options: -Xmodule:java.compiler --module-source-path src
|
||||
|
||||
class XModuleWithModulePath {}
|
||||
|
@ -28,7 +28,7 @@
|
||||
* @library /tools/lib
|
||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
* @run main/othervm -limitmods jdk.compiler LimitedImage
|
||||
* @run main/othervm --limit-modules jdk.compiler LimitedImage
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
@ -133,4 +133,4 @@ public class LimitedImage {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class GraphsTest extends ModuleTestBase {
|
||||
.write(modSrc);
|
||||
String log = new JavacTask(tb)
|
||||
.options("-XDrawDiagnostics",
|
||||
"-modulesourcepath", modSrc.toString())
|
||||
"--module-source-path", modSrc.toString())
|
||||
.outdir(Files.createDirectories(base.resolve("negative")))
|
||||
.files(findJavaFiles(modSrc))
|
||||
.run(Task.Expect.FAIL)
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary tests for -modulesourcepath
|
||||
* @summary tests for --module-source-path
|
||||
* @library /tools/lib
|
||||
* @modules
|
||||
* jdk.compiler/com.sun.tools.javac.api
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary NPE while compiling empty javafile with -modulesourcepath option
|
||||
* @summary NPE while compiling empty source file with --module-source-path option
|
||||
* @library /tools/lib
|
||||
* @modules
|
||||
* jdk.compiler/com.sun.tools.javac.api
|
||||
|
@ -73,7 +73,7 @@ public class RemovedJDKInternals {
|
||||
// patch jdk.unsupported and set -cp to codec types
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "p"),
|
||||
CLASSES_DIR,
|
||||
"-Xpatch:jdk.unsupported=" + patchDir,
|
||||
"--patch-module", "jdk.unsupported=" + patchDir,
|
||||
"-cp", codecDest.toString()));
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ public final class CompilerUtils {
|
||||
}
|
||||
|
||||
Stream<String> opts = Arrays.stream(new String[] {
|
||||
"-modulesourcepath", source.toString(), "-m", moduleName
|
||||
"--module-source-path", source.toString(), "-m", moduleName
|
||||
});
|
||||
List<String> javacOpts = Stream.concat(opts, Arrays.stream(options))
|
||||
.collect(Collectors.toList());
|
||||
|
Loading…
Reference in New Issue
Block a user