Ejemplo n.º 1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestLocalResourceStatusSerDe()
        {
            LocalResourceStatus rsrcS = CreateLocalResourceStatus();

            NUnit.Framework.Assert.IsTrue(rsrcS is LocalResourceStatusPBImpl);
            LocalResourceStatusPBImpl rsrcPb = (LocalResourceStatusPBImpl)rsrcS;
            DataOutputBuffer          @out   = new DataOutputBuffer();

            rsrcPb.GetProto().WriteDelimitedTo(@out);
            DataInputBuffer @in = new DataInputBuffer();

            @in.Reset(@out.GetData(), 0, @out.GetLength());
            YarnServerNodemanagerServiceProtos.LocalResourceStatusProto rsrcPbD = YarnServerNodemanagerServiceProtos.LocalResourceStatusProto
                                                                                  .ParseDelimitedFrom(@in);
            NUnit.Framework.Assert.IsNotNull(rsrcPbD);
            LocalResourceStatus rsrcD = new LocalResourceStatusPBImpl(rsrcPbD);

            NUnit.Framework.Assert.AreEqual(rsrcS, rsrcD);
            NUnit.Framework.Assert.AreEqual(CreateResource(), rsrcS.GetResource());
            NUnit.Framework.Assert.AreEqual(CreateResource(), rsrcD.GetResource());
        }
Ejemplo n.º 2
0
 private LocalResourceStatus ConvertFromProtoFormat(YarnServerNodemanagerServiceProtos.LocalResourceStatusProto
                                                    p)
 {
     return(new LocalResourceStatusPBImpl(p));
 }