use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeParserGenerator_Test method toNullableElementsList_FullList_Test.
@Test
public void toNullableElementsList_FullList_Test() {
final ImmutableList<Ds3Element> elements = ImmutableList.of(new Ds3Element("Name1", "int", "", false), new Ds3Element("Name2", "Type", "Component", false));
final ImmutableList<NullableElement> result = generator.toNullableElementsList(elements, false);
assertThat(result.size(), is(2));
assertThat(result.get(0), instanceOf(BaseNullableElement.class));
assertThat(result.get(1), instanceOf(NullableListElement.class));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeParserGenerator_Test method toNullableElement_Test.
@Test
public void toNullableElement_Test() {
final Ds3Element element = new Ds3Element("Name", "int", "", false);
final NullableElement result = toNullableElement(element, false);
assertThat(result, instanceOf(BaseNullableElement.class));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toXmlNotation_LowerCasedName_Test.
@Test
public void toXmlNotation_LowerCasedName_Test() {
final Ds3Element lowerCasedElement = new Ds3Element("lowerCasedElement", "Type", "", ImmutableList.of(), false);
final String result = generator.toXmlNotation(lowerCasedElement);
assertThat(result, is("xml:\"LowerCasedElement\""));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element 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.Ds3Element in project ds3_autogen by SpectraLogic.
the class C_Type_Test method testStructMemberTypeUuidToString.
@Test
public void testStructMemberTypeUuidToString() throws java.text.ParseException {
final Ds3Element testElement = new Ds3Element("uuidElement", "java.util.UUID", null, false);
final C_Type c_type = C_TypeHelper.convertDs3ElementType(testElement, ImmutableSet.of());
assertThat(c_type.getTypeName(), is("ds3_str"));
assertThat(c_type.toString(), is("ds3_str*"));
}
Aggregations