コード例 #1
0
        public virtual void TestPbRecordFactory()
        {
            RecordFactory pbRecordFactory = RecordFactoryPBImpl.Get();

            try
            {
                AllocateResponse response = pbRecordFactory.NewRecordInstance <AllocateResponse>();
                NUnit.Framework.Assert.AreEqual(typeof(AllocateResponsePBImpl), response.GetType(
                                                    ));
            }
            catch (YarnRuntimeException e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
                NUnit.Framework.Assert.Fail("Failed to crete record");
            }
            try
            {
                AllocateRequest response = pbRecordFactory.NewRecordInstance <AllocateRequest>();
                NUnit.Framework.Assert.AreEqual(typeof(AllocateRequestPBImpl), response.GetType()
                                                );
            }
            catch (YarnRuntimeException e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
                NUnit.Framework.Assert.Fail("Failed to crete record");
            }
        }