< prev index next >

test/runtime/modules/Xpatch/Xpatch2Dirs.java

Print this page




   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 with multiple directories.
  27  * @modules java.base/jdk.internal.misc
  28  * @library /testlibrary
  29  * @compile Xpatch2DirsMain.java
  30  * @run main Xpatch2Dirs
  31  */
  32 
  33 import jdk.test.lib.*;


  34 import java.io.File;
  35 
  36 public class Xpatch2Dirs {
  37 
  38     public static void main(String[] args) throws Exception {
  39         String source1 = "package javax.naming.spi; "               +
  40                         "public class NamingManager { "             +
  41                         "    static { "                             +
  42                         "        System.out.println(\"I pass one!\"); " +
  43                         "    } "                                    +
  44                         "}";
  45         String source2 = "package java.beans; "                     +
  46                         "public class Encoder { "                   +
  47                         "    static { "                             +
  48                         "        System.out.println(\"I pass two!\"); " +
  49                         "    } "                                    +
  50                         "}";
  51 
  52         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
  53              InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source1, "-Xmodule:java.naming"),


   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 with multiple directories.
  27  * @modules java.base/jdk.internal.misc
  28  * @library /test/lib
  29  * @compile Xpatch2DirsMain.java
  30  * @run main Xpatch2Dirs
  31  */
  32 
  33 import jdk.test.lib.process.ProcessTools;
  34 import jdk.test.lib.process.OutputAnalyzer;
  35 import jdk.test.lib.InMemoryJavaCompiler;
  36 import java.io.File;
  37 
  38 public class Xpatch2Dirs {
  39 
  40     public static void main(String[] args) throws Exception {
  41         String source1 = "package javax.naming.spi; "               +
  42                         "public class NamingManager { "             +
  43                         "    static { "                             +
  44                         "        System.out.println(\"I pass one!\"); " +
  45                         "    } "                                    +
  46                         "}";
  47         String source2 = "package java.beans; "                     +
  48                         "public class Encoder { "                   +
  49                         "    static { "                             +
  50                         "        System.out.println(\"I pass two!\"); " +
  51                         "    } "                                    +
  52                         "}";
  53 
  54         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
  55              InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source1, "-Xmodule:java.naming"),
< prev index next >