test/hotspot/jtreg/runtime/appcds/UseAppCDS.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff test/hotspot/jtreg/runtime/appcds

test/hotspot/jtreg/runtime/appcds/UseAppCDS.java

Print this page




  70 
  71         ProcessBuilder pb = new ProcessBuilder(jar.getCommand());
  72         TestCommon.executeAndLog(pb, "jar01").shouldHaveExitValue(0);
  73 
  74         pb = new ProcessBuilder(jar.getCommand());
  75         TestCommon.executeAndLog(pb, "jar02").shouldHaveExitValue(0);
  76 
  77         // In all tests the BOOTCLASS should be loaded/dumped/used
  78 
  79         // Test 1: No AppCDS - dumping loaded classes excludes the "test" classes
  80         dumpLoadedClasses(false, new String[] { BOOTCLASS },
  81                           new String[] { TESTNAME });
  82 
  83         // Test 2:    AppCDS - dumping loaded classes includes "test" classes
  84         dumpLoadedClasses(true, new String[] { BOOTCLASS, TESTNAME },
  85                           new String[0]);
  86 
  87         // Next tests rely on the classlist we just dumped
  88 
  89         // Test 3: No AppCDS - "test" classes in classlist ignored when dumping



  90         dumpArchive(false, new String[] { BOOTCLASS },
  91                     new String[] { TESTNAME});
  92 
  93         // Test 4:    AppCDS - "test" classes in classlist are dumped
  94         dumpArchive(true, new String[] { BOOTCLASS, TESTNAME },
  95                     new String[0]);
  96 
  97         // Next tests rely on the archive we just dumped
  98 
  99         // Test 5: No AppCDS - Using archive containing "test" classes ignores them
 100         useArchive(false, new String[] { BOOTCLASS },
 101                    new String[] { TESTNAME });
 102 
 103         // Test 6:    AppCDS - Using archive containing "test" classes loads them
 104         useArchive(true, new String[] { BOOTCLASS, TESTNAME },
 105                    new String[0]);
 106     }
 107 
 108     public static List<String> toClassNames(String filename) throws IOException {
 109         ArrayList<String> classes = new ArrayList<>();
 110         try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filename)))) {
 111             for (; ; ) {




  70 
  71         ProcessBuilder pb = new ProcessBuilder(jar.getCommand());
  72         TestCommon.executeAndLog(pb, "jar01").shouldHaveExitValue(0);
  73 
  74         pb = new ProcessBuilder(jar.getCommand());
  75         TestCommon.executeAndLog(pb, "jar02").shouldHaveExitValue(0);
  76 
  77         // In all tests the BOOTCLASS should be loaded/dumped/used
  78 
  79         // Test 1: No AppCDS - dumping loaded classes excludes the "test" classes
  80         dumpLoadedClasses(false, new String[] { BOOTCLASS },
  81                           new String[] { TESTNAME });
  82 
  83         // Test 2:    AppCDS - dumping loaded classes includes "test" classes
  84         dumpLoadedClasses(true, new String[] { BOOTCLASS, TESTNAME },
  85                           new String[0]);
  86 
  87         // Next tests rely on the classlist we just dumped
  88 
  89         // Test 3: No AppCDS - "test" classes in classlist ignored when dumping
  90         // Although AppCDS isn't used, all classes will be found during dumping
  91         // after the fix for JDK-8193434. Classes which are not in the boot
  92         // loader dictionary will not be saved into the archive.
  93         dumpArchive(false, new String[] { BOOTCLASS },
  94                     new String[0]);
  95 
  96         // Test 4:    AppCDS - "test" classes in classlist are dumped
  97         dumpArchive(true, new String[] { BOOTCLASS, TESTNAME },
  98                     new String[0]);
  99 
 100         // Next tests rely on the archive we just dumped
 101 
 102         // Test 5: No AppCDS - Using archive containing "test" classes ignores them
 103         useArchive(false, new String[] { BOOTCLASS },
 104                    new String[] { TESTNAME });
 105 
 106         // Test 6:    AppCDS - Using archive containing "test" classes loads them
 107         useArchive(true, new String[] { BOOTCLASS, TESTNAME },
 108                    new String[0]);
 109     }
 110 
 111     public static List<String> toClassNames(String filename) throws IOException {
 112         ArrayList<String> classes = new ArrayList<>();
 113         try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filename)))) {
 114             for (; ; ) {


test/hotspot/jtreg/runtime/appcds/UseAppCDS.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File