Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void pointerToOldVersionOfTreeNode() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void PointerToOldVersionOfTreeNode()
        {
            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.setPointer(GBPTreePointerType.successor(), 6)));
            }, indexFiles);

            ConsistencyCheckService.Result result = RunConsistencyCheck();

            assertFalse("Expected store to be considered inconsistent.", result.Successful);
            AssertResultContainsMessage(result, "We ended up on tree node " + targetNode.Value + " which has a newer generation, successor is: 6");
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCleanMultipleCrashPerPage() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCleanMultipleCrashPerPage()
        {
            // GIVEN
            Page[] pages = With(LeafWith(GBPTreeCorruption.Crashed(GBPTreePointerType.leftSibling()), GBPTreeCorruption.Crashed(GBPTreePointerType.rightSibling()), GBPTreeCorruption.Crashed(GBPTreePointerType.successor())), InternalWith(GBPTreeCorruption.Crashed(GBPTreePointerType.leftSibling()), GBPTreeCorruption.Crashed(GBPTreePointerType.rightSibling()), GBPTreeCorruption.Crashed(GBPTreePointerType.successor()), GBPTreeCorruption.Crashed(GBPTreePointerType.child(0))));
            InitializeFile(_pagedFile, pages);

            // WHEN
            SimpleCleanupMonitor monitor = new SimpleCleanupMonitor();

            CrashGenerationCleaner(_pagedFile, 0, pages.Length, monitor).clean(_executor);

            // THEN
            AssertPagesVisited(monitor, pages.Length);
            AssertCleanedCrashPointers(monitor, 7);
        }