Search in sources :

Example 1 with ConfigGeneratorApi

use of com.google.api.codegen.configgen.ConfigGeneratorApi in project toolkit by googleapis.

the class ConfigGenerationTest method run.

@Override
public Object run() throws Exception {
    String outFile = tempDir.getRoot().getPath() + File.separator + baselineFileName();
    String serviceConfigPath = getTestDataLocator().findTestData(testName.getMethodName() + ".yaml").getPath();
    ToolOptions options = ToolOptions.create();
    options.set(ConfigGeneratorApi.OUTPUT_FILE, outFile);
    options.set(ToolOptions.DESCRIPTOR_SET, testConfig.getDescriptorFile().toString());
    options.set(ToolOptions.CONFIG_FILES, Lists.newArrayList(serviceConfigPath));
    new ConfigGeneratorApi(options).run();
    String outputContent = new String(Files.readAllBytes(Paths.get(outFile)), StandardCharsets.UTF_8);
    return outputContent;
}
Also used : ConfigGeneratorApi(com.google.api.codegen.configgen.ConfigGeneratorApi) ToolOptions(com.google.api.tools.framework.tools.ToolOptions)

Aggregations

ConfigGeneratorApi (com.google.api.codegen.configgen.ConfigGeneratorApi)1 ToolOptions (com.google.api.tools.framework.tools.ToolOptions)1