Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void multipleCorruptions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MultipleCorruptions()
        {
            Setup(GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10);
            MutableObject <long> internalNode = new MutableObject <long>();

            File[] indexFiles = SchemaIndexFiles();
            CorruptIndexes(true, (tree, inspection) =>
            {
                long leafNode            = inspection.LeafNodes.get(0);
                internalNode.Value       = inspection.NodesPerLevel.get(1).get(1);
                int?internalNodeKeyCount = inspection.KeyCounts.get(internalNode.Value);
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(leafNode, GBPTreeCorruption.rightSiblingPointToNonExisting()));
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(internalNode.Value, GBPTreeCorruption.swapChildOrder(0, 1, internalNodeKeyCount)));
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(internalNode.Value, GBPTreeCorruption.broken(GBPTreePointerType.leftSibling())));
            }, indexFiles);

            ConsistencyCheckService.Result result = RunConsistencyCheck();
            AssertResultContainsMessage(result, "Index inconsistency: Sibling pointers misaligned.");
            AssertResultContainsMessage(result, "Index inconsistency: Expected range for this tree node is");
            AssertResultContainsMessage(result, "Index inconsistency: Broken pointer found in tree node " + internalNode.Value + ", pointerType='left sibling'");
            AssertResultContainsMessage(result, "Index inconsistency: Pointer (left sibling) in tree node " + internalNode.Value + " has pointer generation 0, but target node 0 has a higher generation 4.");
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void multipleCorruptionsInLabelScanStore() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MultipleCorruptionsInLabelScanStore()
        {
            Setup(GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10);
            MutableObject <long> rootNode = new MutableObject <long>();
            File labelScanStoreFile       = labelScanStoreFile();

            CorruptIndexes(true, (tree, inspection) =>
            {
                rootNode.Value = inspection.RootNode;
                tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(rootNode.Value, GBPTreeCorruption.broken(GBPTreePointerType.leftSibling())));
            }, labelScanStoreFile);

            ConsistencyCheckService.Result result = RunConsistencyCheck();
            assertFalse(result.Successful);
            AssertResultContainsMessage(result, "Index inconsistency: Broken pointer found in tree node " + rootNode.Value + ", pointerType='left sibling'");
            AssertResultContainsMessage(result, "Number of inconsistent LABEL_SCAN_DOCUMENT records: 1");
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void brokenPointer() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BrokenPointer()
        {
            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.broken(GBPTreePointerType.leftSibling())));
            }, indexFiles);

            ConsistencyCheckService.Result result = RunConsistencyCheck();

            assertFalse("Expected store to be considered inconsistent.", result.Successful);
            AssertResultContainsMessage(result, "Broken pointer found in tree node " + targetNode.Value);
        }