8215991: Stop hiding exception from ArtifactResolver failures in tests
Reviewed-by: tbell, ctornqvi
--- 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);