Package org.apache.cxf.jaxrs

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl


    }
   
    @SuppressWarnings("unchecked")
    @Test
    public void testXmlBeansWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
        DataBinding binding = new XmlBeansDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        Address address = Address.Factory.newInstance();
        address.setAddressLine1("Street 1");
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void testXmlBeansRead() throws Exception {
        String data = "<tns:Address xmlns:tns=\"http://cxf.apache.org/jaxrs/providers/xmlbeans/types\">"
            + "<addressLine1>Street 1</addressLine1></tns:Address>";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
        DataBinding binding = new XmlBeansDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Address address = (Address)p.readFrom((Class)Address.class, Address.class,
View Full Code Here

   
    private Message mockMessage(String baseAddress, String pathInfo, String query,
                                List<ClassResourceInfo> cris) {
        Message m = new MessageImpl();
        Exchange e = new ExchangeImpl();
        e.put(Service.class, new JAXRSServiceImpl(cris));
       
        m.setExchange(e);
        control.reset();
        ServletDestination d = control.createMock(ServletDestination.class);
       
View Full Code Here

   
    private Message mockMessage(String baseAddress, String pathInfo, String query,
                                List<ClassResourceInfo> cris) {
        Message m = new MessageImpl();
        Exchange e = new ExchangeImpl();
        e.put(Service.class, new JAXRSServiceImpl(cris));
        Endpoint endpoint = control.createMock(Endpoint.class);
        e.put(Endpoint.class, endpoint);
        m.setExchange(e);
        control.reset();
        ServletDestination d = control.createMock(ServletDestination.class);
View Full Code Here

    }
   
    @SuppressWarnings("unchecked")
    @Test
    public void testSDOWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
        DataBinding binding = new SDODataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        p.setNamespaceMap(Collections.singletonMap("http://apache.org/structure/types", "p0"));
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void testSDORead() throws Exception {
        String data = "{\"p0.Structure\":{\"@xsi.type\":\"p0:Structure\",\"p0.text\":\"sdo\",\"p0.int\":3"
            + ",\"p0.dbl\":123.5,\"p0.texts\":\"text1\"}}";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
        DataBinding binding = new SDODataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        p.setNamespaceMap(Collections.singletonMap("http://apache.org/structure/types", "p0"));
View Full Code Here

        assertEquals(3, struct.getInt());
    }
   
    @Test
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider<Book> p = new DataBindingJSONProvider<Book>();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
View Full Code Here

   
    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBRead() throws Exception {
        String data = "{\"Book\":{\"id\":127,\"name\":\"CXF\",\"state\":\"\"}}";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
View Full Code Here

        assertEquals(127L, book.getId());
    }
   
    @Test
    public void testAegisWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        s.put("writeXsiType", true);
        AegisDatabinding binding = new AegisDatabinding();
        binding.initialize(s);
        DataBindingJSONProvider<Book> p = new DataBindingJSONProvider<Book>();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
View Full Code Here

    }
   
    @Test
    @Ignore
    public void testAegisCollectionWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        s.put("writeXsiType", true);
        AegisDatabinding binding = new AegisDatabinding();
        binding.initialize(s);
        DataBindingJSONProvider<List<Book>> p = new DataBindingJSONProvider<List<Book>>();
        p.setDataBinding(binding);
       
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.JAXRSServiceImpl

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.