Package org.apache.wink.common.internal.providers.entity

Examples of org.apache.wink.common.internal.providers.entity.StringProvider


            public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type,
                                                                 Type genericType,
                                                                 Annotation[] annotations,
                                                                 MediaType mediaType) {
                return (MessageBodyReader<T>)new StringProvider();
            }

            @SuppressWarnings("unchecked")
            public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type,
                                                                 Type genericType,
                                                                 Annotation[] annotations,
                                                                 MediaType mediaType) {
                return (MessageBodyWriter<T>)new StringProvider();
            }
        };

    }
View Full Code Here


    public void testMessageBodyWriters() {
        ProvidersRegistry providers = createProvidersRegistryImpl();

        ByteArrayProvider byteArrayProvider = new ByteArrayProvider();
        InputStreamProvider inputStreamProvider = new InputStreamProvider();
        StringProvider stringProvider = new StringProvider();
        String2Provider string2Provider = new String2Provider();
        FileProvider fileProvider = new FileProvider();
        IntegerMessageBodyProvider objectMessageBodyProvider = new IntegerMessageBodyProvider();

        providers.addProvider(byteArrayProvider, WinkApplication.SYSTEM_PRIORITY);
View Full Code Here

    public void testMessageBodyWritersMediaTypes() {
        ProvidersRegistry providers = createProvidersRegistryImpl();

        ByteArrayProvider byteArrayProvider = new ByteArrayProvider();
        InputStreamProvider inputStreamProvider = new InputStreamProvider();
        StringProvider stringProvider = new StringProvider();
        String2Provider string2Provider = new String2Provider();
        FileProvider fileProvider = new FileProvider();
        IntegerMessageBodyProvider objectMessageBodyProvider = new IntegerMessageBodyProvider();

        providers.addProvider(byteArrayProvider);
View Full Code Here

    private static void verifyResponseGZIPContentEncodedForRepeatedStrings(ClientResponse response)
        throws IOException {
        assertEquals(200, response.getStatusCode());
        InputStream is = response.getEntity(InputStream.class);
        GZIPInputStream gzipIS = new GZIPInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        gzipIS);
View Full Code Here

    private static void verifyResponseDeflateContentEncodedForRepeatedStrings(ClientResponse response)
        throws IOException {
        assertEquals(200, response.getStatusCode());
        InputStream is = response.getEntity(InputStream.class);
        InflaterInputStream inflaterIS = new InflaterInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        inflaterIS);
View Full Code Here

        assertEquals("gzip", response.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING));
        assertEquals(1, response.getHeaders().get(HttpHeaders.CONTENT_ENCODING).size());

        InputStream is = response.getEntity(InputStream.class);
        GZIPInputStream gzipIS = new GZIPInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        gzipIS);
View Full Code Here

        assertEquals("gzip", response.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING));
        assertEquals(1, response.getHeaders().get(HttpHeaders.CONTENT_ENCODING).size());

        InputStream is = response.getEntity(InputStream.class);
        GZIPInputStream gzipIS = new GZIPInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        gzipIS);
View Full Code Here

        assertEquals("gzip", response.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING));
        assertEquals(1, response.getHeaders().get(HttpHeaders.CONTENT_ENCODING).size());

        InputStream is = response.getEntity(InputStream.class);
        GZIPInputStream gzipIS = new GZIPInputStream(is);
        StringProvider sp = new StringProvider();
        String responseEntity =
            sp.readFrom(String.class,
                        String.class,
                        new Annotation[] {},
                        MediaType.TEXT_PLAIN_TYPE,
                        null,
                        gzipIS);
View Full Code Here

            public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type,
                                                                 Type genericType,
                                                                 Annotation[] annotations,
                                                                 MediaType mediaType) {
                return (MessageBodyReader<T>)new StringProvider();
            }

            @SuppressWarnings("unchecked")
            public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type,
                                                                 Type genericType,
                                                                 Annotation[] annotations,
                                                                 MediaType mediaType) {
                return (MessageBodyWriter<T>)new StringProvider();
            }
        };

    }
View Full Code Here

    public void testMessageBodyWriters() {
        ProvidersRegistry providers = createProvidersRegistryImpl();

        ByteArrayProvider byteArrayProvider = new ByteArrayProvider();
        InputStreamProvider inputStreamProvider = new InputStreamProvider();
        StringProvider stringProvider = new StringProvider();
        String2Provider string2Provider = new String2Provider();
        FileProvider fileProvider = new FileProvider();
        IntegerMessageBodyProvider objectMessageBodyProvider = new IntegerMessageBodyProvider();

        providers.addProvider(byteArrayProvider);
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.providers.entity.StringProvider

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.