jdk/test/tools/jlink/IntegrationTest.java
changeset 44367 a81c9c6619fb
parent 44359 c6761862ca0b
child 45004 ea3137042a61
equal deleted inserted replaced
44366:18a7c084f50a 44367:a81c9c6619fb
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    23 
    23 
    24 import java.io.File;
    24 import java.io.File;
    25 import java.io.FileReader;
    25 import java.io.FileReader;
    26 import java.io.IOException;
    26 import java.io.IOException;
    27 import java.io.UncheckedIOException;
    27 import java.io.UncheckedIOException;
       
    28 import java.nio.ByteOrder;
    28 import java.nio.file.Files;
    29 import java.nio.file.Files;
    29 import java.nio.file.Path;
    30 import java.nio.file.Path;
    30 import java.nio.file.Paths;
    31 import java.nio.file.Paths;
    31 import java.util.ArrayList;
    32 import java.util.ArrayList;
    32 import java.util.Collections;
    33 import java.util.Collections;
   133         if (failed) {
   134         if (failed) {
   134             throw new Exception("Should have failed");
   135             throw new Exception("Should have failed");
   135         }
   136         }
   136         System.out.println(jl);
   137         System.out.println(jl);
   137 
   138 
   138         JlinkConfiguration config
       
   139                 = new JlinkConfiguration(null, null, null, null);
       
   140 
       
   141         System.out.println(config);
       
   142 
       
   143         Plugin p = Jlink.newPlugin("toto", Collections.emptyMap(), null);
   139         Plugin p = Jlink.newPlugin("toto", Collections.emptyMap(), null);
   144         if (p != null) {
   140         if (p != null) {
   145             throw new Exception("Plugin should be null");
   141             throw new Exception("Plugin should be null");
   146         }
   142         }
   147 
   143 
   161         Set<String> mods = new HashSet<>();
   157         Set<String> mods = new HashSet<>();
   162         mods.add("java.management");
   158         mods.add("java.management");
   163         Set<String> limits = new HashSet<>();
   159         Set<String> limits = new HashSet<>();
   164         limits.add("java.management");
   160         limits.add("java.management");
   165         JlinkConfiguration config = new Jlink.JlinkConfiguration(output,
   161         JlinkConfiguration config = new Jlink.JlinkConfiguration(output,
   166                 modulePaths, mods, limits, null);
   162                 modulePaths, mods, limits, ByteOrder.nativeOrder());
   167 
   163 
   168         List<Plugin> lst = new ArrayList<>();
   164         List<Plugin> lst = new ArrayList<>();
   169 
   165 
   170         //Strip debug
   166         //Strip debug
   171         {
   167         {