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 Make sure -Xpatch works when a jar file and a directory is specified for a module 27 * @library /testlibrary 28 * @modules java.base/jdk.internal.misc 29 * jdk.jartool/sun.tools.jar 30 * @build BasicJarBuilder 31 * @compile Xpatch2DirsMain.java 32 * @run main XpatchTestJarDir 33 */ 34 35 import java.io.File; 36 import java.nio.file.Files; 37 import jdk.test.lib.*; 38 39 public class XpatchTestJarDir { 40 private static String moduleJar; 41 42 public static void main(String[] args) throws Exception { 43 44 // Create a class file in the module java.naming. This class file 45 // will be put in the javanaming.jar file. 46 String source = "package javax.naming.spi; " + 47 "public class NamingManager1 { " + 48 " static { " + 49 " System.out.println(\"I pass one!\"); " + 50 " } " + 51 "}"; 52 53 ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1", 54 InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"), 55 System.getProperty("test.classes")); 56 57 // Build the jar file that will be used for the module "java.naming". | 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 Make sure -Xpatch works when a jar file and a directory is specified for a module 27 * @library /test/lib 28 * @modules java.base/jdk.internal.misc 29 * jdk.jartool/sun.tools.jar 30 * @compile Xpatch2DirsMain.java 31 * @run main XpatchTestJarDir 32 */ 33 34 import java.io.File; 35 import java.nio.file.Files; 36 import jdk.test.lib.process.ProcessTools; 37 import jdk.test.lib.process.OutputAnalyzer; 38 import jdk.test.lib.InMemoryJavaCompiler; 39 40 public class XpatchTestJarDir { 41 private static String moduleJar; 42 43 public static void main(String[] args) throws Exception { 44 45 // Create a class file in the module java.naming. This class file 46 // will be put in the javanaming.jar file. 47 String source = "package javax.naming.spi; " + 48 "public class NamingManager1 { " + 49 " static { " + 50 " System.out.println(\"I pass one!\"); " + 51 " } " + 52 "}"; 53 54 ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1", 55 InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"), 56 System.getProperty("test.classes")); 57 58 // Build the jar file that will be used for the module "java.naming". |