Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void reportNotCleanNativeIndex() throws java.io.IOException, org.neo4j.consistency.checking.full.ConsistencyCheckIncompleteException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReportNotCleanNativeIndex()
        {
            DatabaseLayout databaseLayout = Db.databaseLayout();

            SomeData();
            ResolveComponent(typeof(CheckPointer)).forceCheckPoint(new SimpleTriggerInfo("forcedCheckpoint"));
            File indexesCopy  = databaseLayout.File("indexesCopy");
            File indexSources = ResolveComponent(typeof(DefaultIndexProviderMap)).DefaultProvider.directoryStructure().rootDirectory();

            copyRecursively(indexSources, indexesCopy, _sourceCopyFileFilter);

            using (Transaction tx = Db.beginTx())
            {
                CreateNewNode(new Label[] { LABEL_ONE });
                tx.Success();
            }

            Db.shutdownAndKeepStore();

            copyRecursively(indexesCopy, indexSources);

            ConsistencyCheckService.Result result = FullConsistencyCheck();
            assertFalse("Expected consistency check to fail", result.Successful);
            assertThat(ReadReport(result), hasItem(containsString("WARN : Index was not properly shutdown and rebuild is required.")));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustReportSuccessfulForConsistentLabelScanStore() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustReportSuccessfulForConsistentLabelScanStore()
        {
            // given
            SomeData();
            Db.shutdownAndKeepStore();

            // when
            ConsistencyCheckService.Result result = FullConsistencyCheck();

            // then
            assertTrue("Expected consistency check to succeed", result.Successful);
        }