Package org.apache.avro.test.errors

Examples of org.apache.avro.test.errors.TestError


    assertEquals(record.hashCode(), echoed.hashCode());
  }

  @Test
  public void testError() throws IOException {
    TestError error = null;
    try {
      proxy.error();
    } catch (TestError e) {
      error = e;
    }
View Full Code Here


public class TestNamespaceSpecific {

  public static class TestImpl implements TestNamespace {
    public TestRecord echo(TestRecord record) { return record; }
    public Void error() throws AvroRemoteException {
      TestError error = new TestError();
      error.message = new Utf8("an error");
      throw error;
    }
View Full Code Here

public class TestNamespaceSpecific {

  public static class TestImpl implements TestNamespace {
    public TestRecord echo(TestRecord record) { return record; }
    public Void error() throws AvroRemoteException {
      TestError error = new TestError();
      error.message = new Utf8("an error");
      throw error;
    }
View Full Code Here

    assertEquals(record.hashCode(), echoed.hashCode());
  }

  @Test
  public void testError() throws IOException {
    TestError error = null;
    try {
      proxy.error();
    } catch (TestError e) {
      error = e;
    }
View Full Code Here

    assertEquals(record.hashCode(), echoed.hashCode());
  }

  @Test
  public void testError() throws IOException {
    TestError error = null;
    try {
      proxy.error();
    } catch (TestError e) {
      error = e;
    }
View Full Code Here

    = LoggerFactory.getLogger(TestNamespaceSpecific.class);

  public static class TestImpl implements TestNamespace {
    public TestRecord echo(TestRecord record) { return record; }
    public Void error() throws AvroRemoteException {
      TestError error = new TestError();
      error.message = new Utf8("an error");
      throw error;
    }
View Full Code Here

    assertEquals(record.hashCode(), echoed.hashCode());
  }

  @Test
  public void testError() throws IOException {
    TestError error = null;
    try {
      proxy.error();
    } catch (TestError e) {
      error = e;
    }
View Full Code Here

public class TestNamespaceSpecific {

  public static class TestImpl implements TestNamespace {
    public TestRecord echo(TestRecord record) { return record; }
    public Void error() throws AvroRemoteException {
      TestError error = new TestError();
      error.message = new Utf8("an error");
      throw error;
    }
View Full Code Here

    Assert.assertTrue(testErrorBuilder.hasCause());
    Assert.assertNotNull(testErrorBuilder.getCause());
    Assert.assertTrue(testErrorBuilder.hasMessage$());
    Assert.assertNotNull(testErrorBuilder.getMessage$());
   
    TestError testError = testErrorBuilder.build();
    Assert.assertEquals("value", testError.getValue());
    Assert.assertEquals("value", testError.getMessage());
    Assert.assertEquals("message$", testError.getMessage$());
   
    // Test copy constructor
    Assert.assertEquals(testErrorBuilder,
        TestError.newBuilder(testErrorBuilder));
    Assert.assertEquals(testErrorBuilder, TestError.newBuilder(testError));
   
    TestError error = new TestError("value", new NullPointerException());
    error.setMessage$("message");
    Assert.assertEquals(error,
        TestError.newBuilder().setValue("value").
          setCause(new NullPointerException()).setMessage$("message").build());
   
    // Test clear
View Full Code Here

    assertEquals(record.hashCode(), echoed.hashCode());
  }

  @Test
  public void testError() throws IOException {
    TestError error = null;
    try {
      proxy.error();
    } catch (TestError e) {
      error = e;
    }
    assertNotNull(error);
    assertEquals("an error", error.getMessage$().toString());
  }
View Full Code Here

TOP

Related Classes of org.apache.avro.test.errors.TestError

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.