--- /dev/null 2012-09-06 08:53:01.422600655 -0400 +++ new/./test/java/lang/Process/GetProcessInfo.java 2012-09-07 14:37:52.011436485 -0400 @@ -0,0 +1,16 @@ +public class GetProcessInfo { + + public static void main(String... args) { + int pid = Process.getCurrentPid(); + System.out.println( " PID = " + pid ); + if (pid <= 0) { + throw new Exception("Test Failed: Invalid current PID: " + pid); + } + + String currentProcessName = new Process().getCurrentProcessName(); + String currentProcessNameByPid = new Process().getProcessName( pid ); + if (!currentProcessName.equals(currentProcessNameByPid)) { + throw new Exception("Test Failed: current process name ( " + currentProcessName + " ) does not match process name by pid ( " + currentProcessNameByPid + " )"); + } + } +}