Beispiel #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 reportNotCleanLabelIndex() 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 ReportNotCleanLabelIndex()
        {
            DatabaseLayout databaseLayout = Db.databaseLayout();

            SomeData();
            Db.resolveDependency(typeof(CheckPointer)).forceCheckPoint(new SimpleTriggerInfo("forcedCheckpoint"));
            File labelIndexFileCopy = databaseLayout.File("label_index_copy");

            copyFile(databaseLayout.LabelScanStore(), labelIndexFileCopy);

            using (Transaction tx = Db.beginTx())
            {
                Db.createNode(LABEL_ONE);
                tx.Success();
            }

            Db.shutdownAndKeepStore();

            copyFile(labelIndexFileCopy, databaseLayout.LabelScanStore());

            ConsistencyCheckService.Result result = FullConsistencyCheck();
            assertFalse("Expected consistency check to fail", result.Successful);
            assertThat(ReadReport(result), hasItem(containsString("WARN : Label index was not properly shutdown and rebuild is required.")));
        }
Beispiel #3
0
 private File File(string localname)
 {
     return(DbRule.databaseLayout().file(localname));
 }