Examples of JAXRSServiceImpl


Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

   
    private Message mockMessage(String baseAddress, String pathInfo, String query,
                                List<ClassResourceInfo> cris) throws Exception {
        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();
        epr.setAddress(baseAddress);
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

        String serviceAddress = getAddress();
        int queryIndex = serviceAddress != null ? serviceAddress.lastIndexOf('?') : -1;
        if (queryIndex != -1) {
            serviceAddress = serviceAddress.substring(0, queryIndex);
        }
        Service service = new JAXRSServiceImpl(serviceAddress, getServiceName());
        getServiceFactory().setService(service);
       
        try {
            Endpoint ep = createEndpoint();
            this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep);
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

     * 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

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

     * 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

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

    @Test
    public void testWadlQuery() {
        Message m = mockMessage("http://localhost:8080/bar", "/bar", "_wadl", "GET");
        ClassResourceInfo cri =
            ResourceUtils.createClassResourceInfo(TestResource.class, TestResource.class, true, true);
        m.getExchange().put(Service.class, new JAXRSServiceImpl(Collections.singletonList(cri)));
        RequestPreprocessor sqh = new RequestPreprocessor();
        sqh.preprocess(m, new UriInfoImpl(m, null));
        Response r = m.getExchange().get(Response.class);
        assertNotNull(r);
        assertEquals(MediaType.APPLICATION_XML,
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

    public void setUp() {
        c = ResourceUtils.createClassResourceInfo(TheBooks.class, TheBooks.class, true, true);
    }
   
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

   
    @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

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

        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 p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

    }
   
    @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 p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
       
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServiceImpl

        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);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
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.