Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeEach void createPageCache()
        internal virtual void CreatePageCache()
        {
            SingleFilePageSwapperFactory factory = new SingleFilePageSwapperFactory();

            factory.Open(new DefaultFileSystemAbstraction(), Configuration.EMPTY);
            MemoryAllocator mman = MemoryAllocator.createAllocator("8 MiB", new LocalMemoryTracker());

            _jobScheduler = new ThreadPoolJobScheduler();
            _pageCache    = new MuninnPageCache(factory, mman, 256, PageCacheTracer.NULL, Org.Neo4j.Io.pagecache.tracing.cursor.PageCursorTracerSupplier_Fields.Null, EMPTY, _jobScheduler);
            _layout       = SimpleLongLayout.LongLayout().withFixedSize(true).build();
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustReadWhatIsWritten() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustReadWhatIsWritten()
        {
            // given
            Layout layout  = SimpleLongLayout.LongLayout().withIdentifier(666).withMajorVersion(10).withMinorVersion(100).build();
            Meta   written = new Meta(( sbyte )1, ( sbyte )2, _pageSize, layout);
            int    offset  = _cursor.Offset;

            written.Write(_cursor, layout);

            // when
            _cursor.Offset = offset;
            Meta read = Meta.Read(_cursor, layout);

            // then
            assertEquals(written.FormatIdentifier, read.FormatIdentifier);
            assertEquals(written.FormatVersion, read.FormatVersion);
            assertEquals(written.UnusedVersionSlot3, read.UnusedVersionSlot3);
            assertEquals(written.UnusedVersionSlot4, read.UnusedVersionSlot4);
            assertEquals(written.LayoutIdentifier, read.LayoutIdentifier);
            assertEquals(written.LayoutMajorVersion, read.LayoutMajorVersion);
            assertEquals(written.LayoutMinorVersion, read.LayoutMinorVersion);
            assertEquals(written.PageSize, read.PageSize);
        }