Examples of JAXRSClientFactoryBean


Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

   
    @Test
    public void testClientFaultOutInterceptor() throws Exception {
        //testing faults created by client out interceptor chain handled correctly
        String baseAddress = "http://localhost:9092/test/services/rest";
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress(baseAddress);
        bean.setResourceClass(BookStoreJaxrsJaxws.class);
        final boolean addBadOutInterceptor = true;
        TestFeature testFeature = new TestFeature(addBadOutInterceptor);
        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
        features.add((AbstractFeature)testFeature);
        bean.setFeatures(features);
        BookStoreJaxrsJaxws proxy = (BookStoreJaxrsJaxws)bean.create();
        try {
            //321 is special case - causes error code of 525
            proxy.getBook(new Long("123"));
            fail("Method should have thrown an exception");
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

        }
    }
   
    private void serverFaultInInterceptorTest(String param) {
        String baseAddress = "http://localhost:9092/test/services/rest";
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress(baseAddress);
        bean.setResourceClass(BookStoreJaxrsJaxws.class);
        TestFeature testFeature = new TestFeature();
        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
        features.add((AbstractFeature)testFeature);
        bean.setFeatures(features);
        BookStoreJaxrsJaxws proxy = (BookStoreJaxrsJaxws)bean.create();
        try {
            //321 is special case - causes error code of 525
            proxy.getBook(new Long(param));
            fail("Method should have thrown an exception");
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

        jsonProvider.setDropRootElement(true);
        jsonProvider.setSupportUnwrapped(true);
        endpoint.setProvider(jsonProvider);
        JAXRSServerFactoryBean sfb = endpoint.createJAXRSServerFactoryBean();
        assertEquals("Get a wrong proider size", 1, sfb.getProviders().size());
        JAXRSClientFactoryBean cfb = endpoint.createJAXRSClientFactoryBean();
        assertEquals("Get a wrong proider size", 1, cfb.getProviders().size());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    }
   
    @Test
    public void testEmptyPostProxy() throws Exception {
        String address = "http://localhost:" + PORT;
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress(address);
        bean.setResourceClass(BookStore.class);
        BookStore store = bean.create(BookStore.class);
        store.emptypost();
        assertEquals(204, WebClient.client(store).getResponse().getStatus());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    }
   
    @Test
    public void testEmptyPostProxy2() throws Exception {
        String address = "http://localhost:" + PORT;
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress(address);
        bean.setResourceClass(BookStore.class);
        BookStore store = bean.create(BookStore.class);
        store.emptypostNoPath();
        assertEquals(204, WebClient.client(store).getResponse().getStatus());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
        return new JAXRSServerFactoryBean();
    }
   
    protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
        return new JAXRSClientFactoryBean();
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    public JAXRSClientFactoryBean createJAXRSClientFactoryBean() {
        return createJAXRSClientFactoryBean(getAddress());
    }
   
    public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address) {
        JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
        setupJAXRSClientFactoryBean(answer, address);
        return answer;
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

        public void stop() throws Exception {
            cache.clear();
        }

        public JAXRSClientFactoryBean get(String address) throws Exception {
            JAXRSClientFactoryBean retVal = null;
            synchronized (cache) {
                retVal = cache.get(address);
               
                if (retVal == null) {
                    retVal = ((CxfRsEndpoint)getEndpoint()).createJAXRSClientFactoryBean(address);
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
        return new JAXRSServerFactoryBean();
    }
   
    protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
        return new JAXRSClientFactoryBean();
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean

    public JAXRSClientFactoryBean createJAXRSClientFactoryBean() {
        return createJAXRSClientFactoryBean(getAddress());
    }
   
    public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address) {
        JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
        setupJAXRSClientFactoryBean(answer, address);
        return answer;
    }
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.