author | prr |
Fri, 25 May 2018 12:12:24 -0700 | |
changeset 50347 | b2f046ae8eb6 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
1 |
/* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
4 |
* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
8 |
* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
13 |
* accompanied this code). |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
14 |
* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
18 |
* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
21 |
* questions. |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
22 |
*/ |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
23 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
24 |
import java.io.File; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
25 |
import java.io.PrintWriter; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
26 |
import java.io.StringWriter; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
27 |
import java.nio.file.Files; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
28 |
import java.nio.file.Path; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
29 |
import java.nio.file.Paths; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
30 |
import java.util.ArrayList; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
31 |
import java.util.List; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
32 |
import java.util.spi.ToolProvider; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
33 |
import java.util.stream.Collectors; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
34 |
import java.util.stream.Stream; |
45393 | 35 |
import jdk.test.lib.compiler.CompilerUtils; |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
36 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
37 |
import org.testng.annotations.BeforeTest; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
38 |
import org.testng.annotations.Test; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
39 |
import static org.testng.Assert.*; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
40 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
41 |
/** |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
42 |
* @test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
43 |
* @bug 8174826 |
45393 | 44 |
* @library /lib/testlibrary /test/lib |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
45 |
* @modules jdk.charsets jdk.compiler jdk.jlink |
45393 | 46 |
* @build SuggestProviders jdk.test.lib.compiler.CompilerUtils |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
47 |
* @run testng SuggestProviders |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
48 |
*/ |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
49 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
50 |
public class SuggestProviders { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
51 |
private static final String JAVA_HOME = System.getProperty("java.home"); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
52 |
private static final String TEST_SRC = System.getProperty("test.src"); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
53 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
54 |
private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
55 |
private static final Path MODS_DIR = Paths.get("mods"); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
56 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
57 |
private static final String MODULE_PATH = |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
58 |
Paths.get(JAVA_HOME, "jmods").toString() + |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
59 |
File.pathSeparator + MODS_DIR.toString(); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
60 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
61 |
// the names of the modules in this test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
62 |
private static String[] modules = new String[] {"m1", "m2", "m3"}; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
63 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
64 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
65 |
private static boolean hasJmods() { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
66 |
if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
67 |
System.err.println("Test skipped. NO jmods directory"); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
68 |
return false; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
69 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
70 |
return true; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
71 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
72 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
73 |
/* |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
74 |
* Compiles all modules used by the test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
75 |
*/ |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
76 |
@BeforeTest |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
77 |
public void compileAll() throws Throwable { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
78 |
if (!hasJmods()) return; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
79 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
80 |
for (String mn : modules) { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
81 |
Path msrc = SRC_DIR.resolve(mn); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
82 |
assertTrue(CompilerUtils.compile(msrc, MODS_DIR, |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
83 |
"--module-source-path", SRC_DIR.toString())); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
84 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
85 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
86 |
|
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
87 |
// check a subset of services used by java.base |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
88 |
private final List<String> JAVA_BASE_USES = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
89 |
"uses java.lang.System$LoggerFinder", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
90 |
"uses java.net.ContentHandlerFactory", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
91 |
"uses java.net.spi.URLStreamHandlerProvider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
92 |
"uses java.nio.channels.spi.AsynchronousChannelProvider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
93 |
"uses java.nio.channels.spi.SelectorProvider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
94 |
"uses java.nio.charset.spi.CharsetProvider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
95 |
"uses java.nio.file.spi.FileSystemProvider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
96 |
"uses java.nio.file.spi.FileTypeDetector", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
97 |
"uses java.security.Provider", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
98 |
"uses java.util.spi.ToolProvider" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
99 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
100 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
101 |
private final List<String> JAVA_BASE_PROVIDERS = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
102 |
"java.base provides java.nio.file.spi.FileSystemProvider used by java.base" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
103 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
104 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
105 |
private final List<String> SYSTEM_PROVIDERS = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
106 |
"jdk.charsets provides java.nio.charset.spi.CharsetProvider used by java.base", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
107 |
"jdk.compiler provides java.util.spi.ToolProvider used by java.base", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
108 |
"jdk.compiler provides javax.tools.JavaCompiler used by java.compiler", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
109 |
"jdk.jlink provides jdk.tools.jlink.plugin.Plugin used by jdk.jlink", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
110 |
"jdk.jlink provides java.util.spi.ToolProvider used by java.base" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
111 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
112 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
113 |
private final List<String> APP_USES = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
114 |
"uses p1.S", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
115 |
"uses p2.T" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
116 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
117 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
118 |
private final List<String> APP_PROVIDERS = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
119 |
"m1 provides p1.S used by m1", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
120 |
"m2 provides p1.S used by m1", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
121 |
"m2 provides p2.T used by m2", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
122 |
"m3 provides p2.T used by m2", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
123 |
"m3 provides p3.S not used by any observable module" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
124 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
125 |
|
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
126 |
@Test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
127 |
public void suggestProviders() throws Throwable { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
128 |
if (!hasJmods()) return; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
129 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
130 |
List<String> output = JLink.run("--module-path", MODULE_PATH, |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
131 |
"--suggest-providers").output(); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
132 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
133 |
Stream<String> uses = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
134 |
Stream.concat(JAVA_BASE_USES.stream(), APP_USES.stream()); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
135 |
Stream<String> providers = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
136 |
Stream.concat(SYSTEM_PROVIDERS.stream(), APP_PROVIDERS.stream()); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
137 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
138 |
assertTrue(output.containsAll(Stream.concat(uses, providers) |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
139 |
.collect(Collectors.toList()))); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
140 |
} |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
141 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
142 |
/** |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
143 |
* find providers from the observable modules and --add-modules has no |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
144 |
* effect on the suggested providers |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
145 |
*/ |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
146 |
@Test |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
147 |
public void observableModules() throws Throwable { |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
148 |
if (!hasJmods()) return; |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
149 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
150 |
List<String> output = JLink.run("--module-path", MODULE_PATH, |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
151 |
"--add-modules", "m1", |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
152 |
"--suggest-providers").output(); |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
153 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
154 |
Stream<String> uses = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
155 |
Stream.concat(JAVA_BASE_USES.stream(), Stream.of("uses p1.S")); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
156 |
Stream<String> providers = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
157 |
Stream.concat(SYSTEM_PROVIDERS.stream(), APP_PROVIDERS.stream()); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
158 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
159 |
assertTrue(output.containsAll(Stream.concat(uses, providers) |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
160 |
.collect(Collectors.toList()))); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
161 |
} |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
162 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
163 |
/** |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
164 |
* find providers from the observable modules with --limit-modules |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
165 |
*/ |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
166 |
@Test |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
167 |
public void limitModules() throws Throwable { |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
168 |
if (!hasJmods()) return; |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
169 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
170 |
List<String> output = JLink.run("--module-path", MODULE_PATH, |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
171 |
"--limit-modules", "m1", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
172 |
"--suggest-providers").output(); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
173 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
174 |
Stream<String> uses = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
175 |
Stream.concat(JAVA_BASE_USES.stream(), Stream.of("uses p1.S")); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
176 |
Stream<String> providers = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
177 |
Stream.concat(JAVA_BASE_PROVIDERS.stream(), |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
178 |
Stream.of("m1 provides p1.S used by m1") |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
179 |
); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
180 |
|
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
181 |
assertTrue(output.containsAll(Stream.concat(uses, providers) |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
182 |
.collect(Collectors.toList()))); |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
183 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
184 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
185 |
@Test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
186 |
public void providersForServices() throws Throwable { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
187 |
if (!hasJmods()) return; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
188 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
189 |
List<String> output = |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
190 |
JLink.run("--module-path", MODULE_PATH, |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
191 |
"--suggest-providers", |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
192 |
"java.nio.charset.spi.CharsetProvider,p1.S").output(); |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
193 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
194 |
System.out.println(output); |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
195 |
Stream<String> expected = Stream.concat( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
196 |
Stream.of("jdk.charsets provides java.nio.charset.spi.CharsetProvider used by java.base"), |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
197 |
Stream.of("m1 provides p1.S used by m1", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
198 |
"m2 provides p1.S used by m1") |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
199 |
); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
200 |
|
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
201 |
assertTrue(output.containsAll(expected.collect(Collectors.toList()))); |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
202 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
203 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
204 |
@Test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
205 |
public void unusedService() throws Throwable { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
206 |
if (!hasJmods()) return; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
207 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
208 |
List<String> output = |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
209 |
JLink.run("--module-path", MODULE_PATH, |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
210 |
"--suggest-providers", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
211 |
"p3.S").output(); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
212 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
213 |
List<String> expected = List.of( |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
214 |
"m3 provides p3.S not used by any observable module" |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
215 |
); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
216 |
assertTrue(output.containsAll(expected)); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
217 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
218 |
// should not print other services m3 provides |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
219 |
assertFalse(output.contains("m3 provides p2.T used by m2")); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
220 |
} |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
221 |
|
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
222 |
@Test |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
223 |
public void nonExistentService() throws Throwable { |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
224 |
if (!hasJmods()) return; |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
225 |
|
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
226 |
List<String> output = |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
227 |
JLink.run("--module-path", MODULE_PATH, |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
228 |
"--suggest-providers", |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
229 |
"nonExistentType").output(); |
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
230 |
|
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
231 |
List<String> expected = List.of( |
44747
dc7378149f20
8178404: jlink --suggest-providers should list providers from observable modules
mchung
parents:
44367
diff
changeset
|
232 |
"No provider found for service specified to --suggest-providers: nonExistentType" |
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
233 |
); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
234 |
assertTrue(output.containsAll(expected)); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
235 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
236 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
237 |
@Test |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
238 |
public void noSuggestProviders() throws Throwable { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
239 |
if (!hasJmods()) return; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
240 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
241 |
List<String> output = |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
242 |
JLink.run("--module-path", MODULE_PATH, |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
243 |
"--bind-services", |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
244 |
"--suggest-providers").output(); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
245 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
246 |
String expected = "--bind-services option is specified. No additional providers suggested."; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
247 |
assertTrue(output.contains(expected)); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
248 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
249 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
250 |
|
44783
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
251 |
@Test |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
252 |
public void suggestTypeNotRealProvider() throws Throwable { |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
253 |
if (!hasJmods()) return; |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
254 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
255 |
List<String> output = |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
256 |
JLink.run("--module-path", MODULE_PATH, |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
257 |
"--add-modules", "m1", |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
258 |
"--suggest-providers", |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
259 |
"java.util.List").output(); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
260 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
261 |
System.out.println(output); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
262 |
List<String> expected = List.of( |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
263 |
"No provider found for service specified to --suggest-providers: java.util.List" |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
264 |
); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
265 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
266 |
assertTrue(output.containsAll(expected)); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
267 |
} |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
268 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
269 |
@Test |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
270 |
public void addNonObservableModule() throws Throwable { |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
271 |
if (!hasJmods()) return; |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
272 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
273 |
List<String> output = |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
274 |
JLink.run("--module-path", MODULE_PATH, |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
275 |
"--add-modules", "nonExistentModule", |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
276 |
"--suggest-providers", |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
277 |
"java.nio.charset.spi.CharsetProvider").output(); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
278 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
279 |
System.out.println(output); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
280 |
List<String> expected = List.of( |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
281 |
"jdk.charsets provides java.nio.charset.spi.CharsetProvider used by java.base" |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
282 |
); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
283 |
|
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
284 |
assertTrue(output.containsAll(expected)); |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
285 |
} |
1b4068aea6df
8178323: Add negative tests for bind services Jlink feature
anazarov
parents:
44747
diff
changeset
|
286 |
|
44367
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
287 |
static class JLink { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
288 |
static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink") |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
289 |
.orElseThrow(() -> |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
290 |
new RuntimeException("jlink tool not found") |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
291 |
); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
292 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
293 |
static JLink run(String... options) { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
294 |
JLink jlink = new JLink(); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
295 |
assertTrue(jlink.execute(options) == 0); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
296 |
return jlink; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
297 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
298 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
299 |
final List<String> output = new ArrayList<>(); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
300 |
private int execute(String... options) { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
301 |
System.out.println("jlink " + |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
302 |
Stream.of(options).collect(Collectors.joining(" "))); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
303 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
304 |
StringWriter writer = new StringWriter(); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
305 |
PrintWriter pw = new PrintWriter(writer); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
306 |
int rc = JLINK_TOOL.run(pw, pw, options); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
307 |
System.out.println(writer.toString()); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
308 |
Stream.of(writer.toString().split("\\v")) |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
309 |
.map(String::trim) |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
310 |
.forEach(output::add); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
311 |
return rc; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
312 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
313 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
314 |
boolean contains(String s) { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
315 |
return output.contains(s); |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
316 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
317 |
|
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
318 |
List<String> output() { |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
319 |
return output; |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
320 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
321 |
} |
a81c9c6619fb
8174826: jlink support for linking in service provider modules
mchung
parents:
diff
changeset
|
322 |
} |