Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldInstallTransportSelectionHandler()
        internal virtual void ShouldInstallTransportSelectionHandler()
        {
            SocketTransport socketTransport = NewSocketTransport(NetworkConnectionTracker.NO_OP, NO_THROTTLE);

            EmbeddedChannel channel = new EmbeddedChannel(socketTransport.ChannelInitializer());

            TransportSelectionHandler handler = channel.pipeline().get(typeof(TransportSelectionHandler));

            assertNotNull(handler);
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldManageThrottlersInChannelInitializer()
        internal virtual void ShouldManageThrottlersInChannelInitializer()
        {
            TransportThrottleGroup throttleGroup   = mock(typeof(TransportThrottleGroup));
            SocketTransport        socketTransport = NewSocketTransport(NetworkConnectionTracker.NO_OP, throttleGroup);

            EmbeddedChannel channel = new EmbeddedChannel(socketTransport.ChannelInitializer());

            verify(throttleGroup).install(channel);
            verify(throttleGroup, never()).uninstall(channel);

            channel.close();

            verify(throttleGroup).uninstall(channel);
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldManageChannelsInChannelInitializer()
        internal virtual void ShouldManageChannelsInChannelInitializer()
        {
            NetworkConnectionTracker connectionTracker = mock(typeof(NetworkConnectionTracker));
            SocketTransport          socketTransport   = NewSocketTransport(connectionTracker, NO_THROTTLE);

            EmbeddedChannel channel = new EmbeddedChannel(socketTransport.ChannelInitializer());

            ArgumentCaptor <TrackedNetworkConnection> captor = ArgumentCaptor.forClass(typeof(TrackedNetworkConnection));

            verify(connectionTracker).add(captor.capture());
            verify(connectionTracker, never()).remove(any());

            channel.close();

            verify(connectionTracker).remove(captor.Value);
        }
Exemple #4
0
 public ChannelInitializerAnonymousInnerClass(SocketTransport outerInstance)
 {
     this.outerInstance = outerInstance;
 }