Examples of TestRecord


Examples of org.apache.avro.test.TestRecord

    Assert.assertNull(future2.getError());
  }
 
  @Test
  public void echo() throws Exception {
    TestRecord record = TestRecord.newBuilder().setHash(
        new org.apache.avro.test.MD5(
            new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8 })).
        setKind(org.apache.avro.test.Kind.FOO).
        setName("My Record").build();
   
View Full Code Here

Examples of org.apache.avro.test.namespace.TestRecord

    proxy = (TestNamespace)SpecificRequestor.getClient(TestNamespace.class, client);
  }

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     record.hash.bytes(), 0, 16);
    TestRecord echoed = proxy.echo(record);
    assertEquals(record, echoed);
    assertEquals(record.hashCode(), echoed.hashCode());
  }
View Full Code Here

Examples of org.apache.avro.test.namespace.TestRecord

    proxy = SpecificRequestor.getClient(TestNamespace.class, client);
  }

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     record.hash.bytes(), 0, 16);
    TestRecord echoed = proxy.echo(record);
    assertEquals(record, echoed);
    assertEquals(record.hashCode(), echoed.hashCode());
  }
View Full Code Here

Examples of org.apache.avro.test.namespace.TestRecord

    proxy = (TestNamespace)SpecificRequestor.getClient(TestNamespace.class, client);
  }

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     record.hash.bytes(), 0, 16);
    TestRecord echoed = proxy.echo(record);
    assertEquals(record, echoed);
    assertEquals(record.hashCode(), echoed.hashCode());
  }
View Full Code Here

Examples of org.apache.avro.test.namespace.TestRecord

    proxy = (TestNamespace)SpecificRequestor.getClient(TestNamespace.class, client);
  }

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     record.hash.bytes(), 0, 16);
    TestRecord echoed = proxy.echo(record);
    assertEquals(record, echoed);
    assertEquals(record.hashCode(), echoed.hashCode());
  }
View Full Code Here

Examples of org.commoncrawl.util.shared.ArcFileReaderTests.TestRecord

    // iterate and validate stuff ...
    Text key = new Text();
    BytesWritable value = new BytesWritable();
    while (reader.next(key, value)) {
     
      TestRecord testRecord = records.get(itemIndex++);
      // get test key bytes as utf-8 bytes ...
      byte[] testKeyBytes = testRecord.url.getBytes(Charset.forName("UTF-8"));
      // compare against raw key bytes to validate key is the same (Text's utf-8 mapping code replaces invalid characters
      // with ?, which causes our test case (which does use invalid characters to from the key, to break.
      Assert.assertTrue(ArcFileReaderTests.compareTo(testKeyBytes,0,testKeyBytes.length,key.getBytes(),0,key.getLength()) == 0);
View Full Code Here

Examples of org.commoncrawl.util.shared.ArcFileReaderTests.TestRecord

    // iterate and validate stuff ...
    Text key = new Text();
    ArcFileItem value = new ArcFileItem();
    while (reader.next(key, value)) {
     
      TestRecord testRecord = records.get(itemIndex++);
     
      // get test key bytes as utf-8 bytes ...
      byte[] testKeyBytes = testRecord.url.getBytes(Charset.forName("UTF-8"));
      // compare against raw key bytes to validate key is the same (Text's utf-8 mapping code replaces invalid characters
      // with ?, which causes our test case (which does use invalid characters to from the key, to break.
View Full Code Here

Examples of org.commoncrawl.util.shared.ArcFileReaderTests.TestRecord

    Text key = reader.createKey();
    BytesWritable value = reader.createValue();

    while (reader.next(key,value)) {
     
      TestRecord testRecord = records.get(index++);
      // get test key bytes as utf-8 bytes ...
      byte[] testKeyBytes = testRecord.url.getBytes(Charset.forName("UTF-8"));
      // compare against raw key bytes to validate key is the same (Text's utf-8 mapping code replaces invalid characters
      // with ?, which causes our test case (which does use invalid characters to from the key, to break.
      Assert.assertTrue(ArcFileReaderTests.compareTo(testKeyBytes,0,testKeyBytes.length,key.getBytes(),0,key.getLength()) == 0);
View Full Code Here

Examples of org.commoncrawl.util.shared.ArcFileReaderTests.TestRecord

    // iterate and validate stuff ...
    while (reader.nextKeyValue()) {
      Text key = reader.getCurrentKey();
      BytesWritable value = reader.getCurrentValue();
     
      TestRecord testRecord = records.get(itemIndex++);
      // get test key bytes as utf-8 bytes ...
      byte[] testKeyBytes = testRecord.url.getBytes(Charset.forName("UTF-8"));
      // compare against raw key bytes to validate key is the same (Text's utf-8 mapping code replaces invalid characters
      // with ?, which causes our test case (which does use invalid characters to from the key, to break.
      Assert.assertTrue(ArcFileReaderTests.compareTo(testKeyBytes,0,testKeyBytes.length,key.getBytes(),0,key.getLength()) == 0);
View Full Code Here

Examples of org.commoncrawl.util.shared.ArcFileReaderTests.TestRecord

    while (reader.nextKeyValue()) {
     
      Text key = reader.getCurrentKey();
      ArcFileItem value = reader.getCurrentValue();
     
      TestRecord testRecord = records.get(itemIndex++);
     
      // get test key bytes as utf-8 bytes ...
      byte[] testKeyBytes = testRecord.url.getBytes(Charset.forName("UTF-8"));
      // compare against raw key bytes to validate key is the same (Text's utf-8 mapping code replaces invalid characters
      // with ?, which causes our test case (which does use invalid characters to from the key, to break.
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.