public virtual void TestWriteApplicationAttempt()
        {
            RMAppAttempt appAttempt = CreateRMAppAttempt(ApplicationAttemptId.NewInstance(ApplicationId
                                                                                          .NewInstance(0, 1), 1));

            writer.ApplicationAttemptStarted(appAttempt);
            ApplicationAttemptHistoryData appAttemptHD = null;

            for (int i = 0; i < MaxRetries; ++i)
            {
                appAttemptHD = store.GetApplicationAttempt(ApplicationAttemptId.NewInstance(ApplicationId
                                                                                            .NewInstance(0, 1), 1));
                if (appAttemptHD != null)
                {
                    break;
                }
                else
                {
                    Sharpen.Thread.Sleep(100);
                }
            }
            NUnit.Framework.Assert.IsNotNull(appAttemptHD);
            NUnit.Framework.Assert.AreEqual("test host", appAttemptHD.GetHost());
            NUnit.Framework.Assert.AreEqual(-100, appAttemptHD.GetRPCPort());
            NUnit.Framework.Assert.AreEqual(ContainerId.NewContainerId(ApplicationAttemptId.NewInstance
                                                                           (ApplicationId.NewInstance(0, 1), 1), 1), appAttemptHD.GetMasterContainerId());
            writer.ApplicationAttemptFinished(appAttempt, RMAppAttemptState.Finished);
            for (int i_1 = 0; i_1 < MaxRetries; ++i_1)
            {
                appAttemptHD = store.GetApplicationAttempt(ApplicationAttemptId.NewInstance(ApplicationId
                                                                                            .NewInstance(0, 1), 1));
                if (appAttemptHD.GetYarnApplicationAttemptState() != null)
                {
                    break;
                }
                else
                {
                    Sharpen.Thread.Sleep(100);
                }
            }
            NUnit.Framework.Assert.AreEqual("test diagnostics info", appAttemptHD.GetDiagnosticsInfo
                                                ());
            NUnit.Framework.Assert.AreEqual("test url", appAttemptHD.GetTrackingURL());
            NUnit.Framework.Assert.AreEqual(FinalApplicationStatus.Undefined, appAttemptHD.GetFinalApplicationStatus
                                                ());
            NUnit.Framework.Assert.AreEqual(YarnApplicationAttemptState.Finished, appAttemptHD
                                            .GetYarnApplicationAttemptState());
        }