< prev index next >

test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java

8224659: Parallel GC: Use WorkGang (1: PCRefProcTask)

38 import jdk.test.lib.process.OutputAnalyzer;                                                                                
39 import jtreg.SkippedException;                                                                                             
40 import sun.hotspot.gc.GC;                                                                                                  
41 
42 public class TestInitialGCThreadLogging {                                                                                  
43   public static void main(String[] args) throws Exception {                                                                
44     boolean noneGCSupported = true;                                                                                        
45 
46     if (GC.ConcMarkSweep.isSupported()) {                                                                                  
47       noneGCSupported = false;                                                                                             
48       testInitialGCThreadLogging("UseConcMarkSweepGC", "GC Thread");                                                       
49     }                                                                                                                      
50 
51     if (GC.G1.isSupported()) {                                                                                             
52       noneGCSupported = false;                                                                                             
53       testInitialGCThreadLogging("UseG1GC", "GC Thread");                                                                  
54     }                                                                                                                      
55 
56     if (GC.Parallel.isSupported()) {                                                                                       
57       noneGCSupported = false;                                                                                             
58       testInitialGCThreadLogging("UseParallelGC", "ParGC Thread");                                                         
59     }                                                                                                                      
60 
61     if (GC.Shenandoah.isSupported()) {                                                                                     
62       noneGCSupported = false;                                                                                             
63       testInitialGCThreadLogging("UseShenandoahGC", "Shenandoah GC Thread");                                               
64     }                                                                                                                      
65 
66     if (noneGCSupported) {                                                                                                 
67       throw new SkippedException("Skipping test because none of ConcMarkSweep/G1/Parallel/Shenandoah is supported.");      
68     }                                                                                                                      
69   }                                                                                                                        
70 
71   private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output, String threadName) {                           
72     output.shouldHaveExitValue(0); // test should run succesfully                                                          
73     output.shouldContain(threadName);                                                                                      
74   }                                                                                                                        
75 
76   private static void testInitialGCThreadLogging(String gcFlag, String threadName) throws Exception {                      
77     // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled                                                       

38 import jdk.test.lib.process.OutputAnalyzer;
39 import jtreg.SkippedException;
40 import sun.hotspot.gc.GC;
41 
42 public class TestInitialGCThreadLogging {
43   public static void main(String[] args) throws Exception {
44     boolean noneGCSupported = true;
45 
46     if (GC.ConcMarkSweep.isSupported()) {
47       noneGCSupported = false;
48       testInitialGCThreadLogging("UseConcMarkSweepGC", "GC Thread");
49     }
50 
51     if (GC.G1.isSupported()) {
52       noneGCSupported = false;
53       testInitialGCThreadLogging("UseG1GC", "GC Thread");
54     }
55 
56     if (GC.Parallel.isSupported()) {
57       noneGCSupported = false;
58       testInitialGCThreadLogging("UseParallelGC", "GC Thread");
59     }
60 
61     if (GC.Shenandoah.isSupported()) {
62       noneGCSupported = false;
63       testInitialGCThreadLogging("UseShenandoahGC", "Shenandoah GC Thread");
64     }
65 
66     if (noneGCSupported) {
67       throw new SkippedException("Skipping test because none of ConcMarkSweep/G1/Parallel/Shenandoah is supported.");
68     }
69   }
70 
71   private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output, String threadName) {
72     output.shouldHaveExitValue(0); // test should run succesfully
73     output.shouldContain(threadName);
74   }
75 
76   private static void testInitialGCThreadLogging(String gcFlag, String threadName) throws Exception {
77     // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled
< prev index next >