Package com.linkedin.data.template

Examples of com.linkedin.data.template.IntegerArray


    result = test("[false, true]", BooleanArray.class);
    Assert.assertEquals(result, new BooleanArray(Arrays.asList(false, true)));
    Assert.assertSame(result.getClass(), BooleanArray.class);

    result = test("[1, 2, 3]", IntegerArray.class);
    Assert.assertEquals(result, new IntegerArray(Arrays.asList(1, 2, 3)));
    Assert.assertSame(result.getClass(), IntegerArray.class);

    result = test("[1.1, 2.2, 3.3]", IntegerArray.class);
    Assert.assertEquals(result, new IntegerArray(Arrays.asList(1, 2, 3)));
    Assert.assertSame(result.getClass(), IntegerArray.class);

    result = test("[2, 3, 4]", LongArray.class);
    Assert.assertEquals(result, new LongArray(Arrays.asList(2L, 3L, 4L)));
    Assert.assertSame(result.getClass(), LongArray.class);
View Full Code Here


  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProvider")
  public void testSimpleArrayParameter(RootBuilderWrapper<Integer, Group> groupBuilders)
    throws RemoteInvocationException
  {
    final Collection<Integer> coll = Arrays.asList(1, 2, 3);
    final IntegerArray array = new IntegerArray(coll);

    REST_CLIENT.sendRequest(groupBuilders.findBy("ComplexCircuit").setQueryParam("coercedArray", coll).build()).getResponse();
    REST_CLIENT.sendRequest(groupBuilders.findBy("ComplexCircuit").setQueryParam("coercedArray", array).build()).getResponse();
  }
View Full Code Here

    record.setDoubleRefArray(doubleArray);
    doubleArray = record.getDoubleRefArray();
    assertEquals(doubleArray.schema(), DataTemplateUtil.getSchema(DoubleArray.class));
    assertNotEquals(recordDataSchema.getField("doubleRefArray").getType(), doubleArray.schema());

    IntegerArray intArray = new IntegerArray();
    record.setIntArray(intArray);
    intArray = record.getIntArray();
    assertEquals(intArray.schema(), DataTemplateUtil.getSchema(IntegerArray.class));
    assertNotEquals(recordDataSchema.getField("intArray").getType(), intArray.schema());

    record.setIntRefArray(intArray);
    intArray = record.getIntRefArray();
    assertEquals(intArray.schema(), DataTemplateUtil.getSchema(IntegerArray.class));
    assertNotEquals(recordDataSchema.getField("intRefArray").getType(), intArray.schema());

    assertNotEquals(recordDataSchema.getField("intArray").getType(), recordDataSchema.getField("intRefArray").getType());
  }
View Full Code Here

  }

  @Action(name = "IntArrayFunc", returnTyperef=IntArrayRef.class)
  public IntegerArray IntArrayFunc(@ActionParam(value="arg1", typeref=IntArrayRef.class) IntegerArray arg1)
  {
    return new IntegerArray();
  }
View Full Code Here

        "recordField",
        new RecordBar().setLocation("far")
      },
      {
        "arrayField",
        new IntegerArray(new DataList(Arrays.asList(1, 2, 3, 4, 5)))
      },
      {
        "mapField",
        new StringMap(new DataMap(TestUtil.asMap("k1", "v1", "k2", "v2", "k3", "v3")))
      },
View Full Code Here

    final GetRequestBuilder<Long, TestRecord> builder = new GetRequestBuilder<Long, TestRecord>(TEST_URI,
                                                                                                TestRecord.class,
                                                                                                _COLL_SPEC,
                                                                                                RestliRequestOptions.DEFAULT_OPTIONS);
    final Collection<Integer> coll = Arrays.asList(3, 4, 5);
    final IntegerArray array = new IntegerArray(coll);
    final GetRequest<TestRecord> request = builder
                                          .id(1L)
                                          .setReqParam("simpleKey", 2)
                                          .setParam("arrayKey1", coll)
                                          .setParam("arrayKey2", array)
View Full Code Here

TOP

Related Classes of com.linkedin.data.template.IntegerArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.