Package org.apache.hadoop.yarn.proto.YarnProtos

Examples of org.apache.hadoop.yarn.proto.YarnProtos.SerializedExceptionProto


public class TestSerializedExceptionPBImpl {
  @Test
  public void testSerializedException() throws Exception {
    SerializedExceptionPBImpl orig = new SerializedExceptionPBImpl();
    orig.init(new Exception("test exception"));
    SerializedExceptionProto proto = orig.getProto();
    SerializedExceptionPBImpl deser = new SerializedExceptionPBImpl(proto);
    Assert.assertEquals(orig, deser);
    Assert.assertEquals(orig.getMessage(), deser.getMessage());
    Assert.assertEquals(orig.getRemoteTrace(), deser.getRemoteTrace());
    Assert.assertEquals(orig.getCause(), deser.getCause());
View Full Code Here


    Assert.assertEquals(ex.toString(), pb.deSerialize().toString());
  }

  @Test
  public void testBeforeInit() throws Exception {
    SerializedExceptionProto defaultProto =
        SerializedExceptionProto.newBuilder().build();

    SerializedExceptionPBImpl pb1 = new SerializedExceptionPBImpl();
    Assert.assertNull(pb1.getCause());

    SerializedExceptionPBImpl pb2 = new SerializedExceptionPBImpl();
    Assert.assertEquals(defaultProto, pb2.getProto());

    SerializedExceptionPBImpl pb3 = new SerializedExceptionPBImpl();
    Assert.assertEquals(defaultProto.getTrace(), pb3.getRemoteTrace());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.proto.YarnProtos.SerializedExceptionProto

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.