Search in sources :

Example 1 with TypeContent

use of com.spectralogic.ds3autogen.python.model.type.TypeContent 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);
}
Also used : FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Example 2 with TypeContent

use of com.spectralogic.ds3autogen.python.model.type.TypeContent 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);
}
Also used : FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Example 3 with TypeContent

use of com.spectralogic.ds3autogen.python.model.type.TypeContent 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);
}
Also used : FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeElement(com.spectralogic.ds3autogen.python.model.type.TypeElement) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Example 4 with TypeContent

use of com.spectralogic.ds3autogen.python.model.type.TypeContent in project ds3_autogen by SpectraLogic.

the class PythonFunctionalTests method simpleType.

@Test
public void simpleType() throws TemplateModelException, IOException {
    final String modelDescriptorName = "TestElementsType";
    final FileUtils fileUtils = mock(FileUtils.class);
    final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
    codeGenerator.generateCode(fileUtils, "/input/types/simpleType.xml");
    final String ds3Code = codeGenerator.getDs3Code();
    CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
    assertTrue(hasContent(ds3Code));
    final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeAttribute("InCache"), new TypeElement("MyBucket", "BucketDetails"), new TypeElement("ByteOffset", "None"), new TypeElementList("MyBucketList", "None", "BucketDetails"), new TypeElementList("Pool", "Pools", "None"));
    hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
Also used : TypeAttribute(com.spectralogic.ds3autogen.python.model.type.TypeAttribute) FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeElement(com.spectralogic.ds3autogen.python.model.type.TypeElement) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Example 5 with TypeContent

use of com.spectralogic.ds3autogen.python.model.type.TypeContent in project ds3_autogen by SpectraLogic.

the class PythonFunctionalTests method bucketObjectsApiBean.

@Test
public void bucketObjectsApiBean() throws TemplateModelException, IOException {
    final String modelDescriptorName = "ListBucketResult";
    final FileUtils fileUtils = mock(FileUtils.class);
    final TestPythonGeneratedCode codeGenerator = new TestPythonGeneratedCode(fileUtils);
    codeGenerator.generateCode(fileUtils, "/input/types/bucketObjectsApiBean.xml");
    final String ds3Code = codeGenerator.getDs3Code();
    CODE_LOGGER.logFile(ds3Code, FileTypeToLog.MODEL_PARSERS);
    assertTrue(hasContent(ds3Code));
    final ImmutableList<TypeContent> modelContents = ImmutableList.of(new TypeElement("CreationDate", "None"), new TypeElement("Delimiter", "None"), new TypeElement("Marker", "None"), new TypeElement("MaxKeys", "None"), new TypeElement("Name", "None"), new TypeElement("NextMarker", "None"), new TypeElement("Prefix", "None"), new TypeElement("IsTruncated", "None"), new TypeElementList("CommonPrefixes", "None", "CommonPrefixes"), new TypeElementList("Contents", "None", "Contents"));
    hasModelDescriptor(modelDescriptorName, modelContents, ds3Code);
}
Also used : FileUtils(com.spectralogic.ds3autogen.api.FileUtils) TypeElement(com.spectralogic.ds3autogen.python.model.type.TypeElement) TypeContent(com.spectralogic.ds3autogen.python.model.type.TypeContent) TestPythonGeneratedCode(com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode) TypeElementList(com.spectralogic.ds3autogen.python.model.type.TypeElementList) Test(org.junit.Test)

Aggregations

FileUtils (com.spectralogic.ds3autogen.api.FileUtils)5 TypeContent (com.spectralogic.ds3autogen.python.model.type.TypeContent)5 TypeElementList (com.spectralogic.ds3autogen.python.model.type.TypeElementList)5 TestPythonGeneratedCode (com.spectralogic.ds3autogen.python.utils.TestPythonGeneratedCode)5 Test (org.junit.Test)5 TypeElement (com.spectralogic.ds3autogen.python.model.type.TypeElement)3 TypeAttribute (com.spectralogic.ds3autogen.python.model.type.TypeAttribute)1