Search in sources :

Example 16 with Ds3Annotation

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.

the class Ds3ElementUtil_Test method getXmlTagFromAnnotation_NonCustomName_Test.

@Test
public void getXmlTagFromAnnotation_NonCustomName_Test() {
    final Ds3Annotation annotation = createNonCustomMarshaledNameAnnotation();
    final String result = getXmlTagFromAnnotation(annotation);
    assertThat(result, CoreMatchers.is(""));
}
Also used : Ds3Annotation(com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation) Test(org.junit.Test)

Example 17 with Ds3Annotation

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation 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())"));
}
Also used : Ds3Type(com.spectralogic.ds3autogen.api.models.apispec.Ds3Type) Ds3AnnotationElement(com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Ds3Element(com.spectralogic.ds3autogen.api.models.apispec.Ds3Element) Ds3Annotation(com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation) Test(org.junit.Test)

Example 18 with Ds3Annotation

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.

the class Ds3ElementUtil_Test method toElementAsAttribute_MarshalXmlAsAttribute_Test.

@Test
public void toElementAsAttribute_MarshalXmlAsAttribute_Test() {
    final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.MarshalXmlAsAttribute", null));
    assertThat(isAttribute(annotations), is(true));
}
Also used : Ds3Annotation(com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation) Test(org.junit.Test)

Example 19 with Ds3Annotation

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.

the class Ds3ElementUtil_Test method getXmlTagFromAnnotation_SimpleName_Test.

@Test
public void getXmlTagFromAnnotation_SimpleName_Test() {
    final Ds3Annotation annotation = createSimpleNameAnnotation();
    final String result = getXmlTagFromAnnotation(annotation);
    assertThat(result, CoreMatchers.is(""));
}
Also used : Ds3Annotation(com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation) Test(org.junit.Test)

Example 20 with Ds3Annotation

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.

the class Ds3ElementUtil_Test method getXmlTagName_Test.

@Test
public void getXmlTagName_Test() {
    final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(createSimpleNameAnnotation(), createNonCustomMarshaledNameAnnotation(), createCustomMarshaledNameAnnotation());
    final Ds3Element element = new Ds3Element("ElementName", "Type", "ComponentType", annotations, false);
    final String result = getXmlTagName(element);
    assertThat(result, CoreMatchers.is("Error"));
}
Also used : Ds3Annotation(com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation) Ds3Element(com.spectralogic.ds3autogen.api.models.apispec.Ds3Element) Test(org.junit.Test)

Aggregations

Ds3Annotation (com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation)20 Test (org.junit.Test)18 Ds3Element (com.spectralogic.ds3autogen.api.models.apispec.Ds3Element)9 Ds3AnnotationElement (com.spectralogic.ds3autogen.api.models.apispec.Ds3AnnotationElement)7 Element (com.spectralogic.ds3autogen.java.models.Element)2 NetNullableVariable (com.spectralogic.ds3autogen.net.model.common.NetNullableVariable)2 TypeElementList (com.spectralogic.ds3autogen.python.model.type.TypeElementList)2 ImmutableList (com.google.common.collect.ImmutableList)1 Ds3Type (com.spectralogic.ds3autogen.api.models.apispec.Ds3Type)1