Example #1
0
        public override Connection NewConnection(Connector connector, EndPoint endPoint)
        {
            JettyHttpConnection connection = CreateConnection(connector, endPoint);

            connection.addListener(_connectionListener);
            return(configure(connection, connector, endPoint));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHaveId()
        internal virtual void ShouldHaveId()
        {
            Connector           connector  = ConnectorMock("https");
            JettyHttpConnection connection = NewConnection(connector);

            assertEquals("http-1", connection.Id());
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldNotifyAboutClosedConnection()
        internal virtual void ShouldNotifyAboutClosedConnection()
        {
            JettyHttpConnection connection = mock(typeof(JettyHttpConnection));

            _listener.onClosed(connection);

            verify(_connectionTracker, never()).add(any());
            verify(_connectionTracker).remove(connection);
        }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHaveUsernameAndUserAgent()
        internal virtual void ShouldHaveUsernameAndUserAgent()
        {
            JettyHttpConnection connection = NewConnection(ConnectorMock("http+routing"));

            assertNull(connection.Username());
            connection.UpdateUser("hello", "my-http-driver/1.2.3");
            assertEquals("hello", connection.Username());
            assertEquals("my-http-driver/1.2.3", connection.UserAgent());
        }
Example #5
0
        public static void UpdateUserForCurrentConnection(string username, string userAgent)
        {
            JettyHttpConnection connection = CurrentJettyHttpConnection;

            if (connection != null)
            {
                connection.UpdateUser(username, userAgent);
            }
        }
Example #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHaveConnector()
        internal virtual void ShouldHaveConnector()
        {
            JettyHttpConnection connection = NewConnection(ConnectorMock("http+routing"));

            assertEquals("http+routing", connection.Connector());
        }
Example #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHaveConnectTime()
        internal virtual void ShouldHaveConnectTime()
        {
            JettyHttpConnection connection = NewConnection(ConnectorMock("http"));

            assertThat(connection.ConnectTime(), greaterThan(0L));
        }