use of com.google.api.codegen.viewmodel.testing.SmokeTestClassView in project toolkit by googleapis.
the class CSharpGapicSmokeTestTransformer method generateSmokeTestCsproj.
private SmokeTestClassView generateSmokeTestCsproj(GapicInterfaceContext context) {
SmokeTestClassView.Builder builder = generateSmokeTestViewBuilder(context);
GapicProductConfig productConfig = context.getProductConfig();
String outputPath = pathMapper.getOutputPath(context.getInterface().getFullName(), productConfig);
builder.outputPath(outputPath + File.separator + productConfig.getPackageName() + ".SmokeTests.csproj");
builder.templateFileName(SMOKETEST_CSPROJ_TEMPLATE_FILENAME);
return builder.build();
}
use of com.google.api.codegen.viewmodel.testing.SmokeTestClassView in project toolkit by googleapis.
the class GoGapicSurfaceTestTransformer method createSmokeTestClassView.
private SmokeTestClassView createSmokeTestClassView(InterfaceContext context) {
SurfaceNamer namer = context.getNamer();
MethodModel method = context.getInterfaceConfig().getSmokeTestConfig().getMethod();
MethodContext methodContext = context.asRequestMethodContext(method);
SmokeTestClassView.Builder testClass = SmokeTestClassView.newBuilder();
StaticLangApiMethodView apiMethodView = createSmokeTestCaseApiMethodView(methodContext);
testClass.apiSettingsClassName(namer.getApiSettingsClassName(context.getInterfaceConfig()));
testClass.apiClassName(namer.getApiWrapperClassName(context.getInterfaceConfig()));
testClass.name(namer.getSmokeTestClassName(context.getInterfaceConfig()));
testClass.outputPath(context.getProductConfig().getPackageName() + File.separator + method.getSimpleName() + "_smoke_test.go");
testClass.templateFileName(SMOKE_TEST_TEMPLATE_FILE);
testClass.apiMethod(apiMethodView);
testClass.requireProjectId(testCaseTransformer.requireProjectIdInSmokeTest(apiMethodView.initCode(), context.getNamer()));
// The shared code above add imports both for input and output.
// Since we use short decls, we don't need to import anything for output.
context.getImportTypeTable().getImports().clear();
method.getAndSaveRequestTypeName(methodContext.getTypeTable(), methodContext.getNamer());
FileHeaderView fileHeader = fileHeaderTransformer.generateFileHeader(context);
testClass.fileHeader(fileHeader);
return testClass.build();
}
use of com.google.api.codegen.viewmodel.testing.SmokeTestClassView in project toolkit by googleapis.
the class JavaSurfaceTestTransformer method createSmokeTestClassView.
// /////////////////////////////////// Smoke Test ///////////////////////////////////////
private SmokeTestClassView createSmokeTestClassView(InterfaceContext context) {
String outputPath = pathMapper.getOutputPath(context.getInterfaceModel().getFullName(), context.getProductConfig());
SurfaceNamer namer = context.getNamer();
String name = namer.getSmokeTestClassName(context.getInterfaceConfig());
SmokeTestClassView.Builder testClass = createSmokeTestClassViewBuilder(context);
testClass.name(name);
testClass.outputPath(namer.getSourceFilePath(outputPath, name));
return testClass.build();
}
Aggregations