use of com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl in project ds3_autogen by SpectraLogic.
the class CreateNotificationRequestGenerator_Test method toConstructorList_Test.
@Test
public void toConstructorList_Test() {
final ImmutableList.Builder<Ds3Param> builder = ImmutableList.builder();
builder.addAll(createTestDs3ParamList());
builder.add(new Ds3Param("NotificationEndPoint", "String", false));
final Ds3Request request = createDs3RequestTestData(true, null, builder.build());
final ImmutableList<RequestConstructor> result = generator.toConstructorList(request, "", new Ds3DocSpecEmptyImpl());
assertThat(result.size(), is(1));
final RequestConstructor constructor = result.get(0);
assertThat(constructor.getAdditionalLines().size(), is(0));
assertThat(constructor.isDeprecated(), is(false));
final ImmutableList<Arguments> constructorParams = constructor.getParameters();
assertThat(constructorParams.size(), is(4));
assertThat(constructorParams.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorParams.get(1).getName(), is("Name"));
assertThat(constructorParams.get(2).getName(), is("Priority"));
assertThat(constructorParams.get(3).getName(), is("NotificationEndPoint"));
final ImmutableList<Arguments> constructorAssignments = constructor.getAssignments();
assertThat(constructorAssignments.size(), is(3));
assertThat(constructorAssignments.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorAssignments.get(1).getName(), is("Name"));
assertThat(constructorAssignments.get(2).getName(), is("Priority"));
final ImmutableList<QueryParam> queryParams = constructor.getQueryParams();
assertThat(queryParams.size(), is(4));
assertThat(queryParams.get(0).getName(), is("IgnoreNamingConflicts"));
assertThat(queryParams.get(1).getName(), is("MaxUploadSize"));
assertThat(queryParams.get(2).getName(), is("Name"));
assertThat(queryParams.get(3).getName(), is("Priority"));
}
use of com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toWithConstructor_Test.
@Test
public void toWithConstructor_Test() {
final String expectedResult = " public RequestName withArgName(final ArgType argName) {\n" + " this.argName = argName;\n" + " this.updateQueryParam(\"arg_name\", argName);\n" + " return this;\n" + " }\n";
final Arguments argument = new Arguments("ArgType", "ArgName");
final String result = generator.toWithConstructor(argument, "RequestName", new Ds3DocSpecEmptyImpl());
assertThat(result, is(expectedResult));
}
use of com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl in project ds3_autogen by SpectraLogic.
the class PythonCodeGenerator_Test method toClientCommands_EmptyList_Test.
@Test
public void toClientCommands_EmptyList_Test() {
final ImmutableList<BaseClient> result = toClientCommands(ImmutableList.of(), new Ds3DocSpecEmptyImpl());
assertThat(result.size(), is(0));
}
use of com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl in project ds3_autogen by SpectraLogic.
the class PythonCodeGenerator_Test method toRequestModelList_NullList_Test.
@Test
public void toRequestModelList_NullList_Test() {
final ImmutableList<BaseRequest> result = generator.toRequestModelList(null, new Ds3DocSpecEmptyImpl());
assertThat(result.size(), is(0));
}
use of com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl in project ds3_autogen by SpectraLogic.
the class CCodeGenerator_Test method testStuctsContainsJobCreationFailedNotificationPayload.
@Test
public void testStuctsContainsJobCreationFailedNotificationPayload() throws IOException, ParseException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/3_2_2_contract.xml"));
final ImmutableList<Enum> allEnums = CCodeGenerator.getAllEnums(spec);
final ImmutableSet<String> enumNames = EnumHelper.getEnumNamesSet(allEnums);
final ImmutableSet<String> arrayMemberTypes = CCodeGenerator.getArrayMemberTypes(spec, enumNames);
final ImmutableSet<String> embeddedTypes = CCodeGenerator.getEmbeddedTypes(spec, enumNames);
final ImmutableList<Request> allRequests = CCodeGenerator.getAllRequests(spec, new Ds3DocSpecEmptyImpl());
final ImmutableSet<String> responseTypes = RequestHelper.getResponseTypes(allRequests);
final ImmutableSet<String> paginatedTypes = CCodeGenerator.getPaginatedTypes(spec);
final ImmutableList<Struct> allStructs = CCodeGenerator.getAllStructs(spec, enumNames, responseTypes, embeddedTypes, arrayMemberTypes, paginatedTypes);
assertTrue(allStructs.stream().map(Struct::getName).anyMatch(name -> name.equals("ds3_job_creation_failed_notification_payload_response")));
}
Aggregations