changeset 13427:adfeb1434d90

8146574: (process) ProcessHandle test cleanup Reviewed-by: chegar
author rriggs
date Thu, 07 Jan 2016 10:10:06 -0500
parents 2f829a220cda
children 77259f6707d6
files test/java/lang/ProcessHandle/Basic.java test/java/lang/ProcessHandle/InfoTest.java test/java/lang/ProcessHandle/OnExitTest.java test/java/lang/ProcessHandle/PermissionTest.java test/java/lang/ProcessHandle/ProcessUtil.java test/java/lang/ProcessHandle/TEST.properties test/java/lang/ProcessHandle/TreeTest.java
diffstat 7 files changed, 30 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/ProcessHandle/Basic.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/Basic.java	Thu Jan 07 10:10:06 2016 -0500
@@ -27,8 +27,8 @@
 import static org.testng.Assert.fail;
 
 import java.io.IOException;
+import java.util.List;
 import java.util.Optional;
-import java.util.List;
 import java.util.stream.Collectors;
 
 import org.testng.TestNG;
@@ -36,6 +36,8 @@
 
 /*
  * @test
+ * @library /test/lib/share/classes
+ * @run testng InfoTest
  * @summary Basic tests for ProcessHandler
  * @author Roger Riggs
  */
--- a/test/java/lang/ProcessHandle/InfoTest.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/InfoTest.java	Thu Jan 07 10:10:06 2016 -0500
@@ -21,11 +21,10 @@
  * questions.
  */
 
+import java.io.BufferedReader;
 import java.io.File;
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.UncheckedIOException;
-import java.lang.ProcessBuilder;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -40,18 +39,18 @@
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
 
-import jdk.testlibrary.Platform;
-import jdk.testlibrary.Utils;
-
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
 import org.testng.Assert;
+import org.testng.TestNG;
 import org.testng.annotations.Test;
-import org.testng.TestNG;
 
 /*
  * @test
  * @bug 8077350 8081566 8081567 8098852 8136597
- * @build jdk.testlibrary.*
- * @library /lib/testlibrary
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @run testng InfoTest
  * @summary Functions of ProcessHandle.Info
  * @author Roger Riggs
  * @key intermittent
--- a/test/java/lang/ProcessHandle/OnExitTest.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/OnExitTest.java	Thu Jan 07 10:10:06 2016 -0500
@@ -22,7 +22,6 @@
  */
 
 import java.io.IOException;
-import java.lang.InterruptedException;
 import java.time.Duration;
 import java.time.Instant;
 import java.util.ArrayList;
@@ -31,7 +30,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
 
-import jdk.testlibrary.Utils;
+import jdk.test.lib.Utils;
 
 import org.testng.annotations.Test;
 import org.testng.Assert;
@@ -39,7 +38,9 @@
 
 /*
  * @test
- * @build jdk.testlibrary.Utils
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @run testng OnExitTest
  * @summary Functions of Process.onExit and ProcessHandle.onExit
  * @author Roger Riggs
  */
--- a/test/java/lang/ProcessHandle/PermissionTest.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/PermissionTest.java	Thu Jan 07 10:10:06 2016 -0500
@@ -31,7 +31,6 @@
 import java.security.ProtectionDomain;
 import java.security.SecurityPermission;
 import java.util.Arrays;
-import java.util.Optional;
 import java.util.PropertyPermission;
 
 import org.testng.Assert;
@@ -39,6 +38,12 @@
 import org.testng.annotations.BeforeGroups;
 import org.testng.annotations.Test;
 
+/*
+ * @test
+ * @run testng/othervm PermissionTest
+ * @summary Test Permissions to access Info
+ */
+
 public class PermissionTest {
     /**
      * Backing up policy.
--- a/test/java/lang/ProcessHandle/ProcessUtil.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/ProcessUtil.java	Thu Jan 07 10:10:06 2016 -0500
@@ -23,18 +23,13 @@
 
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
-import java.lang.ProcessBuilder;
 import java.time.Duration;
 import java.util.List;
-import java.util.Objects;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import com.sun.management.OperatingSystemMXBean;
-
-import jdk.testlibrary.Platform;
-
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
+import jdk.test.lib.Platform;
 
 /**
  * Useful utilities for testing Process and ProcessHandle.
--- a/test/java/lang/ProcessHandle/TEST.properties	Fri Dec 18 16:06:26 2015 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# ProcessHandle tests use TestNG
-TestNG.dirs = .
-lib.dirs = /lib/testlibrary
-modules = jdk.management
--- a/test/java/lang/ProcessHandle/TreeTest.java	Fri Dec 18 16:06:26 2015 +0530
+++ b/test/java/lang/ProcessHandle/TreeTest.java	Thu Jan 07 10:10:06 2016 -0500
@@ -23,30 +23,31 @@
 
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.time.Duration;
 import java.time.Instant;
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import java.util.concurrent.ExecutionException;
-import jdk.testlibrary.Utils;
+
+import jdk.test.lib.Utils;
 import org.testng.Assert;
 import org.testng.TestNG;
 import org.testng.annotations.Test;
 
 /*
  * @test
- * @library /lib/testlibrary
- * Test counting and JavaChild.spawning and counting of Processes.
- * @run testng/othervm InfoTest
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Utils
+ * @run testng/othervm TreeTest
+ * @summary Test counting and JavaChild.spawning and counting of Processes.
  * @key intermittent
  * @author Roger Riggs
  */