Search in sources :

Example 11 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toNullableArgument_NullableEnumType_Test.

@Test
public void toNullableArgument_NullableEnumType_Test() {
    final Ds3Type testType = new Ds3Type("com.spectra.TestType", "", null, createEmptyDs3EnumConstantList());
    final ImmutableMap<String, Ds3Type> testTypeMap = ImmutableMap.of(testType.getName(), testType);
    final Ds3Param param = new Ds3Param("MyParam", testType.getName(), true);
    final NetNullableVariable result = toNullableArgument(param, testTypeMap);
    assertThat(result.getNetType(), is("TestType?"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Ds3Type(com.spectralogic.ds3autogen.api.models.apispec.Ds3Type) Test(org.junit.Test)

Example 12 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class BulkGetRequestGenerator_Test method toOptionalArgumentsList_FullList_Test.

@Test
public void toOptionalArgumentsList_FullList_Test() {
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("IntArg", "int", false), new Ds3Param("StringArg", "java.lang.String", true), new Ds3Param("ChunkClientProcessingOrderGuarantee", "com.spectralogic.s3.common.dao.domain.ds3.JobChunkClientProcessingOrderGuarantee", false));
    final ImmutableList<NetNullableVariable> result = generator.toOptionalArgumentsList(params, ImmutableMap.of());
    assertThat(result.size(), is(2));
    assertThat(result.get(0).getName(), is("IntArg"));
    assertThat(result.get(0).getNetType(), is("int?"));
    assertThat(result.get(1).getName(), is("StringArg"));
    assertThat(result.get(1).getNetType(), is("string"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 13 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class BulkPutRequestGenerator_Test method toOptionalArgumentsList_FullList_Test.

@Test
public void toOptionalArgumentsList_FullList_Test() {
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("MaxUploadSize", "long", false), new Ds3Param("MaxUploads", "int", false), new Ds3Param("Prefix", "java.lang.String", true));
    final ImmutableList<NetNullableVariable> result = generator.toOptionalArgumentsList(params, ImmutableMap.of());
    assertThat(result.size(), is(2));
    assertThat(result.get(0).getName(), is("MaxUploads"));
    assertThat(result.get(1).getName(), is("Prefix"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 14 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class GetObjectRequestGenerator_Test method toOptionalArgumentsList_FullList_Test.

@Test
public void toOptionalArgumentsList_FullList_Test() {
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("SimpleArg", "SimpleType", false), new Ds3Param("ArgWithPath", "com.test.TypeWithPath", false));
    final ImmutableList<NetNullableVariable> result = generator.toOptionalArgumentsList(params, ImmutableMap.of());
    assertThat(result.size(), is(0));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 15 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class NetNullableVariableUtils_Test method createNullableVariable_NullablePrimitive_Test.

@Test
public void createNullableVariable_NullablePrimitive_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "java.lang.Integer", true, null);
    assertThat(var.getNetType(), is("int?"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Aggregations

NetNullableVariable (com.spectralogic.ds3autogen.net.model.common.NetNullableVariable)24 Test (org.junit.Test)24 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)8 Ds3Element (com.spectralogic.ds3autogen.api.models.apispec.Ds3Element)4 Ds3Annotation (com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation)2 WithConstructorVariable (com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable)2 Ds3Type (com.spectralogic.ds3autogen.api.models.apispec.Ds3Type)1 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1 Ds3DocSpecImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecImpl)1