< prev index next >

test/java/lang/ProcessHandle/InfoTest.java

Print this page
rev 17272 : 8181391: remove explicit @build actions for the top level testlibary classes
Reviewed-by: duke


  34 import java.util.ArrayList;
  35 import java.util.Arrays;
  36 import java.util.List;
  37 import java.util.Objects;
  38 import java.util.Optional;
  39 import java.util.Random;
  40 import java.util.concurrent.TimeUnit;
  41 
  42 import jdk.test.lib.Platform;
  43 import jdk.test.lib.Utils;
  44 import org.testng.Assert;
  45 import org.testng.TestNG;
  46 import org.testng.annotations.Test;
  47 
  48 /*
  49  * @test
  50  * @bug 8077350 8081566 8081567 8098852 8136597
  51  * @library /test/lib
  52  * @modules java.base/jdk.internal.misc
  53  *          jdk.management
  54  * @build jdk.test.lib.Platform jdk.test.lib.Utils
  55  * @run testng InfoTest
  56  * @summary Functions of ProcessHandle.Info
  57  * @author Roger Riggs
  58  */
  59 
  60 public class InfoTest {
  61 
  62     static String whoami;
  63 
  64     static {
  65         try {
  66             // Create a file and take the username from the file
  67             Path p = Paths.get("OwnerName.tmp");
  68             Files.createFile(p);
  69             UserPrincipal owner = Files.getOwner(p);
  70             whoami = owner.getName();
  71             Files.delete(p);
  72         } catch (IOException ex) {
  73             ex.printStackTrace();
  74             throw new UncheckedIOException("tmp file", ex);




  34 import java.util.ArrayList;
  35 import java.util.Arrays;
  36 import java.util.List;
  37 import java.util.Objects;
  38 import java.util.Optional;
  39 import java.util.Random;
  40 import java.util.concurrent.TimeUnit;
  41 
  42 import jdk.test.lib.Platform;
  43 import jdk.test.lib.Utils;
  44 import org.testng.Assert;
  45 import org.testng.TestNG;
  46 import org.testng.annotations.Test;
  47 
  48 /*
  49  * @test
  50  * @bug 8077350 8081566 8081567 8098852 8136597
  51  * @library /test/lib
  52  * @modules java.base/jdk.internal.misc
  53  *          jdk.management

  54  * @run testng InfoTest
  55  * @summary Functions of ProcessHandle.Info
  56  * @author Roger Riggs
  57  */
  58 
  59 public class InfoTest {
  60 
  61     static String whoami;
  62 
  63     static {
  64         try {
  65             // Create a file and take the username from the file
  66             Path p = Paths.get("OwnerName.tmp");
  67             Files.createFile(p);
  68             UserPrincipal owner = Files.getOwner(p);
  69             whoami = owner.getName();
  70             Files.delete(p);
  71         } catch (IOException ex) {
  72             ex.printStackTrace();
  73             throw new UncheckedIOException("tmp file", ex);


< prev index next >