Apache.NMS.ActiveMQ.Test.Transactions.RecoveryFileLoggerTest.TestPurgeTransactionRecord C# (CSharp) Метод

TestPurgeTransactionRecord() приватный Метод

private TestPurgeTransactionRecord ( ) : void
Результат void
        public void TestPurgeTransactionRecord()
        {
            RecoveryFileLogger logger = new RecoveryFileLogger();

            byte[] globalId = new byte[32];
            byte[] branchQ = new byte[32];
            byte[] recoveryData = new byte[256];

            Random gen = new Random();

            gen.NextBytes(globalId);
            gen.NextBytes(branchQ);
            gen.NextBytes(recoveryData);

            logger.Location = nonDefaultLogLocation;
            logger.Initialize(rmId.ToString());

            XATransactionId xid = new XATransactionId();
            xid.GlobalTransactionId = globalId;
            xid.BranchQualifier = branchQ;

            logger.LogRecoveryInfo(xid, recoveryData);

            Assert.IsTrue(File.Exists(logger.Location + Path.DirectorySeparatorChar + rmId.ToString() + ".bin"),
                          "Recovery File was not created");

            logger.Purge();

            Assert.IsFalse(File.Exists(logger.Location + Path.DirectorySeparatorChar + rmId.ToString() + ".bin"),
                          "Recovery File was not created");
        }