use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElementList_CommonPrefixes_Test.
@Test
public void toElementList_CommonPrefixes_Test() {
final ImmutableList<Ds3AnnotationElement> annotations = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "CommonPrefixes", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "BLOCK_FOR_EVERY_ELEMENT", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "Prefix", "java.lang.String"));
final Ds3Element commonPrefixes = new Ds3Element("CommonPrefixes", "array", "java.lang.String", ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotations)), false);
final TypeElementList result = toElementList(commonPrefixes, ImmutableMap.of());
assertThat(result.toPythonCode(), is("('CommonPrefixes', None, CommonPrefixes())"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class JobsApiBeanTypeGenerator_Test method toElement_NotJobsElement_Test.
@Test
public void toElement_NotJobsElement_Test() {
final ImmutableList<Ds3AnnotationElement> annotationElements = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "NotJobs", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "SINGLE_BLOCK_FOR_ALL_ELEMENTS", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "NotJob", "java.lang.String"));
final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotationElements));
final Ds3Element ds3Element = new Ds3Element("NotJobs", "array", "com.spectralogic.s3.server.domain.JobApiBean", annotations, false);
final Element result = generator.toElement(ds3Element);
assertThat(result.hasWrapper(), is(true));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class JobsApiBeanTypeGenerator_Test method toElement_JobsElement_Test.
@Test
public void toElement_JobsElement_Test() {
final ImmutableList<Ds3AnnotationElement> annotationElements = 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 ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotationElements));
final Ds3Element ds3Element = new Ds3Element("Jobs", "array", "com.spectralogic.s3.server.domain.JobApiBean", annotations, false);
final Element result = generator.toElement(ds3Element);
assertThat(result.hasWrapper(), is(false));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class Ds3ElementUtil_Test method hasWrapperAnnotations_HasWrapper_Test.
@Test
public void hasWrapperAnnotations_HasWrapper_Test() {
final ImmutableList<Ds3AnnotationElement> annotationElements = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "Nodes", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "SINGLE_BLOCK_FOR_ALL_ELEMENTS", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "Node", "java.lang.String"));
final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotationElements));
assertThat(hasWrapperAnnotations(annotations), is(true));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class Ds3ElementUtil_Test method hasWrapperAnnotations_NoWrapper_Test.
@Test
public void hasWrapperAnnotations_NoWrapper_Test() {
final ImmutableList<Ds3AnnotationElement> annotationElements = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "UNDEFINED", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "object", "java.lang.String"));
final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", annotationElements));
assertThat(hasWrapperAnnotations(annotations), is(false));
}
Aggregations