Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void reportsProgress() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReportsProgress()
        {
            // given
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.causalclustering.discovery.Cluster<?> cluster = startCluster(recordFormat);
            Cluster <object> cluster = StartCluster(RecordFormat);

            ClusterHelper.createIndexes(cluster.GetMemberWithAnyRole(Role.LEADER).database());
            string customAddress = CausalClusteringTestHelpers.backupAddress(ClusterLeader(cluster).database());

            // when
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String backupName = "reportsProgress_" + recordFormat;
            string backupName = "reportsProgress_" + RecordFormat;

            assertEquals(0, RunBackupOtherJvm(customAddress, backupName));

            // then
            string output   = _suppressOutput.OutputVoice.ToString();
            string location = Paths.get(_backupStoreDir.ToString(), backupName).ToString();

            assertTrue(output.Contains("Start receiving store files"));
            assertTrue(output.Contains("Finish receiving store files"));
            string tested = Paths.get(location, "neostore.nodestore.db.labels").ToString();

            assertTrue(tested, output.Contains(format("Start receiving store file %s", tested)));
            assertTrue(tested, output.Contains(format("Finish receiving store file %s", tested)));
            assertTrue(output.Contains("Start receiving transactions from "));
            assertTrue(output.Contains("Finish receiving transactions at "));
            assertTrue(output.Contains("Start receiving index snapshots"));
            assertTrue(output.Contains("Finished receiving index snapshots"));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void dataIsInAUsableStateAfterBackup() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DataIsInAUsableStateAfterBackup()
        {
            // given database exists
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.causalclustering.discovery.Cluster<?> cluster = startCluster(recordFormat);
            Cluster <object> cluster = StartCluster(RecordFormat);

            // and the database has indexes
            ClusterHelper.createIndexes(cluster.GetMemberWithAnyRole(Role.LEADER).database());

            // and the database is being populated
            AtomicBoolean populateDatabaseFlag = new AtomicBoolean(true);
            Thread        thread = new Thread(() => repeatedlyPopulateDatabase(cluster, populateDatabaseFlag));

            thread.Start();               // populate db with number properties etc.
            try
            {
                // then backup is successful
                string address = cluster.AwaitLeader().config().get(online_backup_server).ToString();
                assertEquals(0, RunBackupOtherJvm(address, DATABASE_NAME));
            }
            finally
            {
                populateDatabaseFlag.set(false);
                thread.Join();
            }
        }