use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElementList_FullList_Test.
@Test
public void toElementList_FullList_Test() {
final ImmutableList<Ds3Element> ds3Elements = ImmutableList.of(new Ds3Element("Name1", "Type1", "ComponentType1", false), new Ds3Element("Name2", "Type2", "ComponentType2", false));
final ImmutableList<Element> result = generator.toElementList(ds3Elements);
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("Name1"));
assertThat(result.get(1).getName(), is("Name2"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method getAllImports_NonEnumType_Test.
@Test
public void getAllImports_NonEnumType_Test() {
final ImmutableList<Ds3Element> ds3Elements = ImmutableList.of(new Ds3Element("ElementName1", "com.spectralogic.test.ElementType1", "ElementComponentType1", false), new Ds3Element("ElementName2", "ElementType2", "com.spectralogic.test.ElementComponentType2", false), new Ds3Element("ElementName3", "ElementType3", null, false));
final Ds3Type ds3Type = new Ds3Type("TypeName", null, ds3Elements, null);
final ImmutableList<String> result = generator.getAllImports(ds3Type);
assertThat(result.size(), is(3));
assertTrue(result.contains("java.util.List"));
assertTrue(result.contains("java.util.ArrayList"));
assertTrue(result.contains("com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElement_Test.
@Test
public void toElement_Test() {
final Ds3Element ds3Element = new Ds3Element("Name", "Type", "ComponentType", false);
final Element result = generator.toElement(ds3Element);
assertThat(result.getName(), is("Name"));
assertThat(result.getType(), is("Type"));
assertThat(result.getComponentType(), is("ComponentType"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element in project ds3_autogen by SpectraLogic.
the class CommonPrefixGenerator_Test method toElementList_List_Test.
@Test
public void toElementList_List_Test() {
final ImmutableList<Ds3Element> elements = ImmutableList.of(new Ds3Element("CommonPrefixes", "array", "java.lang.String", false), new Ds3Element("CreationDate", "java.util.Date", null, false));
final ImmutableList<Element> result = generator.toElementList(elements);
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("CommonPrefixes"));
assertThat(result.get(0).getType(), is("array"));
assertThat(result.get(0).getComponentType(), is("CommonPrefixes"));
assertThat(result.get(1).getName(), is("CreationDate"));
assertThat(result.get(1).getType(), is("java.util.Date"));
assertThat(result.get(1).getComponentType(), is(nullValue()));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Element 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\""));
}
Aggregations