Exemplo n.º 1
0
        /// <exception cref="System.Exception"></exception>
        public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
                                               block)
        {
            LocalObjectContainer   container  = (LocalObjectContainer)trans.Container();
            ITransactionalIdSystem idSystem   = trans.IdSystem();
            IEnumerator            allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
            Collection4            allSlots   = new Collection4();

            while (allSlotIDs.MoveNext())
            {
                int  slotID = ((int)allSlotIDs.Current);
                Slot slot   = idSystem.CurrentSlot(slotID);
                allSlots.Add(slot);
            }
            Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());

            allSlots.Add(bTreeSlot);
            Collection4       freedSlots       = new Collection4();
            IFreespaceManager freespaceManager = container.FreespaceManager();

            container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
                                                                                    (freedSlots)));
            block.Run();
            container.InstallDebugFreespaceManager(freespaceManager);
            Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
        }
Exemplo n.º 2
0
 /// <exception cref="System.Exception"></exception>
 public void Run()
 {
     // This is a magic number:
     // On my machine all tests start to pass when I write at least 7 times.
     // Trying with 20 on the build machine.
     for (var i = 0; i < 20; i++)
     {
         codeBlock.Run();
     }
 }
Exemplo n.º 3
0
 public void Run()
 {
     try
     {
         codeBlock.Run();
     }
     catch (Exception t)
     {
         Runtime.PrintStackTrace(t);
     }
 }
Exemplo n.º 4
0
		private static Exception GetThrowable(ICodeBlock block)
		{
			try
			{
				block.Run();
			}
			catch (Exception e)
			{
				return e;
			}
			return null;
		}
Exemplo n.º 5
0
 private static Exception GetThrowable(ICodeBlock block)
 {
     try
     {
         block.Run();
     }
     catch (Exception e)
     {
         return(e);
     }
     return(null);
 }
Exemplo n.º 6
0
		/// <exception cref="System.Exception"></exception>
		public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
			 block)
		{
			LocalObjectContainer container = (LocalObjectContainer)trans.Container();
			ITransactionalIdSystem idSystem = trans.IdSystem();
			IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
			Collection4 allSlots = new Collection4();
			while (allSlotIDs.MoveNext())
			{
				int slotID = ((int)allSlotIDs.Current);
				Slot slot = idSystem.CurrentSlot(slotID);
				allSlots.Add(slot);
			}
			Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());
			allSlots.Add(bTreeSlot);
			Collection4 freedSlots = new Collection4();
			IFreespaceManager freespaceManager = container.FreespaceManager();
			container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
				(freedSlots)));
			block.Run();
			container.InstallDebugFreespaceManager(freespaceManager);
			Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
		}