Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testSchemeInInternalJettyServletRequestForHttps() throws java.io.UnsupportedEncodingException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestSchemeInInternalJettyServletRequestForHttps()
        {
            // when
            InternalJettyServletRequest req = new InternalJettyServletRequest("POST", "https://localhost:7473/db/data/node", "{'name':'node1'}", new InternalJettyServletResponse(), mock(typeof(InternalJettyServletRequest.RequestData)));

            // then
            assertEquals("https", req.Scheme);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldForwardMetadataFromRequestData() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldForwardMetadataFromRequestData()
        {
            // Given
            InternalJettyServletRequest.RequestData mock = new InternalJettyServletRequest.RequestData("127.0.0.1", true, 1, "TheLocalName", "129.0.0.1", 2, "authorization/auth");

            InternalJettyServletRequest req = new InternalJettyServletRequest("POST", "https://localhost:7473/db/data/node", "", new InternalJettyServletResponse(), mock);

            // When & then
            assertEquals("127.0.0.1", req.RemoteAddr);
            assertException(req.getRemoteHost, typeof(System.NotSupportedException), "Remote host-name lookup might prove expensive, this should be explicitly considered.");
            assertTrue(req.Secure);
            assertEquals(1, req.RemotePort);
            assertEquals("TheLocalName", req.LocalName);
            assertEquals("129.0.0.1", req.LocalAddr);
            assertEquals(2, req.LocalPort);
            assertEquals("authorization/auth", req.AuthType);
        }
Beispiel #3
0
 protected internal override void invoke(string method, string path, string body, int?id, URI targetUri, InternalJettyServletRequest req, InternalJettyServletResponse res)
 {
 }