public GetRecoverables ( ) : byte[]>[].KeyValuePair |
||
return | byte[]>[].KeyValuePair |
public void TestRecoverLoggedRecord() { 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"); Assert.IsTrue(logger.GetRecoverables().Length == 1, "Did not recover the logged record."); KeyValuePair<XATransactionId, byte[]>[] records = logger.GetRecoverables(); Assert.AreEqual(1, records.Length); Assert.AreEqual(globalId, records[0].Key.GlobalTransactionId, "Incorrect Global TX Id returned"); Assert.AreEqual(branchQ, records[0].Key.BranchQualifier, "Incorrect Branch Qualifier returned"); Assert.AreEqual(recoveryData, records[0].Value, "Incorrect Recovery Information returned"); }
public void TestNothingToRecover() { RecoveryFileLogger logger = new RecoveryFileLogger(); logger.Location = nonDefaultLogLocation; logger.Initialize(rmId.ToString()); Assert.IsTrue(logger.GetRecoverables().Length == 0); }