Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEncodeDecodeRaftMessage() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldEncodeDecodeRaftMessage()
        {
            ClusterId clusterId = new ClusterId(System.Guid.randomUUID());

            Org.Neo4j.causalclustering.core.consensus.RaftMessages_ReceivedInstantClusterIdAwareMessage <Org.Neo4j.causalclustering.core.consensus.RaftMessages_RaftMessage> idAwareMessage = Org.Neo4j.causalclustering.core.consensus.RaftMessages_ReceivedInstantClusterIdAwareMessage.of(Instant.now(), clusterId, RaftMessage);

            _outbound.writeOutbound(idAwareMessage);

            object o;

            while ((o = _outbound.readOutbound()) != null)
            {
                _inbound.writeInbound(o);
            }
            Org.Neo4j.causalclustering.core.consensus.RaftMessages_ReceivedInstantClusterIdAwareMessage <Org.Neo4j.causalclustering.core.consensus.RaftMessages_RaftMessage> message = _handler.RaftMessage;
            assertEquals(clusterId, message.clusterId());
            RaftMessageEquals(RaftMessage, message.message());
            assertNull(_inbound.readInbound());
            ReferenceCountUtil.release(_handler.msg);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotDuplicateToAnyLog()
        public virtual void ShouldNotDuplicateToAnyLog()
        {
            AssertableLogProvider userLogProvider  = new AssertableLogProvider();
            AssertableLogProvider debugLogProvider = new AssertableLogProvider();

            SimpleLogService logService = new SimpleLogService(userLogProvider, debugLogProvider);

            Monitors monitors = new Monitors();

            CoreMonitor.Register(logService.InternalLogProvider, logService.UserLogProvider, monitors);

            ClusterBinder.Monitor monitor = monitors.NewMonitor(typeof(ClusterBinder.Monitor));

            ClusterId clusterId = new ClusterId(System.Guid.randomUUID());

            monitor.BoundToCluster(clusterId);

            userLogProvider.RawMessageMatcher().assertContainsSingle(Matchers.allOf(Matchers.containsString("Bound to cluster with id " + clusterId.Uuid())));

            debugLogProvider.RawMessageMatcher().assertContainsSingle(Matchers.allOf(Matchers.containsString("Bound to cluster with id " + clusterId.Uuid())));
        }
Пример #3
0
 public abstract bool SetClusterId(Org.Neo4j.causalclustering.identity.ClusterId clusterId, string dbName);