< prev index next >

test/java/lang/management/ThreadMXBean/ThreadLists.java

Print this page
rev 16783 : 8176176: fix @modules in jdk_svc tests
Reviewed-by: duke


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 5047639
  27  * @summary Check that the "java-level" APIs provide a consistent view of
  28  *          the thread list
  29  * @modules java.management
  30  */
  31 import java.lang.management.ManagementFactory;
  32 import java.lang.management.ThreadMXBean;
  33 import java.util.Map;
  34 
  35 public class ThreadLists {
  36     public static void main(String args[]) {
  37 
  38         // Bug id : JDK-8151797
  39         // Use a lambda expression so that call-site cleaner thread is started
  40         Runnable printLambda = () -> {System.out.println("Starting Test");};
  41         printLambda.run();
  42 
  43         // get top-level thread group
  44         ThreadGroup top = Thread.currentThread().getThreadGroup();
  45         ThreadGroup parent;
  46         do {
  47             parent = top.getParent();
  48             if (parent != null) top = parent;
  49         } while (parent != null);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 5047639
  27  * @summary Check that the "java-level" APIs provide a consistent view of
  28  *          the thread list

  29  */
  30 import java.lang.management.ManagementFactory;
  31 import java.lang.management.ThreadMXBean;
  32 import java.util.Map;
  33 
  34 public class ThreadLists {
  35     public static void main(String args[]) {
  36 
  37         // Bug id : JDK-8151797
  38         // Use a lambda expression so that call-site cleaner thread is started
  39         Runnable printLambda = () -> {System.out.println("Starting Test");};
  40         printLambda.run();
  41 
  42         // get top-level thread group
  43         ThreadGroup top = Thread.currentThread().getThreadGroup();
  44         ThreadGroup parent;
  45         do {
  46             parent = top.getParent();
  47             if (parent != null) top = parent;
  48         } while (parent != null);


< prev index next >