Examples of MD5


Examples of org.apache.avro.test.MD5

    // create a generic instance of this record
    TestRecord nested = new TestRecord();
    nested.name = new Utf8("foo");
    nested.kind = Kind.BAR;
    nested.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     nested.hash.bytes(), 0, 16);
    GenericData.Record record = new GenericData.Record(schema);
    record.put("f", nested);
View Full Code Here

Examples of org.apache.avro.test.MD5

  public void testSpecificRecord() throws Exception {
    TestRecord s1 = new TestRecord();
    TestRecord s2 = new TestRecord();
    s1.name = new Utf8("foo");
    s1.kind = Kind.BAZ;
    s1.hash = new MD5();
    s1.hash.bytes(new byte[] {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5});
    s2.name = new Utf8("bar");
    s2.kind = Kind.BAR;
    s2.hash = new MD5();
    s2.hash.bytes(new byte[] {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,6});
    Schema schema = SpecificData.get().getSchema(TestRecord.class);

    check(schema, s1, s2, true, new SpecificDatumWriter<TestRecord>(schema),
          SpecificData.get());
View Full Code Here

Examples of org.apache.avro.test.MD5

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.name = new Utf8("foo");
    record.kind = Kind.BAR;
    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.MD5

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.name = new Utf8("foo");
    record.kind = Kind.BAR;
    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.MD5

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.setName("foo");
    record.setKind(Kind.BAR);
    record.setHash(new MD5(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}));
    TestRecord echoed = proxy.echo(record);
    assertEquals(record, echoed);
    assertEquals(record.hashCode(), echoed.hashCode());
  }
View Full Code Here

Examples of org.apache.avro.test.MD5

    // create a generic instance of this record
    TestRecord nested = new TestRecord();
    nested.setName("foo");
    nested.setKind(Kind.BAR);
    nested.setHash(new MD5(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}));
    GenericData.Record record = new GenericData.Record(schema);
    record.put("f", nested);

    // test that this instance can be written & re-read
    TestSchema.checkBinary(schema, record,
View Full Code Here

Examples of org.apache.avro.test.MD5

    // create a generic instance of this record
    TestRecord nested = new TestRecord();
    nested.setName("foo");
    nested.setKind(Kind.BAR);
    nested.setHash(new MD5(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}));
    GenericData.Record record = new GenericData.Record(schema);
    record.put("f", nested);

    // test that this instance can be written & re-read
    TestSchema.checkBinary(schema, record,
View Full Code Here

Examples of org.apache.avro.test.MD5

  @Test
  public void testEcho() throws IOException {
    TestRecord record = new TestRecord();
    record.name = new Utf8("foo");
    record.kind = Kind.BAR;
    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.MD5

    // create a generic instance of this record
    TestRecord nested = new TestRecord();
    nested.name = new Utf8("foo");
    nested.kind = Kind.BAR;
    nested.hash = new MD5();
    System.arraycopy(new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, 0,
                     nested.hash.bytes(), 0, 16);
    GenericData.Record record = new GenericData.Record(schema);
    record.put("f", nested);
View Full Code Here

Examples of org.apache.avro.test.MD5

  public void testSpecificRecord() throws Exception {
    TestRecord s1 = new TestRecord();
    TestRecord s2 = new TestRecord();
    s1.name = new Utf8("foo");
    s1.kind = Kind.BAZ;
    s1.hash = new MD5();
    s1.hash.bytes(new byte[] {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5});
    s2.name = new Utf8("bar");
    s2.kind = Kind.BAR;
    s2.hash = new MD5();
    s2.hash.bytes(new byte[] {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,6});
    Schema schema = SpecificData.get().getSchema(TestRecord.class);

    check(schema, s1, s2, true, new SpecificDatumWriter<TestRecord>(schema),
          SpecificData.get());
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.