Package org.apache.cxf.systest.jaxrs

Examples of org.apache.cxf.systest.jaxrs.BookStore$StringListBodyReaderWriter


       
        JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
        sf.setResourceClasses(BookStore.class);
        //default lifecycle is per-request, change it to singleton
        sf.setResourceProvider(BookStore.class,
                               new SingletonResourceProvider(new BookStore()));
        sf.setAddress("https://localhost:" + PORT + "/");

        sf.create();       
    }
View Full Code Here


    public void testGetBook123ProxyWithURLConduitId() throws Exception {
        doTestGetBook123Proxy(CLIENT_CONFIG_FILE2);
    }
   
    private void doTestGetBook123Proxy(String configFile) throws Exception {
        BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
                configFile);
        // just to verify the interface call goes through CGLIB proxy too
        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
    }
View Full Code Here

            new ClassPathXmlApplicationContext(new String[] {CLIENT_CONFIG_FILE4});
        Object bean = ctx.getBean("bookService.proxyFactory");
        assertNotNull(bean);
        JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
       
        BookStore bs = cfb.create(BookStore.class);
        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
       
        WebClient wc = WebClient.fromClient(WebClient.client(bs));
        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
        wc.accept("application/xml");
View Full Code Here

            new ClassPathXmlApplicationContext(new String[] {cfgFile});
        Object bean = ctx.getBean("bookService.proxyFactory");
        assertNotNull(bean);
        JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
       
        BookStore bs = cfb.create(BookStore.class);
        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
    }
View Full Code Here

    }
   
    @Test
    public void testGetBook123ProxyToWebClient() throws Exception {
       
        BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
                                                 CLIENT_CONFIG_FILE1);
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        WebClient wc = WebClient.fromClient(WebClient.client(bs));
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b2 = wc.get(Book.class);
        assertEquals(123, b2.getId());
View Full Code Here

        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
    }
View Full Code Here

       
        JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
        sf.setResourceClasses(BookStore.class);
        //default lifecycle is per-request, change it to singleton
        sf.setResourceProvider(BookStore.class,
                               new SingletonResourceProvider(new BookStore()));
        KerberosAuthenticationFilter filter = new KerberosAuthenticationFilter();
        filter.setLoginContextName("KerberosServer");
        filter.setCallbackHandler(getCallbackHandler("HTTP/localhost", "http"));
        //filter.setLoginContextName("KerberosServerKeyTab");
        //filter.setServicePrincipalName("HTTP/ktab");
View Full Code Here

    public void testGetBookWithConfigInHttpConduit() throws Exception {
        doTestGetBook123Proxy(KERBEROS_CONFIG_FILE);
    }
   
    private void doTestGetBook123Proxy(String configFile) throws Exception {
        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
                configFile);
        WebClient.getConfig(bs).getOutInterceptors().add(new LoggingOutInterceptor());
        // just to verify the interface call goes through CGLIB proxy too
        assertEquals("http://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
        Book b = bs.getBook("123");
        assertEquals(b.getId(), 123);
        b = bs.getBook("123");
        assertEquals(b.getId(), 123);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.systest.jaxrs.BookStore$StringListBodyReaderWriter

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.