Examples of MapKeyTest


Examples of com.twitter.elephantbird.pig.test.thrift.MapKeyTest

        personTuple("Joe", 1, null, "123-456-7890", "ASDF"));
  }

  @Test
  public void testSupportedMapKeyTypes() {
    MapKeyTest expected = new MapKeyTest()
        .setBooleans(ImmutableMap.of(true, 1))
        .setBytes(ImmutableMap.of((byte) 1, 1))
        .setShorts(ImmutableMap.of((short) 1, 1))
        .setInts(ImmutableMap.of(1, 1))
        .setLongs(ImmutableMap.of(1L, 1))
        .setDoubles(ImmutableMap.of(1D, 1))
        .setEnums(ImmutableMap.of(KeyEnum.A, 1))
        .setStrings(ImmutableMap.of("a", 1))
        .setBinaries(ImmutableMap.of(ByteBuffer.wrap("1".getBytes(Charsets.UTF_8)), 1));
    MapKeyTest actual = PigToThrift.newInstance(MapKeyTest.class).getThriftObject(
        tuple(
            ImmutableMap.of("true", 1),
            ImmutableMap.of("1", 1),
            ImmutableMap.of("1", 1),
            ImmutableMap.of("1", 1),
View Full Code Here

Examples of com.twitter.elephantbird.pig.test.thrift.MapKeyTest

    assertEquals(expected, actual);
  }

  @Test
  public void testMapKeyConversionFailure() {
    MapKeyTest fail = PigToThrift.newInstance(MapKeyTest.class).getThriftObject(
        tuple(
            null,
            ImmutableMap.of("notabyte", 1)
        )
    );
    assertNotNull(fail);
    assertNull(fail.getBytes());
  }
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.