diff --git a/wrangler-core/src/test/java/io/cdap/directives/validation/ValidateStandardTest.java b/wrangler-core/src/test/java/io/cdap/directives/validation/ValidateStandardTest.java index fac05025e..d153d3f53 100644 --- a/wrangler-core/src/test/java/io/cdap/directives/validation/ValidateStandardTest.java +++ b/wrangler-core/src/test/java/io/cdap/directives/validation/ValidateStandardTest.java @@ -50,31 +50,32 @@ public class ValidateStandardTest { private static Map getSpecsInArchive() - throws IOException, NoSuchAlgorithmException { - Map schemas = new HashMap<>(); - CodeSource src = ValidateStandard.class.getProtectionDomain().getCodeSource(); - if (src != null) { - File schemasRoot = - Paths.get(src.getLocation().getPath(), ValidateStandard.SCHEMAS_RESOURCE_PATH).toFile(); - - if (!schemasRoot.isDirectory()) { - throw new IOException( - String.format("Schemas root %s was not a directory", schemasRoot.getPath())); - } - - for (File f : schemasRoot.listFiles()) { - if (f.toPath().endsWith(ValidateStandard.MANIFEST_PATH)) { - continue; - } + throws IOException, NoSuchAlgorithmException { + Map schemas = new HashMap<>(); + CodeSource src = ValidateStandard.class.getProtectionDomain().getCodeSource(); + if (src != null) { + File schemasRoot = + new File(src.getLocation().getPath(), ValidateStandard.SCHEMAS_RESOURCE_PATH); + + if (!schemasRoot.isDirectory()) { + throw new IOException( + String.format("Schemas root %s was not a directory", schemasRoot.getPath())); + } - String hash = calcHash(new FileInputStream(f)); - schemas.put( - FilenameUtils.getBaseName(f.getName()), - new Standard(hash, FilenameUtils.getExtension(f.getName()))); + for (File f : schemasRoot.listFiles()) { + if (f.toPath().endsWith(ValidateStandard.MANIFEST_PATH)) { + continue; } + + String hash = calcHash(new FileInputStream(f)); + schemas.put( + FilenameUtils.getBaseName(f.getName()), + new Standard(hash, FilenameUtils.getExtension(f.getName()))); } + } + + return schemas; - return schemas; } private static String calcHash(InputStream is) throws IOException, NoSuchAlgorithmException {