Package com.linkedin.data

Examples of com.linkedin.data.DataList


      foo.removeString();
      assertFalse(foo.hasString());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, 4, 5L, 6.0f, 7.0, new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here


      foo.removeBytes();
      assertFalse(foo.hasBytes());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, 33, "\u0100", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      assertFalse(foo.hasRecord());
      assertEquals(foo.toString(), "{}");
      index++;
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

  }

  @Test
  public void testUnionField() throws CloneNotSupportedException
  {
    List<?> badOutput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    Foo foo = new Foo(map);
    for (Object bad : badOutput)
    {
View Full Code Here

          break;
        case ARRAY:
          GenericArray<?> list = (GenericArray<?>) value;
          DataSchema elementDataSchema = ((ArrayDataSchema) dereferencedDataSchema).getItems();
          Schema elementAvroSchema = avroSchema.getElementType();
          DataList dataList = new DataList(list.size());
          for (int i = 0; i < list.size(); i++)
          {
            _path.addLast(i);
            Object entryValue = translate(list.get(i), elementDataSchema, elementAvroSchema);
            _path.removeLast();
            dataList.add(entryValue);
          }
          result = dataList;
          break;
        case RECORD:
          GenericRecord record = (GenericRecord) value;
View Full Code Here

            avroMap.put(key, entryAvroValue);
          }
          result = avroMap;
          break;
        case ARRAY:
          DataList list = (DataList) value;
          DataSchema elementDataSchema = ((ArrayDataSchema) dereferencedDataSchema).getItems();
          Schema elementAvroSchema = avroSchema.getElementType();
          GenericData.Array<Object> avroList = new GenericData.Array<Object>(list.size(), avroSchema);
          for (int i = 0; i < list.size(); i++)
          {
            _path.addLast(i);
            Object entryAvroValue = translate(list.get(i), elementDataSchema, elementAvroSchema);
            _path.removeLast();
            avroList.add(entryAvroValue);
          }
          result = avroList;
          break;
View Full Code Here

          "bytes",
          ByteString.copyAvroString("default_bytes", false)
        },
        {
          "array",
          new DataList(asList(-1, -2, -3, -4))
        },
        {
          "enum",
          "apple"
        },
View Full Code Here

        ByteString.copyAvroString("qwert", false)
    };

    Object badObjects[] = {
        "", "1", "12", "123", "1234", "1234\u0100", "123456",
        1, 2.0f, 3.0, 4L, new DataMap(), new DataList()
    };

    ByteString badByteStrings[]  = {
        ByteString.copyAvroString("", false),
        ByteString.copyAvroString("a", false),
View Full Code Here

  }

  @Test(expectedExceptions = AssertionError.class)
  public void testAddCycleWithAssertChecking()
  {
    final DataList list = new DataList();
    CheckedUtil.addWithoutChecking(list, list);
  }
View Full Code Here

  }

  @Test(expectedExceptions = AssertionError.class)
  public void testSetCycleWithAssertChecking()
  {
    final DataList list = new DataList();
    CheckedUtil.addWithoutChecking(list, "not cycle");
    CheckedUtil.setWithoutChecking(list, 0, list);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.data.DataList

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.