Package org.apache.wink.server.internal.handlers

Examples of org.apache.wink.server.internal.handlers.ServerMessageContext


        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_HTTP_METHOD_OVERRIDE, "PUT");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration("X-HTTP-Method-Override,X-Method-Override"));
        assertEquals("HTTP method", HttpMethod.PUT, context.getHttpMethod());
    }
View Full Code Here


        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_HTTP_METHOD_OVERRIDE, "PUT");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration(null));
        assertEquals("HTTP method", HttpMethod.POST, context.getHttpMethod());
    }
View Full Code Here

    public void testXMethodOverride() {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_METHOD_OVERRIDE, "DELETE");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration("X-HTTP-Method-Override,X-Method-Override"));
        assertEquals("HTTP method", HttpMethod.DELETE, context.getHttpMethod());
    }
View Full Code Here

    public void testDefaultXMethodOverride() {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_METHOD_OVERRIDE, "DELETE");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration(null));
        assertEquals("HTTP method", HttpMethod.POST, context.getHttpMethod());
    }
View Full Code Here

     * Tests that null values returned for header values are ignored. See
     * [WINK-188]
     */
    public void testRequestHeaderReturnsNull() {

        ServerMessageContext context = new ServerMessageContext(new HttpServletRequest() {

            public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException {

            }

View Full Code Here

        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_HTTP_METHOD_OVERRIDE, "PUT");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration("X-HTTP-Method-Override,X-Method-Override"));
        assertEquals("HTTP method", HttpMethod.PUT, context.getHttpMethod());
    }
View Full Code Here

        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_HTTP_METHOD_OVERRIDE, "PUT");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration(null));
        assertEquals("HTTP method", HttpMethod.POST, context.getHttpMethod());
    }
View Full Code Here

    public void testXMethodOverride() {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_METHOD_OVERRIDE, "DELETE");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration("X-HTTP-Method-Override,X-Method-Override"));
        assertEquals("HTTP method", HttpMethod.DELETE, context.getHttpMethod());
    }
View Full Code Here

    public void testDefaultXMethodOverride() {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setMethod("POST");
        request.addHeader(HttpHeadersEx.X_METHOD_OVERRIDE, "DELETE");
        MessageContext context =
            new ServerMessageContext(
                                     request,
                                     new MockHttpServletResponse(),
                                     getDeploymentConfiguration(null));
        assertEquals("HTTP method", HttpMethod.POST, context.getHttpMethod());
    }
View Full Code Here

                will(returnValue(null));
                oneOf(requestMock).getHeaders("Accept");
                will(returnValue(values.elements()));
            }
        });
        ServerMessageContext context =
            new ServerMessageContext(requestMock, responseMock, new DeploymentConfiguration());
        HttpHeadersImpl headers = new HttpHeadersImpl(context);
        List<MediaType> mediaTypes = headers.getAcceptableMediaTypes();
        assertEquals(1, mediaTypes.size());
        assertEquals(MediaType.TEXT_XML_TYPE, headers.getAcceptableMediaTypes().get(0));
        mockery.assertIsSatisfied();
View Full Code Here

TOP

Related Classes of org.apache.wink.server.internal.handlers.ServerMessageContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.