Beispiel #1
0
        public virtual void TestSerializedException()
        {
            SerializedExceptionPBImpl orig = new SerializedExceptionPBImpl();

            orig.Init(new Exception("test exception"));
            YarnProtos.SerializedExceptionProto proto = orig.GetProto();
            SerializedExceptionPBImpl           deser = new SerializedExceptionPBImpl(proto);

            NUnit.Framework.Assert.AreEqual(orig, deser);
            NUnit.Framework.Assert.AreEqual(orig.GetMessage(), deser.GetMessage());
            NUnit.Framework.Assert.AreEqual(orig.GetRemoteTrace(), deser.GetRemoteTrace());
            NUnit.Framework.Assert.AreEqual(orig.GetCause(), deser.GetCause());
        }
Beispiel #2
0
        public virtual void TestBeforeInit()
        {
            YarnProtos.SerializedExceptionProto defaultProto = ((YarnProtos.SerializedExceptionProto
                                                                 )YarnProtos.SerializedExceptionProto.NewBuilder().Build());
            SerializedExceptionPBImpl pb1 = new SerializedExceptionPBImpl();

            NUnit.Framework.Assert.IsNull(pb1.GetCause());
            SerializedExceptionPBImpl pb2 = new SerializedExceptionPBImpl();

            NUnit.Framework.Assert.AreEqual(defaultProto, pb2.GetProto());
            SerializedExceptionPBImpl pb3 = new SerializedExceptionPBImpl();

            NUnit.Framework.Assert.AreEqual(defaultProto.GetTrace(), pb3.GetRemoteTrace());
        }