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());
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class TestGenerateCode method generateCode.
/**
* Generates the .net code associated with an input file. This captures the
* Request, Client, and IDsClient code. This utilizes the default Ds3DocSpec
*/
public void generateCode(final FileUtils fileUtils, final String inputFileName) throws IOException, TemplateModelException {
final Ds3DocSpecParser docSpecParser = new Ds3DocSpecParserImpl(new NameMapper());
generateCode(fileUtils, inputFileName, docSpecParser.getDocSpec());
}
use of com.spectralogic.ds3autogen.NameMapper in project ds3_autogen by SpectraLogic.
the class NormalizeNameUtil_Test method toSdkName_WithDollarSign_Test.
@Test
public void toSdkName_WithDollarSign_Test() throws IOException {
final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
final String expectedResult = "com.spectralogic.s3.common.dao.domain.ds3.Test$TEST_BlobStoreTaskPriority";
final String input = "com.spectralogic.s3.common.dao.domain.ds3.Test$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 normalizeRequestName_SpectraS3_Test.
@Test
public void normalizeRequestName_SpectraS3_Test() throws IOException {
final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
final String expected = "com.test.SpectraAfterSpectraS3Request";
final String input = "com.test.SpectraBeforeRequestHandler";
final String result = normalizeRequestName(input, Classification.spectrads3, nameMapper);
assertThat(result, is(expected));
}
Aggregations