31 import java.util.Optional;
32 import java.util.Set;
33 import java.util.concurrent.ConcurrentHashMap;
34 import java.util.concurrent.CountDownLatch;
35 import java.util.concurrent.ExecutionException;
36 import java.util.concurrent.TimeUnit;
37 import java.util.stream.Collectors;
38 import java.util.stream.Stream;
39
40 import jdk.test.lib.Utils;
41 import org.testng.Assert;
42 import org.testng.TestNG;
43 import org.testng.annotations.Test;
44
45 /*
46 * @test
47 * @library /test/lib
48 * @modules java.base/jdk.internal.misc
49 * jdk.management
50 * @build jdk.test.lib.Utils
51 * @run testng/othervm TreeTest
52 * @summary Test counting and JavaChild.spawning and counting of Processes.
53 * @author Roger Riggs
54 */
55 public class TreeTest extends ProcessUtil {
56 // Main can be used to run the tests from the command line with only testng.jar.
57 @SuppressWarnings("raw_types")
58 public static void main(String[] args) {
59 Class<?>[] testclass = {TreeTest.class};
60 TestNG testng = new TestNG();
61 testng.setTestClasses(testclass);
62 testng.run();
63 }
64
65 /**
66 * Test counting and spawning and counting of Processes.
67 */
68 @Test
69 public static void test1() {
70 final int MAXCHILDREN = 2;
|
31 import java.util.Optional;
32 import java.util.Set;
33 import java.util.concurrent.ConcurrentHashMap;
34 import java.util.concurrent.CountDownLatch;
35 import java.util.concurrent.ExecutionException;
36 import java.util.concurrent.TimeUnit;
37 import java.util.stream.Collectors;
38 import java.util.stream.Stream;
39
40 import jdk.test.lib.Utils;
41 import org.testng.Assert;
42 import org.testng.TestNG;
43 import org.testng.annotations.Test;
44
45 /*
46 * @test
47 * @library /test/lib
48 * @modules java.base/jdk.internal.misc
49 * jdk.management
50 * @build jdk.test.lib.Utils
51 * jdk.test.lib.Asserts
52 * jdk.test.lib.JDKToolFinder
53 * jdk.test.lib.JDKToolLauncher
54 * jdk.test.lib.Platform
55 * jdk.test.lib.process.*
56 * @run testng/othervm TreeTest
57 * @summary Test counting and JavaChild.spawning and counting of Processes.
58 * @author Roger Riggs
59 */
60 public class TreeTest extends ProcessUtil {
61 // Main can be used to run the tests from the command line with only testng.jar.
62 @SuppressWarnings("raw_types")
63 public static void main(String[] args) {
64 Class<?>[] testclass = {TreeTest.class};
65 TestNG testng = new TestNG();
66 testng.setTestClasses(testclass);
67 testng.run();
68 }
69
70 /**
71 * Test counting and spawning and counting of Processes.
72 */
73 @Test
74 public static void test1() {
75 final int MAXCHILDREN = 2;
|