mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8177530: Module system implementation refresh (4/2017)
Co-authored-by: Harold Seigel <harold.seigel@oracle.com> Co-authored-by: Mandy Chung <mandy.chung@oracle.com> Reviewed-by: lfoltan, sspitsyn
This commit is contained in:
parent
4ffa7d7bfc
commit
a3ab143c64
90 changed files with 477 additions and 464 deletions
|
@ -25,7 +25,6 @@
|
|||
|
||||
import static jdk.test.lib.Asserts.*;
|
||||
|
||||
import java.lang.reflect.Layer;
|
||||
import java.lang.module.Configuration;
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
import java.lang.module.ModuleFinder;
|
||||
|
@ -45,7 +44,7 @@ import java.util.Set;
|
|||
//
|
||||
public class ModuleSameCLMain {
|
||||
|
||||
// Create a Layer over the boot layer.
|
||||
// Create a layer over the boot layer.
|
||||
// Define modules within this layer to test access between
|
||||
// publically defined classes within packages of those modules.
|
||||
public void createLayerOnBoot() throws Throwable {
|
||||
|
@ -75,7 +74,7 @@ public class ModuleSameCLMain {
|
|||
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
|
||||
|
||||
// Resolves "m1x"
|
||||
Configuration cf = Layer.boot()
|
||||
Configuration cf = ModuleLayer.boot()
|
||||
.configuration()
|
||||
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
|
||||
|
||||
|
@ -85,8 +84,8 @@ public class ModuleSameCLMain {
|
|||
map.put("m1x", cl1);
|
||||
map.put("m2x", cl1);
|
||||
|
||||
// Create Layer that contains m1x & m2x
|
||||
Layer layer = Layer.boot().defineModules(cf, map::get);
|
||||
// Create layer that contains m1x & m2x
|
||||
ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
|
||||
assertTrue(layer.findLoader("m1x") == cl1);
|
||||
assertTrue(layer.findLoader("m2x") == cl1);
|
||||
assertTrue(layer.findLoader("java.base") == null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue