//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void multipleCorruptionsInFusionIndex() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void MultipleCorruptionsInFusionIndex() { Setup(GraphDatabaseSettings.SchemaIndex.NATIVE20, db => { using (Transaction tx = Db.beginTx()) { // Also make sure we have some numbers for (int i = 0; i < 1000; i++) { Node node = Db.createNode(_label); node.setProperty(PROP_KEY1, i); Node secondNode = Db.createNode(_label); secondNode.setProperty(PROP_KEY1, LocalDate.ofEpochDay(i)); } tx.success(); } }); File[] indexFiles = SchemaIndexFiles(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<java.io.File> files = corruptIndexes(true, (tree, inspection) -> IList <File> files = CorruptIndexes(true, (tree, inspection) => { long leafNode = inspection.LeafNodes.get(1); long internalNode = inspection.InternalNodes.get(0); tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(leafNode, GBPTreeCorruption.rightSiblingPointToNonExisting())); tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(internalNode, GBPTreeCorruption.setChild(0, internalNode))); }, indexFiles); ConsistencyCheckService.Result result = RunConsistencyCheck(); foreach (File file in files) { AssertResultContainsMessage(result, "Index file: " + file.AbsolutePath); } }
//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."); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void siblingsDontPointToEachOther() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void SiblingsDontPointToEachOther() { Setup(GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10); MutableObject <long> targetNode = new MutableObject <long>(); File[] indexFiles = SchemaIndexFiles(); CorruptIndexes(true, (tree, inspection) => { targetNode.Value = inspection.LeafNodes.get(0); tree.@unsafe(GBPTreeCorruption.pageSpecificCorruption(targetNode.Value, GBPTreeCorruption.rightSiblingPointToNonExisting())); }, indexFiles); ConsistencyCheckService.Result result = RunConsistencyCheck(); assertFalse("Expected store to be considered inconsistent.", result.Successful); AssertResultContainsMessage(result, "Sibling pointers misaligned."); }