예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLookupBoltPortInRegisterIfConfiguredTo0() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLookupBoltPortInRegisterIfConfiguredTo0()
        {
            BoltConnector         bolt     = new BoltConnector("honestJakesBoltConnector");
            ConnectorPortRegister register = new ConnectorPortRegister();

            register.Register(bolt.Key(), new InetSocketAddress(1337));

            DiscoverableURIs uris = communityDiscoverableURIs(Config.builder().withSetting(bolt.AdvertisedAddress, "apple.com:0").withSetting(bolt.Enabled, "true").withSetting(bolt.Type, BoltConnector.ConnectorType.BOLT.name()).build(), register);

            assertEquals("bolt://apple.com:1337", ToMap(uris)["bolt"]);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGrabPortFromRegisterIfSetTo0() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldGrabPortFromRegisterIfSetTo0()
        {
            // Given
            BoltConnector         bolt   = new BoltConnector("honestJakesBoltConnector");
            Config                config = Config.builder().withSetting(EnterpriseEditionSettings.mode, EnterpriseEditionSettings.Mode.CORE.name()).withSetting(bolt.Enabled, "true").withSetting(bolt.Type, BoltConnector.ConnectorType.BOLT.name()).withSetting(bolt.ListenAddress, ":0").build();
            ConnectorPortRegister ports  = new ConnectorPortRegister();

            ports.Register(bolt.Key(), new InetSocketAddress(1337));

            // When
            IDictionary <string, object> asd = ToMap(EnterpriseDiscoverableURIs.EnterpriseDiscoverableURIsConflict(config, ports));

            // Then
            assertThat(asd["bolt_routing"], equalTo("bolt+routing://localhost:1337"));
        }