Package org.apache.wink.server.handlers

Examples of org.apache.wink.server.handlers.MessageContext


    public void testXHttpMethodOverride() {

        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


    public void testDefaultXHttpMethodOverride() {

        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

    public void testXHttpMethodOverride() {

        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

    public void testDefaultXHttpMethodOverride() {

        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

     */
    @Test
    public void testRequestsLogStartupBehaviorWhenNoLoggerAtDebug() {
        Requests r = new Requests();
        r.init(null);
        MessageContext context = mockContext.mock(MessageContext.class);
        r.logStartRequest(context);
        mockContext.assertIsSatisfied();
    }
View Full Code Here

     */
    @Test
    public void testRequestsHandleRequestWithNoLoggerAtDebug() throws Throwable {
        Requests r = new Requests();
        r.init(null);
        final MessageContext context = mockContext.mock(MessageContext.class);
        final HandlersChain chain = mockContext.mock(HandlersChain.class);

        mockContext.checking(new Expectations() {
            {
                oneOf(chain).doChain(context);
View Full Code Here

TOP

Related Classes of org.apache.wink.server.handlers.MessageContext

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.