< prev index next >

test/jdk/java/foreign/enablenativeaccess/TestEnableNativeAccessJarManifest.java

Print this page

  1 /*
  2  * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 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  * @summary Basic test for Enable-Native-Access attribute in the
 27  *          manifest of a main application JAR
 28  * @library /test/lib
 29  * @requires jdk.foreign.linker != "UNSUPPORTED"
 30  * @requires !vm.musl


 31  *
 32  * @enablePreview
 33  * @build TestEnableNativeAccessJarManifest
 34  *        panama_module/*
 35  *        org.openjdk.foreigntest.unnamed.PanamaMainUnnamedModule
 36  * @run testng/native TestEnableNativeAccessJarManifest
 37  */
 38 
 39 import java.nio.file.Files;
 40 import java.nio.file.Path;
 41 import java.nio.file.Paths;
 42 import java.util.List;
 43 import java.util.ArrayList;
 44 import java.util.jar.Attributes;
 45 import java.util.jar.Manifest;
 46 
 47 import jdk.test.lib.process.OutputAnalyzer;
 48 import jdk.test.lib.process.ProcessTools;
 49 import jdk.test.lib.util.JarUtils;
 50 

  1 /*
  2  * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 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  * @summary Basic test for Enable-Native-Access attribute in the
 27  *          manifest of a main application JAR
 28  * @library /test/lib
 29  * @requires jdk.foreign.linker != "UNSUPPORTED"
 30  * @requires !vm.musl
 31  * @comment Disable test for the zero VM config due to 8380059.
 32  * @requires vm.flavor != "zero"
 33  *
 34  * @enablePreview
 35  * @build TestEnableNativeAccessJarManifest
 36  *        panama_module/*
 37  *        org.openjdk.foreigntest.unnamed.PanamaMainUnnamedModule
 38  * @run testng/native TestEnableNativeAccessJarManifest
 39  */
 40 
 41 import java.nio.file.Files;
 42 import java.nio.file.Path;
 43 import java.nio.file.Paths;
 44 import java.util.List;
 45 import java.util.ArrayList;
 46 import java.util.jar.Attributes;
 47 import java.util.jar.Manifest;
 48 
 49 import jdk.test.lib.process.OutputAnalyzer;
 50 import jdk.test.lib.process.ProcessTools;
 51 import jdk.test.lib.util.JarUtils;
 52 
< prev index next >