use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Type in project ds3_autogen by SpectraLogic.
the class Ds3TypeClassificationUtil_Test method containsElement_Test.
@Test
public void containsElement_Test() {
final ImmutableList<Ds3Element> elements = ImmutableList.of(new Ds3Element("Code", "java.lang.String", null, true), new Ds3Element("HttpErrorCode", "int", null, false));
final Ds3Type type = createDs3TypeTestData("TestType", elements);
assertTrue(containsElement(type, "Code"));
assertTrue(containsElement(type, "HttpErrorCode"));
assertFalse(containsElement(type, "Resource"));
assertFalse(containsElement(type, "ResourceId"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Type in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElementList_Jobs_Test.
@Test
public void toElementList_Jobs_Test() {
final ImmutableList<Ds3AnnotationElement> annotations = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "Jobs", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "SINGLE_BLOCK_FOR_ALL_ELEMENTS", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "Job", "java.lang.String"));
final Ds3Element jobs = new Ds3Element("Jobs", "array", "com.spectralogic.s3.server.domain.Job", ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotations)), false);
final Ds3Type jobApiBean = createDs3TypeTestData("com.spectralogic.s3.server.domain.Job");
final TypeElementList result = toElementList(jobs, ImmutableMap.of(jobApiBean.getName(), jobApiBean));
assertThat(result.toPythonCode(), is("('Job', None, Job())"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Type in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method createTestTypeMap.
/**
* Creates the test TypeMap
*/
private static ImmutableMap<String, Ds3Type> createTestTypeMap() {
final Ds3Type listType = createDs3TypeTestData("com.test.ListType");
final Ds3Type elementType = createDs3TypeTestData("com.test.ElementType");
return ImmutableMap.of(listType.getName(), listType, elementType.getName(), elementType);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Type in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method testTypeMap.
private static ImmutableMap<String, Ds3Type> testTypeMap() {
final Ds3Type type1 = typeWithNameToMarshal();
final Ds3Type type2 = typeWithoutNameToMarshal();
final Ds3Type type3 = typeEmptyListBucketResult();
final Ds3Type type4 = typeEmptyJobWithChunks();
return ImmutableMap.of(type1.getName(), type1, type2.getName(), type2, type3.getName(), type3, type4.getName(), type4);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Type in project ds3_autogen by SpectraLogic.
the class Ds3TypeClassificationUtil_Test method isCommonPrefixesType_Test.
@Test
public void isCommonPrefixesType_Test() {
final ImmutableList<Ds3Element> elements = ImmutableList.of(new Ds3Element("CommonPrefixes", "array", "java.lang.String", true));
final Ds3Type type = createDs3TypeTestData("TestType", elements);
assertTrue(isCommonPrefixesType(type));
}
Aggregations