Search in sources :

Example 11 with Parameter

use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.

the class RequestConverter_Test method testGetRequestParameterListNoResponseType.

@Test
public void testGetRequestParameterListNoResponseType() throws IOException {
    final ImmutableList<Parameter> paramList = RequestConverter.getParamList("", new Ds3DocSpecEmptyImpl());
    assertEquals(paramList.size(), 2);
    assertEquals(RequestHelper.paramListToString(paramList), "const ds3_client* client, const ds3_request* request");
}
Also used : Ds3DocSpecEmptyImpl(com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl) Parameter(com.spectralogic.ds3autogen.c.models.Parameter) Test(org.junit.Test)

Example 12 with Parameter

use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.

the class Parameter_Test method testConstParameterToString.

@Test
public void testConstParameterToString() {
    final Parameter param1 = new Parameter(ParameterModifier.CONST, "ds3_request", "request", ParameterPointerType.NONE, false);
    assertThat(param1.toString(), is("const ds3_request request"));
}
Also used : Parameter(com.spectralogic.ds3autogen.c.models.Parameter) Test(org.junit.Test)

Example 13 with Parameter

use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.

the class Parameter_Test method testParameterToStringWithDoublePointer.

@Test
public void testParameterToStringWithDoublePointer() {
    final Parameter param1 = new Parameter(ParameterModifier.NONE, "ds3_widget", "myWidget", ParameterPointerType.DOUBLE_POINTER, false);
    assertThat(param1.toString(), is("ds3_widget** myWidget"));
}
Also used : Parameter(com.spectralogic.ds3autogen.c.models.Parameter) Test(org.junit.Test)

Example 14 with Parameter

use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.

the class RequestConverter_Test method testConvertDs3ParameterWithDocumentation.

@Test
public void testConvertDs3ParameterWithDocumentation() {
    final Ds3DocSpec docSpec = getTestDocSpec();
    final String paramName = "BucketName";
    final Ds3Param testDs3Param = new Ds3Param(paramName, "Ds3Bucket", false);
    final Parameter testParameter = ParameterConverter.toParameter(testDs3Param, true, RequestConverter.toParamDocs(paramName, docSpec));
    assertEquals(testParameter.getDocumentation(), "This is how you use bucket name");
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) Ds3DocSpec(com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec) Parameter(com.spectralogic.ds3autogen.c.models.Parameter) Test(org.junit.Test)

Aggregations

Parameter (com.spectralogic.ds3autogen.c.models.Parameter)14 Test (org.junit.Test)10 ImmutableList (com.google.common.collect.ImmutableList)3 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)3 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1