Package org.exquery.http

Examples of org.exquery.http.HttpRequest


        mediaTypeAnnotation.setLiterals(new Literal[] {
            new StringLiteral(APPLICATION_XML.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(TEXT_HTML.getMediaType());
       
        assertFalse(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here


            new StringLiteral(TEXT_HTML.getMediaType()),
            new StringLiteral(APPLICATION_JSON.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(APPLICATION_XML.getMediaType());
       
        assertTrue(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here

            new StringLiteral(TEXT_HTML.getMediaType()),
            new StringLiteral(APPLICATION_JSON.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(APPLICATION_OCTET_STREAM.getMediaType());
       
        assertFalse(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here

            new StringLiteral(TEXT_HTML.getMediaType()),
            new StringLiteral(APPLICATION_JSON.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(TEXT_HTML.getMediaType());
       
        assertTrue(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here

        mediaTypeAnnotation.setLiterals(new Literal[] {
            new StringLiteral(APPLICATION_XML.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(ANY.getMediaType());
       
        assertTrue(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here

        mediaTypeAnnotation.setLiterals(new Literal[] {
            new StringLiteral(APPLICATION_XML.getMediaType())
        });
        mediaTypeAnnotation.initialise();
       
        final HttpRequest httpRequest = mock(HttpRequest.class);
        when(httpRequest.getHeader(HttpHeaderName.Accept.toString())).thenReturn(APPLICATION_ANY.getMediaType());
       
        assertTrue(mediaTypeAnnotation.matchesMediaType(httpRequest));
    }
View Full Code Here

TOP

Related Classes of org.exquery.http.HttpRequest

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.