Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void backupCanBeOptionallySwitchedOnWithTheBackupConfig() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BackupCanBeOptionallySwitchedOnWithTheBackupConfig()
        {
            // given a cluster with backup switched on
            int[]  backupPorts = new int[] { PortAuthority.allocatePort(), PortAuthority.allocatePort(), PortAuthority.allocatePort() };
            string value       = "localhost:%d";

            _clusterRule = _clusterRule.withSharedCoreParam(OnlineBackupSettings.online_backup_enabled, "true").withInstanceCoreParam(online_backup_server, i => format(value, backupPorts[i]));
//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);
            string           customAddress = "localhost:" + backupPorts[0];

            // when a full backup is performed
            assertEquals(0, RunBackupOtherJvm(customAddress, DATABASE_NAME));
            assertEquals(DbRepresentation.of(ClusterDatabase(cluster)), GetBackupDbRepresentation(DATABASE_NAME, _backupStoreDir));

            // and an incremental backup is performed
            CreateSomeData(cluster);
            assertEquals(0, RunBackupOtherJvm(customAddress, DATABASE_NAME));
            assertEquals(0, RunBackupToolFromOtherJvmToGetExitCode("--from=" + customAddress, "--cc-report-dir=" + _backupStoreDir, "--backup-dir=" + _backupStoreDir, "--name=defaultport", Arg(ARG_NAME_FALLBACK_FULL, false)));

            // then the data matches
            assertEquals(DbRepresentation.of(ClusterDatabase(cluster)), GetBackupDbRepresentation(DATABASE_NAME, _backupStoreDir));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReplicateWithCompression() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReplicateWithCompression()
        {
            // given
            ClusterRule.withSharedCoreParam(compression_implementations, ModifierProtocol.implementation()).withSharedReadReplicaParam(compression_implementations, ModifierProtocol.implementation());

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.causalclustering.discovery.Cluster<?> cluster = clusterRule.startCluster();
            Cluster <object> cluster = ClusterRule.startCluster();

            // when
            int numberOfNodes        = 10;
            CoreClusterMember leader = createLabelledNodesWithProperty(cluster, numberOfNodes, label("Foo"), () => Pair.of("foobar", format("baz_bat%s", System.Guid.randomUUID())));

            // then
            assertEquals(numberOfNodes, countNodes(leader));
            dataMatchesEventually(leader, cluster.CoreMembers());
        }