< prev index next >

test/jdk/tools/launcher/modules/illegalaccess/IllegalAccessTest.java

Print this page
rev 51881 : [mq]: 8211171
rev 51882 : [mq]: 8211171-1


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @requires vm.compMode != "Xcomp"
  27  * @modules java.base/jdk.internal.misc
  28  *          java.base/sun.security.x509
  29  * @library /test/lib modules
  30  * @build IllegalAccessTest TryAccess JarUtils
  31  *        jdk.test.lib.compiler.CompilerUtils

  32  * @build m/*
  33  * @run testng/othervm/timeout=180 IllegalAccessTest
  34  * @summary Basic test for java --illegal-access=$VALUE
  35  */
  36 
  37 import java.nio.file.Files;
  38 import java.nio.file.Path;
  39 import java.nio.file.Paths;
  40 import java.util.ArrayList;
  41 import java.util.List;
  42 import java.util.jar.Attributes;
  43 import java.util.jar.Manifest;
  44 import java.util.stream.Stream;
  45 
  46 import jdk.test.lib.compiler.CompilerUtils;
  47 import jdk.test.lib.process.ProcessTools;
  48 import jdk.test.lib.process.OutputAnalyzer;

  49 
  50 import org.testng.annotations.DataProvider;
  51 import org.testng.annotations.Test;
  52 import static org.testng.Assert.*;
  53 
  54 /**
  55  * Basic test of --illegal-access=value to deny or permit access to JDK internals.
  56  */
  57 
  58 @Test
  59 public class IllegalAccessTest {
  60 
  61     static final String TEST_SRC = System.getProperty("test.src");
  62     static final String TEST_CLASSES = System.getProperty("test.classes");
  63     static final String MODULE_PATH = System.getProperty("jdk.module.path");
  64 
  65     /**
  66      * Represents the expected result of a test.
  67      */
  68     static final class Result {




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @requires vm.compMode != "Xcomp"
  27  * @modules java.base/jdk.internal.misc
  28  *          java.base/sun.security.x509
  29  * @library /test/lib modules
  30  * @build IllegalAccessTest TryAccess
  31  *        jdk.test.lib.compiler.CompilerUtils
  32  *        jdk.test.lib.util.JarUtils
  33  * @build m/*
  34  * @run testng/othervm/timeout=180 IllegalAccessTest
  35  * @summary Basic test for java --illegal-access=$VALUE
  36  */
  37 
  38 import java.nio.file.Files;
  39 import java.nio.file.Path;
  40 import java.nio.file.Paths;
  41 import java.util.ArrayList;
  42 import java.util.List;
  43 import java.util.jar.Attributes;
  44 import java.util.jar.Manifest;
  45 import java.util.stream.Stream;
  46 
  47 import jdk.test.lib.compiler.CompilerUtils;
  48 import jdk.test.lib.process.ProcessTools;
  49 import jdk.test.lib.process.OutputAnalyzer;
  50 import jdk.test.lib.util.JarUtils;
  51 
  52 import org.testng.annotations.DataProvider;
  53 import org.testng.annotations.Test;
  54 import static org.testng.Assert.*;
  55 
  56 /**
  57  * Basic test of --illegal-access=value to deny or permit access to JDK internals.
  58  */
  59 
  60 @Test
  61 public class IllegalAccessTest {
  62 
  63     static final String TEST_SRC = System.getProperty("test.src");
  64     static final String TEST_CLASSES = System.getProperty("test.classes");
  65     static final String MODULE_PATH = System.getProperty("jdk.module.path");
  66 
  67     /**
  68      * Represents the expected result of a test.
  69      */
  70     static final class Result {


< prev index next >