changeset 56432:26f71e24dd24

8228650: runtime/SharedArchiveFile/CheckDefaultArchiveFile.java test fails on AIX Reviewed-by: mseledtsov
author mbaesken
date Fri, 26 Jul 2019 15:05:24 +0200
parents 152cd40a1d36
children bcc706c719d7
files test/hotspot/jtreg/runtime/SharedArchiveFile/CheckDefaultArchiveFile.java
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/CheckDefaultArchiveFile.java	Thu Aug 01 08:59:31 2019 +0200
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/CheckDefaultArchiveFile.java	Fri Jul 26 15:05:24 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,16 +48,23 @@
         String vmName = System.getProperty("java.vm.name");
         String vmString = vmName + "(" + osArch + ")";
         String jsaString = wb.getDefaultArchivePath();
-        Path jsa = Paths.get(jsaString);
-        if (Platform.isDefaultCDSArchiveSupported()) {
-            if (Files.exists(jsa)) {
-                System.out.println("Passed. " + vmString +
-                                   ": has default classes.jsa file");
-            } else {
-                throw new RuntimeException(vmString + "has no " + jsaString);
+        System.out.println("classes.jsa location:" + jsaString);
+        if (jsaString == null) {
+            if (Platform.isDefaultCDSArchiveSupported()) {
+                throw new RuntimeException("default CDS archive supported, but classes.jsa path null");
             }
         } else {
-            throw new SkippedException("Default CDS archive is not supported");
+            Path jsa = Paths.get(jsaString);
+            if (Platform.isDefaultCDSArchiveSupported()) {
+                if (Files.exists(jsa)) {
+                    System.out.println("Passed. " + vmString +
+                                       ": has default classes.jsa file");
+                } else {
+                    throw new RuntimeException(vmString + "has no " + jsaString);
+                }
+            } else {
+                throw new SkippedException("Default CDS archive is not supported");
+            }
         }
     }
 }