use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class NormalizeNameUtil_Test method toSdkName_NoPath_Test.
@Test
public void toSdkName_NoPath_Test() throws IOException {
final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
final String expectedResult = "TEST_BlobStoreTaskPriority";
final String input = "BlobStoreTaskPriority";
final String result = toSdkName(input, nameMapper);
assertThat(result, is(expectedResult));
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class NormalizeNameUtil_Test method toSdkName_WithPath_Test.
@Test
public void toSdkName_WithPath_Test() throws IOException {
final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
final String expectedResult = "com.spectralogic.s3.common.dao.domain.ds3.TEST_BlobStoreTaskPriority";
final String input = "com.spectralogic.s3.common.dao.domain.ds3.BlobStoreTaskPriority";
final String result = toSdkName(input, nameMapper);
assertThat(result, is(expectedResult));
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class Ds3DocSpecParserImpl_Test method getDocSpec_Test.
@Test
public void getDocSpec_Test() throws IOException {
final InputStream inputStream = Ds3DocSpecParserImpl_Test.class.getResourceAsStream(TEST_COMMAND_DOCS_FILE);
final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
final Ds3DocSpecParser parser = new Ds3DocSpecParserImpl(nameMapper);
final Ds3DocSpec result = parser.getDocSpec(inputStream);
assertThat(result.getParamDocumentation("Param1").get(), is("This is the effect of Param1"));
assertThat(result.getParamDocumentation("Param2").get(), is("This is the effect of Param2"));
assertThat(result.getParamDocumentation("Param3").get(), is("This is the effect of Param3"));
assertThat(result.getRequestDocumentation("Test1Request").get(), is("This is how you use Request1"));
assertThat(result.getRequestDocumentation("Test2Request").get(), is("This is how you use Request2"));
assertThat(result.getRequestDocumentation("Test3Request").get(), is("This is how you use Amazon Request3"));
assertThat(result.getRequestDocumentation("Test3SpectraS3Request").get(), is("This is how you use SpectraS3 Request3"));
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class CCodeGenerator_Test method testRequestDocumentation.
@Test
public void testRequestDocumentation() throws IOException {
final Ds3DocSpecParser docSpecParser = new Ds3DocSpecParserImpl(new NameMapper());
final Ds3DocSpec docSpec = docSpecParser.getDocSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/testCommandDocumentation.json"));
final Optional<String> testRequestHandlerDescription = docSpec.getRequestDocumentation("Test1Request");
assertTrue(testRequestHandlerDescription.isPresent());
assertEquals(testRequestHandlerDescription.get(), "This is how you use Request1");
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class TestPythonGeneratedCode method generateCode.
/**
* Generates the python code associated with an input file. This utilizes the
* default Ds3DocSpec.
* Captured code: ds3.py
*/
public void generateCode(final FileUtils fileUtils, final String inputFileName) throws IOException, TemplateModelException {
final Ds3DocSpecParser docSpecParser = new Ds3DocSpecParserImpl(new NameMapper());
generateCode(fileUtils, inputFileName, docSpecParser.getDocSpec());
}
Aggregations