コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void actuallyDeletesTheFiles() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ActuallyDeletesTheFiles()
        {
            // given
//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();

            CoreClusterMember coreGraphDatabase = null;
            int txs = 10;

            for (int i = 0; i < txs; i++)
            {
                coreGraphDatabase = cluster.CoreTx((db, tx) =>
                {
                    createData(db, 1);
                    tx.success();
                });
            }

            // when pruning kicks in then some files are actually deleted
            File raftLogDir = coreGraphDatabase.RaftLogDirectory();
            int  expectedNumberOfLogFilesAfterPruning = 2;

            assertEventually("raft logs eventually pruned", () => NumberOfFiles(raftLogDir), equalTo(expectedNumberOfLogFilesAfterPruning), 5, TimeUnit.SECONDS);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createBufferedIdComponentsByDefault() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CreateBufferedIdComponentsByDefault()
        {
            Cluster            cluster            = ClusterRule.startCluster();
            CoreClusterMember  leader             = cluster.awaitLeader();
            DependencyResolver dependencyResolver = leader.Database().DependencyResolver;

            IdController       idController       = dependencyResolver.ResolveDependency(typeof(IdController));
            IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory));

            assertThat(idController, instanceOf(typeof(BufferedIdController)));
            assertThat(idGeneratorFactory, instanceOf(typeof(FreeIdFilteredIdGeneratorFactory)));
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createBufferedIdComponentsByDefault() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CreateBufferedIdComponentsByDefault()
        {
//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();
            CoreClusterMember  leader             = cluster.AwaitLeader();
            DependencyResolver dependencyResolver = leader.Database().DependencyResolver;

            IdController       idController       = dependencyResolver.ResolveDependency(typeof(IdController));
            IdGeneratorFactory idGeneratorFactory = dependencyResolver.ResolveDependency(typeof(IdGeneratorFactory));

            assertThat(idController, instanceOf(typeof(BufferedIdController)));
            assertThat(idGeneratorFactory, instanceOf(typeof(FreeIdFilteredIdGeneratorFactory)));
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMonitorMessageDelay() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMonitorMessageDelay()
        {
            // given
            _cluster = ClusterRule.startCluster();

            // then
            CoreClusterMember leader = _cluster.awaitLeader();
            File coreMetricsDir      = new File(leader.HomeDir(), csvPath.DefaultValue);

            assertEventually("message delay eventually recorded", () => readLongValue(metricsCsv(coreMetricsDir, CoreMetrics.DELAY)), greaterThanOrEqualTo(0L), TIMEOUT, TimeUnit.SECONDS);

            assertEventually("message timer count eventually recorded", () => readTimerLongValueAndAssert(metricsCsv(coreMetricsDir, CoreMetrics.TIMER), (newValue, currentValue) => newValue >= currentValue, MetricsTestHelper.TimerField.Count), greaterThan(0L), TIMEOUT, TimeUnit.SECONDS);

            assertEventually("message timer max eventually recorded", () => readTimerDoubleValue(metricsCsv(coreMetricsDir, CoreMetrics.TIMER), MetricsTestHelper.TimerField.Max), greaterThanOrEqualTo(0d), TIMEOUT, TimeUnit.SECONDS);
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void readReplicasShouldRefuseWrites() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReadReplicasShouldRefuseWrites()
        {
            // given
//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();
            GraphDatabaseService db      = cluster.FindAnyReadReplica().database();
            Transaction          tx      = Db.beginTx();

            // then
            ExceptionMatcher.expect(typeof(WriteOperationsNotAllowedException));

            // when
            Db.createNode();
            tx.Success();
            tx.Close();
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _cluster = ClusterRule.startCluster();
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _backupPath = ClusterRule.testDirectory().cleanDirectory("backup-db");
            _cluster    = ClusterRule.startCluster();
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldActuallyStartAClusterWithPreVoting() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldActuallyStartAClusterWithPreVoting()
        {
            ClusterRule.startCluster();
            // pass
        }