8215991: Stop hiding exception from ArtifactResolver failures in tests
authorerikj
Thu, 03 Jan 2019 11:21:40 +0100
changeset 53129 3149a923b30e
parent 53128 d3e199e30cfb
child 53130 106fc138542a
child 53131 e412d5c096bc
8215991: Stop hiding exception from ArtifactResolver failures in tests Reviewed-by: tbell, ctornqvi
test/lib/jdk/test/lib/artifacts/ArtifactResolver.java
--- a/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java	Thu Jan 03 02:26:42 2019 +0100
+++ b/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java	Thu Jan 03 11:21:40 2019 +0100
@@ -29,16 +29,18 @@
 
 public class ArtifactResolver {
     public static Map<String, Path> resolve(Class<?> klass) throws ArtifactResolverException {
-        ArtifactManager manager = new DefaultArtifactManager();
+        ArtifactManager manager;
         try {
             String managerName = System.getProperty("jdk.test.lib.artifacts.artifactmanager");
             if (managerName != null) {
                 manager = (ArtifactManager) Class.forName(managerName).newInstance();
             } else if (System.getenv().containsKey(JibArtifactManager.JIB_HOME_ENV_NAME)) {
                 manager = JibArtifactManager.newInstance();
+            } else {
+                manager = new DefaultArtifactManager();
             }
         } catch (Exception e) {
-            // If we end up here, we'll use the DefaultArtifactManager
+            throw new ArtifactResolverException("Failed to load ArtifactManager", e);
         }
 
         ArtifactContainer artifactContainer = klass.getAnnotation(ArtifactContainer.class);