< prev index next >

test/jdk/java/lang/ProcessHandle/OnExitTest.java

Print this page

  1 /*
  2  * Copyright (c) 2014, 2022, 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 import java.io.IOException;
 25 import java.time.Duration;
 26 import java.time.Instant;
 27 import java.util.ArrayList;
 28 import java.util.List;
 29 import java.util.concurrent.ArrayBlockingQueue;
 30 import java.util.concurrent.CompletableFuture;
 31 import java.util.concurrent.ConcurrentHashMap;
 32 import java.util.concurrent.ExecutionException;
 33 import java.util.concurrent.TimeUnit;
 34 
 35 import jdk.test.lib.Utils;
 36 
 37 import org.testng.annotations.Test;
 38 import org.testng.Assert;
 39 import org.testng.TestNG;
 40 
 41 /*
 42  * @test

 43  * @library /test/lib
 44  * @modules jdk.management
 45  * @build jdk.test.lib.Utils
 46  * @run testng OnExitTest
 47  * @summary Functions of Process.onExit and ProcessHandle.onExit
 48  * @author Roger Riggs
 49  */
 50 
 51 public class OnExitTest extends ProcessUtil {
 52 
 53     @SuppressWarnings("raw_types")
 54     public static void main(String[] args) {
 55         Class<?>[] testclass = { OnExitTest.class};
 56         TestNG testng = new TestNG();
 57         testng.setTestClasses(testclass);
 58         testng.run();
 59     }
 60 
 61     /**
 62      * Basic test of exitValue and onExit.

  1 /*
  2  * Copyright (c) 2014, 2023, 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 import java.io.IOException;
 25 import java.time.Duration;
 26 import java.time.Instant;
 27 import java.util.ArrayList;
 28 import java.util.List;
 29 import java.util.concurrent.ArrayBlockingQueue;
 30 import java.util.concurrent.CompletableFuture;
 31 import java.util.concurrent.ConcurrentHashMap;
 32 import java.util.concurrent.ExecutionException;
 33 import java.util.concurrent.TimeUnit;
 34 
 35 import jdk.test.lib.Utils;
 36 
 37 import org.testng.annotations.Test;
 38 import org.testng.Assert;
 39 import org.testng.TestNG;
 40 
 41 /*
 42  * @test
 43  * @requires vm.flagless
 44  * @library /test/lib
 45  * @modules jdk.management
 46  * @build jdk.test.lib.Utils
 47  * @run testng OnExitTest
 48  * @summary Functions of Process.onExit and ProcessHandle.onExit
 49  * @author Roger Riggs
 50  */
 51 
 52 public class OnExitTest extends ProcessUtil {
 53 
 54     @SuppressWarnings("raw_types")
 55     public static void main(String[] args) {
 56         Class<?>[] testclass = { OnExitTest.class};
 57         TestNG testng = new TestNG();
 58         testng.setTestClasses(testclass);
 59         testng.run();
 60     }
 61 
 62     /**
 63      * Basic test of exitValue and onExit.
< prev index next >