@Test public void testAllResolvedManifests() throws Exception { Map<String, String> expected = new HashMap<>(); expected.put("sqliteiOS", "'sqliteiOS' does not have archive"); expected.put("sqliteAndroid", "'sqliteAndroid' does not have archive"); expected.put("sqliteLinuxMultiple", "'sqliteLinuxMultiple' does not have archive"); expected.put("sqliteLinux", "'sqliteLinux' does not have archive"); expected.put("sqlite", "'sqlite' does not have archive"); expected.put("archiveMissingFile", "'archiveMissingFile' does not have archive.include.file"); expected.put("singleABI", "'singleABI' does not have archive"); expected.put("singleABISqlite", "'singleABISqlite' does not have archive"); expected.put("archiveMissingSha256", "'archiveMissingSha256' does not have archive.include"); expected.put("admob", "'admob' does not have archive.include"); expected.put("templateWithNullArchives", "'templateWithNullArchives' does not have " + "archive.include"); expected.put("templateWithOnlyFile", "'templateWithOnlyFile' does not have archive.include"); expected.put("fuzz1", "'fuzz1' does not have archive"); expected.put("fuzz2", "Illegal character in path at index 2: ,S`&|[x0q;J.$9D#P6FUDG>+&69ZXG"); boolean unexpectedFailure = false; for (ResolvedManifests.NamedManifest manifest : ResolvedManifests.all()) { String key = manifest.name; String expectedFailure = expected.get(key); try { EnvironmentUtils.getPackageLevelIncludeFolder(environment, key, manifest.resolved); if (expectedFailure != null) { fail("Expected failure"); } } catch (RuntimeException e) { if (e.getMessage() == null) { throw e; } if (!e.getMessage().equals(expectedFailure)) { e.printStackTrace(); System.out.printf("expected.put(\"%s\", \"%s\");\n", key, e.getMessage()); unexpectedFailure = true; } } } if (unexpectedFailure) { throw new RuntimeException("Unexpected failures. See console."); } }
@NotNull public static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate) throws IOException, NoSuchAlgorithmException, URISyntaxException { ResolvedManifest resolved = resolveManifest(environment, coordinate); return getPackageLevelIncludeFolder(environment, coordinate, resolved); }
EnvironmentUtils { @NotNull public static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate) throws IOException, NoSuchAlgorithmException, URISyntaxException { ResolvedManifest resolved = resolveManifest(environment, coordinate); return getPackageLevelIncludeFolder(environment, coordinate, resolved); } }
EnvironmentUtils { @NotNull public static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate) throws IOException, NoSuchAlgorithmException, URISyntaxException { ResolvedManifest resolved = resolveManifest(environment, coordinate); return getPackageLevelIncludeFolder(environment, coordinate, resolved); }  }
EnvironmentUtils { @NotNull public static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate) throws IOException, NoSuchAlgorithmException, URISyntaxException { ResolvedManifest resolved = resolveManifest(environment, coordinate); return getPackageLevelIncludeFolder(environment, coordinate, resolved); }  @NotNull static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate); }
EnvironmentUtils { @NotNull public static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate) throws IOException, NoSuchAlgorithmException, URISyntaxException { ResolvedManifest resolved = resolveManifest(environment, coordinate); return getPackageLevelIncludeFolder(environment, coordinate, resolved); }  @NotNull static File getPackageLevelIncludeFolder(@NotNull GeneratorEnvironment environment, @NotNull String coordinate);  }