use of com.spectralogic.ds3autogen.java.models.Element 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.java.models.Element 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.java.models.Element in project ds3_autogen by SpectraLogic.
the class JavaHelper_Test method getModelVariable_NonArrayComponentType_Test.
@Test(expected = IllegalArgumentException.class)
public void getModelVariable_NonArrayComponentType_Test() {
final Element element = new Element("testName", "map", "com.spectralogic.s3.common.platform.domain.BlobApiBean");
getModelVariable(element);
}
use of com.spectralogic.ds3autogen.java.models.Element 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.java.models.Element 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"));
}
Aggregations