< prev index next >

test/java/lang/ProcessHandle/InfoTest.java

Print this page
rev 17324 : 8181759: add explicit @build actions for jdk.test.lib classes in all :tier1 tests
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  * @build jdk.test.lib.Utils
  55  *        jdk.test.lib.Asserts
  56  *        jdk.test.lib.JDKToolFinder
  57  *        jdk.test.lib.JDKToolLauncher
  58  *        jdk.test.lib.Platform
  59  *        jdk.test.lib.process.*
  60  * @run testng InfoTest
  61  * @summary Functions of ProcessHandle.Info
  62  * @author Roger Riggs
  63  */
  64 
  65 public class InfoTest {
  66 
  67     static String whoami;
  68 
  69     static {
  70         try {
  71             // Create a file and take the username from the file
  72             Path p = Paths.get("OwnerName.tmp");
  73             Files.createFile(p);
  74             UserPrincipal owner = Files.getOwner(p);
  75             whoami = owner.getName();
  76             Files.delete(p);
  77         } catch (IOException ex) {
  78             ex.printStackTrace();
  79             throw new UncheckedIOException("tmp file", ex);


< prev index next >