Package org.apache.cxf.jaxrs

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl


   
    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);
        EndpointInfo epr = new EndpointInfo();
View Full Code Here


                              final JAXRSServerFactoryBean factory, final String base) {
        final List<Logs.LogResourceEndpointInfo> resourcesToLog = new ArrayList<>();
        int classSize = 0;
        int addressSize = 0;

        final JAXRSServiceImpl service = (JAXRSServiceImpl) factory.getServiceFactory().getService();
        final List<ClassResourceInfo> resources = service.getClassResourceInfos();
        for (final ClassResourceInfo info : resources) {
            if (info.getResourceClass() == null) { // possible?
                continue;
            }
View Full Code Here

        return headers;
    }
   
    public WebClient createWebClient() {
       
        Service service = new JAXRSServiceImpl(getAddress());
        getServiceFactory().setService(service);
       
        try {
            Endpoint ep = createEndpoint();
            WebClient client = new WebClient(getAddress());
View Full Code Here

     * Creates a WebClient instance
     * @return WebClient instance
     */
    public WebClient createWebClient() {
       
        Service service = new JAXRSServiceImpl(getAddress(), getServiceName());
        getServiceFactory().setService(service);
       
        try {
            Endpoint ep = createEndpoint();
            ClientState actualState = getActualState();
View Full Code Here

        properties.loadFromXML(getClass().getResourceAsStream("jsonCases.xml"));
    }
   
    @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);
        DataBindingProvider<Book> p = new DataBindingProvider<Book>(binding);
        Book b = new Book("CXF", 127L);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here

        doTestAegisRead(data);
    }
   
    @SuppressWarnings("unchecked")
    public void doTestAegisRead(String data) throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        s.put("readXsiType", true);
        AegisDatabinding binding = new AegisDatabinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Book book = (Book)p.readFrom((Class)Book.class, Book.class,
View Full Code Here

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

    }
   
    @Test
    public void testJAXBRead() throws Exception {
        String data = "<Book><id>127</id><name>CXF</name><state></state></Book>";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingProvider<Book> p = new DataBindingProvider<Book>(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Book book = p.readFrom(Book.class, Book.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);
        DataBindingProvider p = new DataBindingProvider(binding);
        Structure struct = new StructureImpl();
        struct.getTexts().add("text1");
View Full Code Here

        String data = "<p0:Structure xmlns:p0=\"http://apache.org/structure/types\" "
            + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
            + "xsi:type=\"p0:Structure\">"
            + "<p0:text>sdo</p0:text><p0:int>3</p0:int><p0:dbl>123.5</p0:dbl><p0:texts>text1</p0:texts>"
            + "</p0:Structure>";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
        DataBinding binding = new SDODataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Structure struct = (Structure)p.readFrom((Class)Structure.class, Structure.class,
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.