Search in sources :

Example 6 with NetNullableVariable

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

the class NetNullableVariableUtils_Test method createNullableVariable_SpectraType_Test.

@Test
public void createNullableVariable_SpectraType_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "TestElementType", false, getTestTypeMap());
    assertThat(var.getNetType(), is("TestElementType"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 7 with NetNullableVariable

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

the class BaseRequestGenerator_Test method convertGuidToString_Test.

@Test
public void convertGuidToString_Test() {
    final NetNullableVariable guidVar = new NetNullableVariable("GuidVar", "Guid", true, true);
    final NetNullableVariable guidResult = convertGuidToString(guidVar);
    assertThat(guidResult.getType(), is("string"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 8 with NetNullableVariable

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

the class BaseRequestGenerator_Test method toWithConstructorList_FullList_Test.

@Test
public void toWithConstructorList_FullList_Test() {
    final ImmutableList<NetNullableVariable> vars = ImmutableList.of(new NetNullableVariable("GuidVar", "Guid", true, true), new NetNullableVariable("IntVar", "int", true, true));
    final ImmutableList<WithConstructorVariable> result = toWithConstructorList(vars, "requestName", getTestDocSpec());
    assertThat(result.size(), is(3));
    assertThat(result.get(0).getName(), is("GuidVar"));
    assertThat(result.get(0).getType(), is("Guid"));
    assertThat(result.get(1).getName(), is("GuidVar"));
    assertThat(result.get(1).getType(), is("string"));
    assertThat(result.get(2).getName(), is("IntVar"));
    assertThat(result.get(2).getType(), is("int"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) WithConstructorVariable(com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable) Test(org.junit.Test)

Example 9 with NetNullableVariable

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

the class BaseRequestGenerator_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(2));
    assertThat(result.get(0).getName(), is("SimpleArg"));
    assertThat(result.get(0).getNetType(), is("SimpleType"));
    assertThat(result.get(1).getName(), is("ArgWithPath"));
    assertThat(result.get(1).getNetType(), is("TypeWithPath"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 10 with NetNullableVariable

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

the class BaseRequestGenerator_Test method toNullableArgument_NullablePrimitive_Test.

@Test
public void toNullableArgument_NullablePrimitive_Test() {
    final Ds3Param param = new Ds3Param("MyParam", "java.lang.Integer", true);
    final NetNullableVariable result = toNullableArgument(param, ImmutableMap.of());
    assertThat(result.getNetType(), is("int?"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) 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