Search in sources :

Example 96 with Arguments

use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toConstructorParamsList_Test.

@Test
public void toConstructorParamsList_Test() {
    final ImmutableList<Arguments> expectedArgs = ImmutableList.of(new Arguments("string", "bucketName"), new Arguments("string", "objectName"), new Arguments("string", "activeJobId"), new Arguments("int", "intReqParam"), new Arguments("string", "stringReqParam"));
    final ImmutableList<Arguments> result = generator.toConstructorParamsList(testRequest);
    assertThat(result.size(), is(expectedArgs.size()));
    for (int i = 0; i < result.size(); i++) {
        assertThat(result.get(i).getName(), is(expectedArgs.get(i).getName()));
        assertThat(result.get(i).getType(), is(expectedArgs.get(i).getType()));
    }
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) Test(org.junit.Test)

Example 97 with Arguments

use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method structParamsFromRequest_Test.

@Test
public void structParamsFromRequest_Test() {
    // Not sorted
    final ImmutableList<Arguments> expectedArgs = ImmutableList.of(new Arguments("string", "bucketName"), new Arguments("string", "objectName"), new Arguments("string", "activeJobId"), new Arguments("int", "intReqParam"), new Arguments("string", "stringReqParam"), new Arguments("int", "intOptParam"), new Arguments("*int", "integerOptParam"), new Arguments("string", "stringOptParam"));
    final ImmutableList<Arguments> result = generator.structParamsFromRequest(testRequest);
    assertThat(result.size(), is(expectedArgs.size()));
    for (int i = 0; i < result.size(); i++) {
        assertThat(result.get(i).getName(), is(expectedArgs.get(i).getName()));
        assertThat(result.get(i).getType(), is(expectedArgs.get(i).getType()));
    }
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) Test(org.junit.Test)

Example 98 with Arguments

use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.

the class DeleteObjectsRequestGenerator_Test method getPayloadConstructorArgTest.

@Test
public void getPayloadConstructorArgTest() {
    final Arguments result = generator.getPayloadConstructorArg();
    assertThat(result.getName(), is("objectNames"));
    assertThat(result.getType(), is("[]string"));
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) Test(org.junit.Test)

Example 99 with Arguments

use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.

the class GetObjectRequestGenerator_Test method toStructParams_Test.

@Test
public void toStructParams_Test() {
    final ImmutableList<Arguments> expectedArgs = ImmutableList.of(new Arguments("string", "bucketName"), new Arguments("string", "objectName"), new Arguments("networking.Checksum", "checksum"), new Arguments("string", "job"), new Arguments("int64", "offset"), new Arguments("*rangeHeader", "rangeHeader"));
    final ImmutableList<Arguments> result = generator.toStructParams(getRequestAmazonS3GetObject());
    assertThat(result.size(), is(expectedArgs.size()));
    for (int i = 0; i < result.size(); i++) {
        assertThat(result.get(i).getName(), is(expectedArgs.get(i).getName()));
        assertThat(result.get(i).getType(), is(expectedArgs.get(i).getType()));
    }
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) Test(org.junit.Test)

Example 100 with Arguments

use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.

the class MultipartUploadPayloadGenerator_Test method getPayloadConstructorArgTest.

@Test
public void getPayloadConstructorArgTest() {
    final Arguments result = generator.getPayloadConstructorArg();
    assertThat(result.getName(), is("parts"));
    assertThat(result.getType(), is("[]Part"));
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) Test(org.junit.Test)

Aggregations

Arguments (com.spectralogic.ds3autogen.api.models.Arguments)188 Test (org.junit.Test)144 FileUtils (com.spectralogic.ds3autogen.api.FileUtils)46 ImmutableList (com.google.common.collect.ImmutableList)40 RequestConstructor (com.spectralogic.ds3autogen.java.models.RequestConstructor)33 Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)25 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)25 TestGeneratedCode (com.spectralogic.ds3autogen.java.utils.TestGeneratedCode)25 TestGenerateCode (com.spectralogic.ds3autogen.net.utils.TestGenerateCode)21 QueryParam (com.spectralogic.ds3autogen.java.models.QueryParam)19 Helper.removeVoidArguments (com.spectralogic.ds3autogen.utils.Helper.removeVoidArguments)15 BaseParseResponse (com.spectralogic.ds3autogen.java.models.parseresponse.BaseParseResponse)14 RequestGeneratorTestHelper.createSimpleTestDs3Request (com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request)13 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)9 GuavaCollectors (com.spectralogic.ds3autogen.utils.collections.GuavaCollectors)8 CustomArgumentComparator (com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator)8 ConstructorParam (com.spectralogic.ds3autogen.python.model.request.ConstructorParam)7 Helper.camelToUnderscore (com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore)7 RequestConverterUtil.getNonVoidArgsFromParamList (com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList)6 Ds3ResponseType (com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType)5