Search in sources :

Example 1 with TestConfig

use of com.google.api.tools.framework.model.testing.TestConfig in project toolkit by googleapis.

the class SampleInitCodeTest method setupClass.

@Before
public void setupClass() {
    List<String> protoFiles = Lists.newArrayList("myproto.proto");
    List<String> yamlFiles = Lists.newArrayList("myproto.yaml");
    testDataLocator = TestDataLocator.create(SampleInitCodeTest.class);
    testConfig = new TestConfig(testDataLocator, tempDir.getRoot().getPath(), protoFiles);
    model = testConfig.createModel(yamlFiles);
    StandardSetup.registerStandardProcessors(model);
    StandardSetup.registerStandardConfigAspects(model);
    model.establishStage(Merged.KEY);
    apiInterface = model.getSymbolTable().getInterfaces().asList().get(0);
    method = apiInterface.getMethods().get(0);
}
Also used : TestConfig(com.google.api.tools.framework.model.testing.TestConfig) Before(org.junit.Before)

Example 2 with TestConfig

use of com.google.api.tools.framework.model.testing.TestConfig in project toolkit by googleapis.

the class CodegenTestUtil method readModel.

public static Model readModel(TestDataLocator locator, TemporaryFolder tempDir, String[] protoFiles, String[] yamlFiles) {
    TestConfig testConfig = new TestConfig(locator, tempDir.getRoot().getPath(), Arrays.asList(protoFiles));
    Model model = testConfig.createModel(Arrays.asList(yamlFiles));
    StandardSetup.registerStandardProcessors(model);
    StandardSetup.registerStandardConfigAspects(model);
    model.establishStage(Merged.KEY);
    return model;
}
Also used : TestConfig(com.google.api.tools.framework.model.testing.TestConfig) Model(com.google.api.tools.framework.model.Model)

Aggregations

TestConfig (com.google.api.tools.framework.model.testing.TestConfig)2 Model (com.google.api.tools.framework.model.Model)1 Before (org.junit.Before)1