Examples of CustomPoint


Examples of com.linkedin.data.template.TestCustom.CustomPoint

  }

  @Test
  public void testCustomPointRecord()
  {
    CustomPoint input[] = { new CustomPoint("1,1"), new CustomPoint("2,2"), new CustomPoint("3,3") };
    CustomPointRecord foo = new CustomPointRecord();
    for (CustomPoint p : input)
    {
      foo.setCustomPoint(p);
      assertTrue(foo.hasCustomPoint());
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

  }

  @Test
  public void testCustomPointRecordUnion() throws CloneNotSupportedException
  {
    CustomPoint point = new CustomPoint("1,1");
    CustomPointRecord record = new CustomPointRecord();
    CustomPointRecord.CustomPointUnion u = new CustomPointRecord.CustomPointUnion();
    u.setCustomPoint(point);
    record.setCustomPointUnion(u);
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

    record.setCustomPointArray(a1);

    CustomPointRecord recordCopy = new CustomPointRecord(record.data().copy());
    for (int i = 0; i < input.size(); i++)
    {
      assertEquals(recordCopy.getCustomPointArray().get(i), new CustomPoint(input.get(i)));
    }
  }
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

  }

  @Test
  public void testCustomPointRecordMap() throws CloneNotSupportedException
  {
    final Map<String, CustomPoint> input = asMap("1", new CustomPoint("1,1"), "2", new CustomPoint("2,2"), "3", new CustomPoint("3,3"));
    final DataMap inputDataMap = new DataMap(asMap("1", "1,1", "2", "2,2", "3", "3,3"));

    CustomPointRecord record = new CustomPointRecord();
    CustomPointMap a1 = new CustomPointMap(inputDataMap);
    record.setCustomPointMap(a1);
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

    CustomPointArray a1 = new CustomPointArray();
    assertEquals(a1.schema(), TestUtil.dataSchemaFromString(customPointArraySchemaText));

    for (String s : input)
    {
      a1.add(new CustomPoint(s));
      assertTrue(a1.contains(new CustomPoint(s)));
    }
    CustomPointArray a2 = new CustomPointArray(inputDataList);
    assertEquals(a1, a2);
    assertEquals(a1.data(), a2.data());
    for (String s : input)
    {
      assertTrue(a2.contains(new CustomPoint(s)));
    }

    for (int i = 0; i < input.size(); i++)
    {
      CustomPoint p = a1.get(i);
      assertEquals(p, new CustomPoint(input.get(i)));
    }

    CustomPointArray a3 = new CustomPointArray(input.size());
    for (int i = 0; i < input.size(); i++)
    {
      a3.add(new CustomPoint(input.get(i)));
      assertEquals(a3.get(i), new CustomPoint(input.get(i)));
    }

    for (int i = 0; i < input.size(); i++)
    {
      int j = input.size() - i - 1;
      a3.set(j, new CustomPoint(input.get(i)));
      assertEquals(a3.get(j), new CustomPoint(input.get(i)));
    }
  }
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

  }

  @Test
  public void testCustomPointMap() throws IOException
  {
    final Map<String, CustomPoint> input = asMap("1", new CustomPoint("1,1"), "2", new CustomPoint("2,2"), "3", new CustomPoint("3,3"));
    final DataMap inputDataMap = new DataMap(asMap("1", "1,1", "2", "2,2", "3", "3,3"));
    final String customPointMapSchemaText = "{\"type\":\"map\",\"values\":{\"type\":\"typeref\",\"name\":\"CustomPoint\",\"namespace\":\"com.linkedin.pegasus.generator.test\",\"ref\":\"string\",\"java\":{\"class\":\"com.linkedin.data.template.TestCustom.CustomPoint\"}}}";

    CustomPointMap a1 = new CustomPointMap();
    assertEquals(a1.schema(), TestUtil.dataSchemaFromString(customPointMapSchemaText));

    for (Map.Entry<String, CustomPoint> e : input.entrySet())
    {
      a1.put(e.getKey(), e.getValue());
      assertTrue(a1.containsKey(e.getKey()));
      assertTrue(a1.containsValue(e.getValue()));
    }
    CustomPointMap a2 = new CustomPointMap(inputDataMap);
    assertEquals(a1, a2);
    assertEquals(a1.data(), a2.data());
    for (Map.Entry<String, CustomPoint> e : input.entrySet())
    {
      assertTrue(a2.containsKey(e.getKey()));
      assertTrue(a2.containsValue(e.getValue()));
    }

    for (Map.Entry<String, CustomPoint> e : input.entrySet())
    {
      CustomPoint p = a1.get(e.getKey());
      assertEquals(p, e.getValue());
    }

    CustomPointMap a3 = new CustomPointMap(input.size());
    for (Map.Entry<String, CustomPoint> e : input.entrySet())
View Full Code Here

Examples of com.linkedin.data.template.TestCustom.CustomPoint

  }

  @Test
  public void testCustomPointUnionMember()
  {
    CustomPoint input[] = { new CustomPoint("1,1"), new CustomPoint("2,2"), new CustomPoint("3,3") };

    CustomPointRecord.CustomPointUnion u = new CustomPointRecord.CustomPointUnion();
    assertFalse(u.isCustomPoint());
    assertNull(u.getCustomPoint());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.