예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSeedNewMemberToCluster() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSeedNewMemberToCluster()
        {
            // given
            _cluster.start();

            // when
            Optional <File> backup = SeedStore.generate(_baseBackupDir, _cluster);

            // then
            // possibly add load to cluster in between backup
            IntermediateLoad.start(_cluster);

            // when
            CoreClusterMember newCoreClusterMember = _cluster.addCoreMemberWithId(3);

            if (backup.Present)
            {
                restoreFromBackup(backup.get(), _fileSystemRule.get(), newCoreClusterMember);
            }

            // we want the new instance to seed from backup and not delete and re-download the store
            newCoreClusterMember.Monitors().addMonitorListener(_fileCopyDetector);
            newCoreClusterMember.Start();

            // then
            IntermediateLoad.stop();
            dataMatchesEventually(newCoreClusterMember, _cluster.coreMembers());
            assertFalse(_fileCopyDetector.hasDetectedAnyFileCopied());
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSeedNewCluster() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSeedNewCluster()
        {
            // given
            _backupCluster.start();
            Optional <File> backup = InitialStore.generate(_baseBackupDir, _backupCluster);

            _backupCluster.shutdown();

            if (backup.Present)
            {
                foreach (CoreClusterMember coreClusterMember in _cluster.coreMembers())
                {
                    restoreFromBackup(backup.get(), _fileSystemRule.get(), coreClusterMember);
                }
            }

            // we want the cluster to seed from backup. No instance should delete and re-copy the store.
            _cluster.coreMembers().forEach(ccm => ccm.monitors().addMonitorListener(_fileCopyDetector));

            // when
            _cluster.start();

            // then
            if (backup.Present)
            {
                Config config = Config.defaults(GraphDatabaseSettings.active_database, backup.get().Name);
                dataMatchesEventually(DbRepresentation.of(backup.get(), config), _cluster.coreMembers());
            }
            assertEquals(ShouldStoreCopy, _fileCopyDetector.hasDetectedAnyFileCopied());
        }