use of com.spectralogic.ds3autogen.python.model.type.TypeElementList 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.python.model.type.TypeElementList in project ds3_autogen by SpectraLogic.
the class PythonFunctionalTests method jobsApiBean.
@Test
public void jobsApiBean() throws IOException, TemplateModelException {
final String modelDescriptorName = "JobList";
final FileUtils fileUtils = mock(FileUtils.class);
final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
codeGenerator.generateCode(fileUtils, "/input/types/jobsApiBean.xml");
final String ds3Code = codeGenerator.getDs3Code();
CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
assertTrue(hasContent(ds3Code));
final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeElementList("Job", "None", "Job"));
hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
use of com.spectralogic.ds3autogen.python.model.type.TypeElementList in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElementList_NullMap_Test.
@Test
public void toElementList_NullMap_Test() {
final TypeElementList result = toElementList(createListDs3Element(), null);
assertThat(result.toPythonCode(), is("('ListElement', None, None)"));
}
use of com.spectralogic.ds3autogen.python.model.type.TypeElementList in project ds3_autogen by SpectraLogic.
the class PythonFunctionalTests method namedDetailedTapeList.
@Test
public void namedDetailedTapeList() throws TemplateModelException, IOException {
final String modelDescriptorName = "NamedDetailedTapeList";
final FileUtils fileUtils = mock(FileUtils.class);
final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
codeGenerator.generateCode(fileUtils, "/input/types/namedDetailedTapeList.xml");
final String ds3Code = codeGenerator.getDs3Code();
CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
assertTrue(hasContent(ds3Code));
final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeElementList("Tape", "None", "NamedDetailedTape"));
hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
use of com.spectralogic.ds3autogen.python.model.type.TypeElementList in project ds3_autogen by SpectraLogic.
the class PythonFunctionalTests method listMultiPartUploadApiBean.
@Test
public void listMultiPartUploadApiBean() throws TemplateModelException, IOException {
final String modelDescriptorName = "ListMultiPartUploadsResult";
final FileUtils fileUtils = mock(FileUtils.class);
final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
codeGenerator.generateCode(fileUtils, "/input/types/listMultiPartUploadApiBean.xml");
final String ds3Code = codeGenerator.getDs3Code();
CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
assertTrue(hasContent(ds3Code));
final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeElement("Bucket", "None"), new TypeElement("Delimiter", "None"), new TypeElement("KeyMarker", "None"), new TypeElement("MaxUploads", "None"), new TypeElement("NextKeyMarker", "None"), new TypeElement("NextUploadIdMarker", "None"), new TypeElement("Prefix", "None"), new TypeElement("IsTruncated", "None"), new TypeElement("UploadIdMarker", "None"), new TypeElementList("CommonPrefixes", "None", "CommonPrefixes"), new TypeElementList("Upload", "None", "None"));
hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
Aggregations