< prev index next >

test/jdk/internal/ref/Cleaner/ExitOnThrow.java

Print this page
rev 17326 : imported patch 8181759-2


  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  * @bug 4954921 8009259
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.ref
  29  *          java.base/jdk.internal.misc
  30  * @build jdk.test.lib.*
  31  * @build jdk.test.lib.process.*




  32  * @run main ExitOnThrow
  33  * @summary Ensure that if a cleaner throws an exception then the VM exits
  34  */
  35 import java.util.Arrays;
  36 
  37 import jdk.internal.ref.Cleaner;
  38 import jdk.test.lib.JDKToolLauncher;
  39 import jdk.test.lib.process.OutputAnalyzer;
  40 import jdk.test.lib.process.ProcessTools;
  41 
  42 public class ExitOnThrow {
  43 
  44     static final String cp = System.getProperty("test.classes", ".");
  45 
  46     public static void main(String[] args) throws Exception {
  47         if (args.length == 0) {
  48             String[] cmd = JDKToolLauncher.createUsingTestJDK("java")
  49                                           .addToolArg("-cp")
  50                                           .addToolArg(cp)
  51                                           .addToolArg("ExitOnThrow")




  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  * @bug 4954921 8009259
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.ref
  29  *          java.base/jdk.internal.misc
  30  * @build jdk.test.lib.Utils
  31  *        jdk.test.lib.Asserts
  32  *        jdk.test.lib.JDKToolFinder
  33  *        jdk.test.lib.JDKToolLauncher
  34  *        jdk.test.lib.Platform
  35  *        jdk.test.lib.process.*
  36  * @run main ExitOnThrow
  37  * @summary Ensure that if a cleaner throws an exception then the VM exits
  38  */
  39 import java.util.Arrays;
  40 
  41 import jdk.internal.ref.Cleaner;
  42 import jdk.test.lib.JDKToolLauncher;
  43 import jdk.test.lib.process.OutputAnalyzer;
  44 import jdk.test.lib.process.ProcessTools;
  45 
  46 public class ExitOnThrow {
  47 
  48     static final String cp = System.getProperty("test.classes", ".");
  49 
  50     public static void main(String[] args) throws Exception {
  51         if (args.length == 0) {
  52             String[] cmd = JDKToolLauncher.createUsingTestJDK("java")
  53                                           .addToolArg("-cp")
  54                                           .addToolArg(cp)
  55                                           .addToolArg("ExitOnThrow")


< prev index next >