示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHonorsPassedInParams() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestHonorsPassedInParams()
        {
            BatchInserter inserter  = BatchInserters.inserter(_testDirectory.databaseDir(), _fileSystemRule.get(), stringMap(GraphDatabaseSettings.pagecache_memory.name(), "280K"));
            NeoStores     neoStores = ReflectionUtil.getPrivateField(inserter, "neoStores", typeof(NeoStores));
            PageCache     pageCache = ReflectionUtil.getPrivateField(neoStores, "pageCache", typeof(PageCache));

            inserter.Shutdown();
            long mappedMemoryTotalSize = MuninnPageCache.memoryRequiredForPages(pageCache.MaxCachedPages());

            assertThat("memory mapped config is active", mappedMemoryTotalSize, @is(allOf(greaterThan(kibiBytes(270)), lessThan(kibiBytes(290)))));
        }
示例#2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void run() throws Exception
        public virtual void Run()
        {
            using (FileSystemAbstraction fs = new DefaultFileSystemAbstraction(), JobScheduler jobScheduler = new ThreadPoolJobScheduler())
            {
                PageSwapperFactory swapperFactory = new SingleFilePageSwapperFactory();
                swapperFactory.Open(fs, Configuration.EMPTY);
                using (PageCache pageCacheUnderTest = new MuninnPageCache(swapperFactory, _numberOfCachePages, _tracer, _pageCursorTracerSupplier, EmptyVersionContextSupplier.EMPTY, jobScheduler))
                {
                    PageCacheStresser pageCacheStresser = new PageCacheStresser(_numberOfPages, _numberOfThreads, _workingDirectory);
                    pageCacheStresser.Stress(pageCacheUnderTest, _condition);
                }
            }
        }