Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(timeout = TIMEOUT_MS) public void shouldDiscoverCompleteTargetSetWithoutDeadlocks() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDiscoverCompleteTargetSetWithoutDeadlocks()
        {
            // given
            ExecutorService es = Executors.newCachedThreadPool();

            long endTimeMillis = DateTimeHelper.CurrentUnixTimeMillis() + RUN_TIME_MS;

            while (endTimeMillis > DateTimeHelper.CurrentUnixTimeMillis())
            {
                ISet <MemberId> members = new HashSet <MemberId>();
                for (int i = 0; i < 3; i++)
                {
                    members.Add(new MemberId(System.Guid.randomUUID()));
                }

                DiscoveryServiceFactory sharedService = new SharedDiscoveryServiceFactory();

                IList <Callable <Void> > discoveryJobs = new List <Callable <Void> >();
                foreach (MemberId member in members)
                {
                    discoveryJobs.Add(CreateDiscoveryJob(member, sharedService, members));
                }

                IList <Future <Void> > results = es.invokeAll(discoveryJobs);
                foreach (Future <Void> result in results)
                {
                    result.get(TIMEOUT_MS, MILLISECONDS);
                }
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.causalclustering.discovery.Cluster<?> startIpv6Cluster() throws java.util.concurrent.ExecutionException, InterruptedException
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
        private Cluster <object> StartIpv6Cluster()
        {
            DiscoveryServiceFactory discoveryServiceFactory = new SharedDiscoveryServiceFactory();
            File parentDir = _testDirectory.directory("ipv6_cluster");
            IDictionary <string, string> coreParams = new Dictionary <string, string>();

            coreParams[GraphDatabaseSettings.record_format.name()] = RecordFormat;
            IDictionary <string, System.Func <int, string> > instanceCoreParams = new Dictionary <string, System.Func <int, string> >();

            IDictionary <string, string> readReplicaParams = new Dictionary <string, string>();

            readReplicaParams[GraphDatabaseSettings.record_format.name()] = RecordFormat;
            IDictionary <string, System.Func <int, string> > instanceReadReplicaParams = new Dictionary <string, System.Func <int, string> >();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.causalclustering.discovery.Cluster<?> cluster = new org.neo4j.causalclustering.discovery.EnterpriseCluster(parentDir, 3, 3, discoveryServiceFactory, coreParams, instanceCoreParams, readReplicaParams, instanceReadReplicaParams, recordFormat, org.neo4j.causalclustering.discovery.IpFamily.IPV6, false);
            Cluster <object> cluster = new EnterpriseCluster(parentDir, 3, 3, discoveryServiceFactory, coreParams, instanceCoreParams, readReplicaParams, instanceReadReplicaParams, RecordFormat, IpFamily.IPV6, false);

            cluster.Start();
            CreateSomeData(cluster);
            return(cluster);
        }