Package org.kiji.schema.avro

Examples of org.kiji.schema.avro.TestRecord2


    getKiji().createTable(KijiTableLayouts.getLayout(KijiTableLayouts.READER_SCHEMA_TEST));
    mTable = getKiji().openTable(TABLE_NAME);

    final EmptyRecord emptyRecord = EmptyRecord.newBuilder().build();
    final TestRecord1 record1 = TestRecord1.newBuilder().setInteger(1).build();
    final TestRecord2 record2 =
        TestRecord2.newBuilder().setInteger(2).setText("record2").build();
    final TestRecord3 record3 =
        TestRecord3.newBuilder().setInteger(3).setAnotherText("record3").build();

    final EntityId eid = mTable.getEntityId("eid");
View Full Code Here


                .setSpecificRecord(TestRecord2.class))
            .build();
    final KijiTableReader reader = mTable.getReaderFactory().openTableReader(overrides);
    try {
      final KijiRowData row = reader.get(eid, DATA_REQUEST);
      final TestRecord2 read = row.getMostRecentValue("family", "record1");
      assertEquals(1, (int) read.getInteger());

      // Field 'text' does not exist in record1, so must be decoded using its default value:
      assertEquals("record2", read.getText());
    } finally {
      reader.close();
    }
  }
View Full Code Here

            .build();
    final KijiTableReader reader = mTable.getReaderFactory().openTableReader(overrides);
    try {
      final KijiRowData row = reader.get(eid, DATA_REQUEST);
      try {
        final TestRecord2 read = row.getMostRecentValue("family", "integer");
        Assert.fail("Converting int to string must fail: got " + read);
      } catch (AvroTypeException ate) {
        // Expected
        assertTrue(ate.getMessage(),
            ate.getMessage().contains("Found int, expecting org.kiji.schema.avro.TestRecord2"));
View Full Code Here

TOP

Related Classes of org.kiji.schema.avro.TestRecord2

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.