示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void unusedPage() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UnusedPage()
        {
            Setup(GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10);
            File[] indexFiles = SchemaIndexFiles();
            CorruptIndexes(true, (tree, inspection) =>
            {
                long?internalNode = inspection.NodesPerLevel.get(1).get(0);
                int keyCount      = inspection.KeyCounts.get(internalNode);
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(internalNode, GBPTreeCorruption.setKeyCount(keyCount - 1)));
            }, indexFiles);

            ConsistencyCheckService.Result result = RunConsistencyCheck();

            assertFalse("Expected store to be considered inconsistent.", result.Successful);
            AssertResultContainsMessage(result, "Index has a leaked page that will never be reclaimed, pageId=");
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void unreasonableKeyCount() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UnreasonableKeyCount()
        {
            Setup(GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10);
            MutableObject <long> targetNode = new MutableObject <long>();

            File[] indexFiles = SchemaIndexFiles();
            CorruptIndexes(true, (tree, inspection) =>
            {
                targetNode.Value = inspection.RootNode;
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(targetNode.Value, GBPTreeCorruption.setKeyCount(int.MaxValue)));
            }, indexFiles);

            ConsistencyCheckService.Result result = RunConsistencyCheck();

            assertFalse("Expected store to be considered inconsistent.", result.Successful);
            AssertResultContainsMessage(result, "Unexpected keyCount on pageId " + targetNode.Value + ", keyCount=" + int.MaxValue);
        }