< prev index next >

test/hotspot/jtreg/gc/TestAllocateHeapAtError.java

8217332: JTREG: Clean up, use generics instead of raw types

24 
25 /* @test TestAllocateHeapAtError.java                                                                                      
26  * @key gc                                                                                                                 
27  * @summary Test to check correct handling of non-existent directory passed to AllocateHeapAt option                       
28  * @requires vm.gc != "Z" & os.family != "aix"                                                                             
29  * @library /test/lib                                                                                                      
30  * @modules java.base/jdk.internal.misc                                                                                    
31  * @run main gc.TestAllocateHeapAtError                                                                                    
32  */                                                                                                                        
33 
34 import java.io.File;                                                                                                       
35 import jdk.test.lib.JDKToolFinder;                                                                                         
36 import jdk.test.lib.process.ProcessTools;                                                                                  
37 import jdk.test.lib.process.OutputAnalyzer;                                                                                
38 import java.util.ArrayList;                                                                                                
39 import java.util.Collections;                                                                                              
40 import java.util.UUID;                                                                                                     
41 
42 public class TestAllocateHeapAtError {                                                                                     
43   public static void main(String args[]) throws Exception {                                                                
44     ArrayList<String> vmOpts = new ArrayList();                                                                            
45 
46     String testVmOptsStr = System.getProperty("test.java.opts");                                                           
47     if (!testVmOptsStr.isEmpty()) {                                                                                        
48       String[] testVmOpts = testVmOptsStr.split(" ");                                                                      
49       Collections.addAll(vmOpts, testVmOpts);                                                                              
50     }                                                                                                                      
51     String test_dir = System.getProperty("test.dir", ".");                                                                 
52 
53     File f = null;                                                                                                         
54     do {                                                                                                                   
55       f = new File(test_dir, UUID.randomUUID().toString());                                                                
56     } while(f.exists());                                                                                                   
57 
58     Collections.addAll(vmOpts, new String[] {"-XX:AllocateHeapAt=" + f.getName(),                                          
59                                              "-Xlog:gc+heap=info",                                                         
60                                              "-Xmx32m",                                                                    
61                                              "-Xms32m",                                                                    
62                                              "-version"});                                                                 
63 

24 
25 /* @test TestAllocateHeapAtError.java
26  * @key gc
27  * @summary Test to check correct handling of non-existent directory passed to AllocateHeapAt option
28  * @requires vm.gc != "Z" & os.family != "aix"
29  * @library /test/lib
30  * @modules java.base/jdk.internal.misc
31  * @run main gc.TestAllocateHeapAtError
32  */
33 
34 import java.io.File;
35 import jdk.test.lib.JDKToolFinder;
36 import jdk.test.lib.process.ProcessTools;
37 import jdk.test.lib.process.OutputAnalyzer;
38 import java.util.ArrayList;
39 import java.util.Collections;
40 import java.util.UUID;
41 
42 public class TestAllocateHeapAtError {
43   public static void main(String args[]) throws Exception {
44     ArrayList<String> vmOpts = new ArrayList<>();
45 
46     String testVmOptsStr = System.getProperty("test.java.opts");
47     if (!testVmOptsStr.isEmpty()) {
48       String[] testVmOpts = testVmOptsStr.split(" ");
49       Collections.addAll(vmOpts, testVmOpts);
50     }
51     String test_dir = System.getProperty("test.dir", ".");
52 
53     File f = null;
54     do {
55       f = new File(test_dir, UUID.randomUUID().toString());
56     } while(f.exists());
57 
58     Collections.addAll(vmOpts, new String[] {"-XX:AllocateHeapAt=" + f.getName(),
59                                              "-Xlog:gc+heap=info",
60                                              "-Xmx32m",
61                                              "-Xms32m",
62                                              "-version"});
63 
< prev index next >