use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class Ds3ElementUtil_Test method getEncapsulatingTagAnnotationElements_FullList_Test.
@Test
public void getEncapsulatingTagAnnotationElements_FullList_Test() {
final ImmutableList<Ds3AnnotationElement> annotationElements = ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "TestTag", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "UNDEFINED", "com.test.Collection"), new Ds3AnnotationElement("Value", "object", "java.lang.String"));
final String result = getEncapsulatingTagAnnotationElements(annotationElements);
assertThat(result, is("TestTag"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toXmlNotation_LowerCasedAnnotations_Test.
@Test
public void toXmlNotation_LowerCasedAnnotations_Test() {
final Ds3Element lowerCasedElement = new Ds3Element("lowerCasedElement", "Type", "", ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "lowerCasedOuterTag", "java.lang.String"), new Ds3AnnotationElement("Value", "lowerCasedInnerTag", "java.lang.String")))), false);
final String result = generator.toXmlNotation(lowerCasedElement);
assertThat(result, is("xml:\"LowerCasedOuterTag>LowerCasedInnerTag\""));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class Ds3ElementUtil_Test method hasWrapperAnnotationElements_HasWrapper_Test.
@Test
public void hasWrapperAnnotationElements_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"));
assertThat(hasWrapperAnnotationElements(annotationElements), is(true));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement 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.Ds3AnnotationElement in project ds3_autogen by SpectraLogic.
the class Ds3ElementUtil_Test method hasWrapperAnnotationElements_NoWrapper_Test.
@Test
public void hasWrapperAnnotationElements_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"));
assertThat(hasWrapperAnnotationElements(annotationElements), is(false));
}
Aggregations