Examples of JAXBCollectionXmlProvider


Examples of org.apache.wink.common.internal.providers.entity.xml.JAXBCollectionXmlProvider

        }

    }

    public void testJAXBCollectionXMLProviderIsReadableCollection() throws Exception {
        JAXBCollectionXmlProvider provider = new JAXBCollectionXmlProvider();

        GenericEntity<List<AtomFeed>> type1 =
            new GenericEntity<List<AtomFeed>>(new ArrayList<AtomFeed>()) {
            };
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("text", "xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "atom+xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<JAXBElement<AtomFeed>>> type2 =
            new GenericEntity<List<JAXBElement<AtomFeed>>>(new ArrayList<JAXBElement<AtomFeed>>()) {
            };
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("text", "xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "atom+xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<String>> type3 =
            new GenericEntity<List<String>>(new ArrayList<String>()) {
            };
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));
    }
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.xml.JAXBCollectionXmlProvider

                                        null,
                                        new MediaType("application", "atomsvc+xml")));
    }

    public void testJAXBCollectionXMLProviderIsWritableCollection() throws Exception {
        JAXBCollectionXmlProvider provider = new JAXBCollectionXmlProvider();

        GenericEntity<List<AtomFeed>> type1 =
            new GenericEntity<List<AtomFeed>>(new ArrayList<AtomFeed>()) {
            };
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<JAXBElement<AtomFeed>>> type2 =
            new GenericEntity<List<JAXBElement<AtomFeed>>>(new ArrayList<JAXBElement<AtomFeed>>()) {
            };
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<String>> type3 =
            new GenericEntity<List<String>>(new ArrayList<String>()) {
            };
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("text", "xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "atom+xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "atomsvc+xml")));
    }
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.xml.JAXBCollectionXmlProvider

                                        null,
                                        new MediaType("application", "atomsvc+xml")));
    }

    public void testJAXBCollectionXMLProviderIsWritableCollection() throws Exception {
        JAXBCollectionXmlProvider provider = new JAXBCollectionXmlProvider();

        GenericEntity<List<AtomFeed>> type1 =
            new GenericEntity<List<AtomFeed>>(new ArrayList<AtomFeed>()) {
            };
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertTrue(provider.isWriteable(type1.getRawType(),
                                        type1.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<JAXBElement<AtomFeed>>> type2 =
            new GenericEntity<List<JAXBElement<AtomFeed>>>(new ArrayList<JAXBElement<AtomFeed>>()) {
            };
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertTrue(provider.isWriteable(type2.getRawType(),
                                        type2.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<String>> type3 =
            new GenericEntity<List<String>>(new ArrayList<String>()) {
            };
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("text", "xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "atom+xml")));
        assertFalse(provider.isWriteable(type3.getRawType(),
                                         type3.getType(),
                                         null,
                                         new MediaType("application", "atomsvc+xml")));
    }
View Full Code Here

Examples of org.apache.wink.common.internal.providers.entity.xml.JAXBCollectionXmlProvider

        }

    }

    public void testJAXBCollectionXMLProviderIsReadableCollection() throws Exception {
        JAXBCollectionXmlProvider provider = new JAXBCollectionXmlProvider();

        GenericEntity<List<AtomFeed>> type1 =
            new GenericEntity<List<AtomFeed>>(new ArrayList<AtomFeed>()) {
            };
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("text", "xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "atom+xml")));
        assertTrue(provider.isReadable(type1.getRawType(),
                                       type1.getType(),
                                       null,
                                       new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<JAXBElement<AtomFeed>>> type2 =
            new GenericEntity<List<JAXBElement<AtomFeed>>>(new ArrayList<JAXBElement<AtomFeed>>()) {
            };
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("text", "xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "atom+xml")));
        assertTrue(provider.isReadable(type2.getRawType(),
                                       type2.getType(),
                                       null,
                                       new MediaType("application", "atomsvc+xml")));

        GenericEntity<List<String>> type3 =
            new GenericEntity<List<String>>(new ArrayList<String>()) {
            };
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("text", "xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "atom+xml")));
        assertFalse(provider.isReadable(type3.getRawType(),
                                        type3.getType(),
                                        null,
                                        new MediaType("application", "atomsvc+xml")));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.