< prev index next >

test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java

Print this page
rev 48034 : 8191564: Refactor GC related servicability code into GC specific subclasses
Reviewed-by: ehelin, eosterlund
rev 48035 : [mq]: 8191564.08.patch


  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 import java.util.List;
  25 import java.util.ArrayList;
  26 import java.lang.management.*;
  27 import static jdk.test.lib.Asserts.*;
  28 import java.util.stream.*;
  29 
  30 /* @test TestMemoryMXBeansAndPoolsPresence
  31  * @bug 8191564
  32  * @summary Tests that GarbageCollectorMXBeans and GC MemoryPools are created.
  33  * @library /test/lib
  34  * @modules java.base/jdk.internal.misc
  35  *          java.management

  36  * @run main/othervm -XX:+UseG1GC TestMemoryMXBeansAndPoolsPresence G1
  37  * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
  38  * @run main/othervm -XX:+UseParallelGC TestMemoryMXBeansAndPoolsPresence Parallel
  39  * @run main/othervm -XX:+UseSerialGC TestMemoryMXBeansAndPoolsPresence Serial
  40  */
  41 
  42 class GCBeanDescription {
  43     public String name;
  44     public String[] poolNames;
  45 
  46     public GCBeanDescription(String name, String[] poolNames) {
  47         this.name = name;
  48         this.poolNames = poolNames;
  49     }
  50 }
  51 
  52 public class TestMemoryMXBeansAndPoolsPresence {
  53     public static void test(GCBeanDescription... expectedBeans) {
  54         List<MemoryPoolMXBean> memoryPools = ManagementFactory.getMemoryPoolMXBeans();
  55 




  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 import java.util.List;
  25 import java.util.ArrayList;
  26 import java.lang.management.*;
  27 import static jdk.test.lib.Asserts.*;
  28 import java.util.stream.*;
  29 
  30 /* @test TestMemoryMXBeansAndPoolsPresence
  31  * @bug 8191564
  32  * @summary Tests that GarbageCollectorMXBeans and GC MemoryPools are created.
  33  * @library /test/lib
  34  * @modules java.base/jdk.internal.misc
  35  *          java.management
  36  * @requires vm.gc == null
  37  * @run main/othervm -XX:+UseG1GC TestMemoryMXBeansAndPoolsPresence G1
  38  * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
  39  * @run main/othervm -XX:+UseParallelGC TestMemoryMXBeansAndPoolsPresence Parallel
  40  * @run main/othervm -XX:+UseSerialGC TestMemoryMXBeansAndPoolsPresence Serial
  41  */
  42 
  43 class GCBeanDescription {
  44     public String name;
  45     public String[] poolNames;
  46 
  47     public GCBeanDescription(String name, String[] poolNames) {
  48         this.name = name;
  49         this.poolNames = poolNames;
  50     }
  51 }
  52 
  53 public class TestMemoryMXBeansAndPoolsPresence {
  54     public static void test(GCBeanDescription... expectedBeans) {
  55         List<MemoryPoolMXBean> memoryPools = ManagementFactory.getMemoryPoolMXBeans();
  56 


< prev index next >