< prev index next >

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

Print this page
rev 48002 : imported patch 8188791-open-appcds.v02.patch
rev 48005 : Tests addon for 8188791 which enables AppCDS / CustomClassLoader tests on all 64-bit Linux and Solaris platforms


 307 
 308     public static String getTestJar(String jar) {
 309         File jarFile = CDSTestUtils.getTestArtifact(jar, true);
 310         if (!jarFile.isFile()) {
 311             throw new RuntimeException("Not a regular file: " + jarFile.getPath());
 312         }
 313         return jarFile.getPath();
 314     }
 315 
 316 
 317     public static String getTestDir(String d) {
 318         File dirFile = CDSTestUtils.getTestArtifact(d, true);
 319         if (!dirFile.isDirectory()) {
 320             throw new RuntimeException("Not a directory: " + dirFile.getPath());
 321         }
 322         return dirFile.getPath();
 323     }
 324 
 325 
 326     // Returns true if custom loader is supported, based on a platform.
 327     // Custom loader AppCDS is only supported for Linux-x64 and Solaris.
 328     public static boolean isCustomLoaderSupported() {
 329         boolean isLinux = Platform.isLinux();
 330         boolean isX64 = Platform.isX64();
 331         boolean isSolaris = Platform.isSolaris();

 332 
 333         System.out.println("isCustomLoaderSupported: isX64 = " + isX64);
 334         System.out.println("isCustomLoaderSupported: isLinux = " + isLinux);
 335         System.out.println("isCustomLoaderSupported: isSolaris = " + isSolaris);

 336 
 337         return ((isX64 && isLinux) || isSolaris);
 338     }
 339 }


 307 
 308     public static String getTestJar(String jar) {
 309         File jarFile = CDSTestUtils.getTestArtifact(jar, true);
 310         if (!jarFile.isFile()) {
 311             throw new RuntimeException("Not a regular file: " + jarFile.getPath());
 312         }
 313         return jarFile.getPath();
 314     }
 315 
 316 
 317     public static String getTestDir(String d) {
 318         File dirFile = CDSTestUtils.getTestArtifact(d, true);
 319         if (!dirFile.isDirectory()) {
 320             throw new RuntimeException("Not a directory: " + dirFile.getPath());
 321         }
 322         return dirFile.getPath();
 323     }
 324 
 325 
 326     // Returns true if custom loader is supported, based on a platform.
 327     // Custom loader AppCDS is only supported for 64-bit Linux and Solaris.
 328     public static boolean isCustomLoaderSupported() {
 329         boolean isLinux = Platform.isLinux();
 330         boolean is64 = Platform.is64bit();
 331         boolean isSolaris = Platform.isSolaris();
 332         boolean isAix = Platform.isAix();
 333 
 334         System.out.println("isCustomLoaderSupported: is64 = " + is64);
 335         System.out.println("isCustomLoaderSupported: isLinux = " + isLinux);
 336         System.out.println("isCustomLoaderSupported: isSolaris = " + isSolaris);
 337         System.out.println("isCustomLoaderSupported: isAix = " + isAix);
 338 
 339         return (is64 && (isLinux || isSolaris || isAix));
 340     }
 341 }
< prev index next >