Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void freeFrozenMemory()
        internal virtual void FreeFrozenMemory()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.memory.MemoryAllocationTracker memoryTrackerSpy = spy(new org.neo4j.memory.LocalMemoryTracker());
            MemoryAllocationTracker memoryTrackerSpy = spy(new LocalMemoryTracker());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, blockAllocator));
            MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, _blockAllocator));

            verify(memoryTrackerSpy).allocated(anyLong());

            set2.AddAll(100, 200, 300);
            set2.Freeze();
            set2.Remove(100);
            set2.Freeze();
            set2.Clear();
            set2.Close();
            verify(memoryTrackerSpy, times(3)).deallocated(anyLong());
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void testEquals()
        internal virtual void TestEquals()
        {
            _set.addAll(1, 2, 3, 100, 200, 300);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(memoryAllocator);
            MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(_memoryAllocator);

            set2.AddAll(300, 200, 100, 3, 2, 1);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.impl.set.mutable.primitive.LongHashSet set3 = newSetWith(300, 200, 100, 3, 2, 1);
            LongHashSet set3 = newSetWith(300, 200, 100, 3, 2, 1);

            assertEquals(_set, set2);
            assertEquals(_set, set3);

            _set.removeAll(1, 100);
            assertNotEquals(_set, set2);
            assertNotEquals(_set, set3);

            set2.Close();
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void allocateFreeMemory()
        internal virtual void AllocateFreeMemory()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.memory.MemoryAllocationTracker memoryTrackerSpy = spy(new org.neo4j.memory.LocalMemoryTracker());
            MemoryAllocationTracker memoryTrackerSpy = spy(new LocalMemoryTracker());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, blockAllocator));
            MutableLinearProbeLongHashSet set2 = new MutableLinearProbeLongHashSet(new OffHeapMemoryAllocator(memoryTrackerSpy, _blockAllocator));

            verify(memoryTrackerSpy).allocated(anyLong());

            for (int i = 0; i < DEFAULT_CAPACITY; i++)
            {
                set2.Add(100 + i);
            }
            verify(memoryTrackerSpy).deallocated(anyLong());
            verify(memoryTrackerSpy, times(2)).allocated(anyLong());

            set2.Close();
            verify(memoryTrackerSpy, times(2)).deallocated(anyLong());
        }