@Test public void testAllResolvedManifests() throws Exception { Map<String, String> expected = new HashMap<>(); expected.put("admob", "Reference com.github.jomof:firebase/app:2.1.3-rev8 was not found, " + "needed by com.github.jomof:firebase/admob:2.1.3-rev8"); expected.put("fuzz1", "Could not parse main manifest coordinate []"); boolean unexpectedFailures = false; for (ResolvedManifests.NamedManifest manifest : ResolvedManifests.all()) { BuildFindModuleFunctionTable builder = new BuildFindModuleFunctionTable(); builder.addManifest(manifest.resolved); String expectedFailure = expected.get(manifest.name); try { FunctionTableExpression table = builder.build(); new CMakeGenerator(environment, table).generate(); if (expectedFailure != null) { fail("Expected failure"); } } catch (RuntimeException e) { if (expectedFailure == null || !expectedFailure.equals(e.getMessage())) { System.out.printf("expected.put(\"%s\", \"%s\")\n", manifest.name, e.getMessage()); unexpectedFailures = true; } } } if (unexpectedFailures) { throw new RuntimeException("Unexpected failures. See console."); } }
public void generate() throws IOException { File file = getCMakeConfigurationFile(); String text = create(); info("Generating %s\n", file); FileUtils.writeTextToFile(file, text); }
CMakeGenerator { public void generate() throws IOException { File file = getCMakeConfigurationFile(); String text = create(); info("Generating %s\n", file); FileUtils.writeTextToFile(file, text); } }
CMakeGenerator { public void generate() throws IOException { File file = getCMakeConfigurationFile(); String text = create(); info("Generating %s\n", file); FileUtils.writeTextToFile(file, text); } CMakeGenerator(@NotNull GeneratorEnvironment environment, @NotNull FunctionTableExpression table); }
CMakeGenerator { public void generate() throws IOException { File file = getCMakeConfigurationFile(); String text = create(); info("Generating %s\n", file); FileUtils.writeTextToFile(file, text); } CMakeGenerator(@NotNull GeneratorEnvironment environment, @NotNull FunctionTableExpression table); void generate(); @NotNull String create(); }
CMakeGenerator { public void generate() throws IOException { File file = getCMakeConfigurationFile(); String text = create(); info("Generating %s\n", file); FileUtils.writeTextToFile(file, text); } CMakeGenerator(@NotNull GeneratorEnvironment environment, @NotNull FunctionTableExpression table); void generate(); @NotNull String create();  }