Codota Logo
JAXRSClientFactory.create
Code IndexAdd Codota to your IDE (free)

How to use
create
method
in
org.apache.cxf.jaxrs.client.JAXRSClientFactory

Best Java code snippets using org.apache.cxf.jaxrs.client.JAXRSClientFactory.create (Showing top 20 results out of 315)

Refine searchRefine arrow

  • Test.<init>
origin: apache/cxf

@Test
public void testThreadSafeProxyWithCopy() throws Exception {
  BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class,
                        Collections.emptyList(), true);
  runProxies(proxy, 10, false, true);
}
origin: apache/cxf

@Test
public void testDeleteWithProxy() throws Exception {
  BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  Response r = bs.deleteBook("123");
  assertEquals(200, r.getStatus());
}
origin: apache/cxf

@Test
public void testProxyServerInFaultEscaped() throws Exception {
  BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
  Response r = localProxy.infault2();
  assertEquals(500, r.getStatus());
}
origin: apache/cxf

@Test
public void testProxyServerInFaultMapped() throws Exception {
  BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
  Response r = localProxy.infault();
  assertEquals(401, r.getStatus());
}
origin: apache/cxf

@Test
public void testEmptyResponseProxyNullable() {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  assertNull(store.getEmptyBookNullable());
}
origin: apache/cxf

@Test
public void testBookExistsProxyPrimitiveBoolean() throws Exception {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  assertTrue(store.checkBook(123L));
}
origin: apache/cxf

@Test
public void testProxyWithCollectionMatrixParams() throws Exception {
  BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  List<String> params = new ArrayList<>();
  params.add("12");
  params.add("3");
  Book book = proxy.getBookByMatrixListParams(params);
  assertEquals(123L, book.getId());
}
origin: apache/cxf

@Test
public void testProxyWrongAddress() throws Exception {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT2 + "/wrongaddress",
                        BookStore.class);
  try {
    store.getBook("123");
    fail("ClientException expected");
  } catch (ProcessingException ex) {
    // expected
  }
}
origin: apache/cxf

@Test
public void testCheckBookClientErrorResponse() {
  String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
  BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
                   BookStoreJaxrsJaxws.class,
                   Collections.singletonList(new DummyResponseExceptionMapper()));
  Response response = proxy.checkBook(100L);
  assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
}
origin: apache/cxf

@Test
public void testPostNullGetEmptyCollectionProxy() throws Exception {
  String endpointAddress = "http://localhost:" + PORT;
  BookStore bs = JAXRSClientFactory.create(endpointAddress, BookStore.class);
  List<Book> books = bs.postBookGetCollection(null);
  assertNotNull(books);
  assertEquals(0, books.size());
}
origin: apache/cxf

@Test
public void testGetBookFromResponseWithProxy() throws Exception {
  BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT,
                       BookStore.class);
  Response r = bs.getGenericResponseBook("123");
  assertEquals(200, r.getStatus());
  Book book = r.readEntity(Book.class);
  assertEquals(123L, book.getId());
}
origin: apache/cxf

@Test
public void testGetSuperBookCollectionProxy() throws Exception {
  String endpointAddress =
    "http://localhost:" + PORT + "/webapp/store2";
  BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
    Collections.singletonList(new JacksonJsonProvider()));
  List<SuperBook> books = proxy.getSuperBookCollectionJson();
  assertEquals(999L, books.get(0).getId());
}
origin: apache/cxf

@Test
public void testGetBookAdapterInterfaceProxy() throws Exception {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  BookInfoInterface info = store.getBookAdapterInterface();
  assertEquals(123L, info.getId());
}
origin: apache/cxf

@Test
public void testGetBookSimpleProxy() throws Exception {
  String address = "http://localhost:" + PORT + "/webapp/rest";
  BookStoreSimple bookStore = JAXRSClientFactory.create(address, BookStoreSimple.class);
  Book book = bookStore.getBook(444L);
  assertEquals(444L, book.getId());
}
origin: apache/cxf

@Test
public void testGetSuperBookProxy() throws Exception {
  String endpointAddress =
    "http://localhost:" + PORT + "/webapp/store2";
  BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
    Collections.singletonList(new JacksonJsonProvider()));
  SuperBook book = proxy.getSuperBookJson();
  assertEquals(999L, book.getId());
}
origin: apache/cxf

@Test
public void testOnewayProxy() throws Exception {
  BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  proxy.onewayRequest();
  assertEquals(202, WebClient.client(proxy).getResponse().getStatus());
}
origin: apache/cxf

@Test
public void testEchoBookElementWildcard() throws Exception {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  JAXBElement<? super Book> element = store.echoBookElementWildcard(
                  new JAXBElement<Book>(new QName("", "Book"),
                  Book.class,
                  new Book("CXF", 123L)));
  Book book = (Book)element.getValue();
  assertEquals(123L, book.getId());
  assertEquals("CXF", book.getName());
}
origin: apache/cxf

@Test
public void testEchoGenericSuperBookCollectionProxy() throws Exception {
  String endpointAddress =
    "http://localhost:" + PORT + "/webapp/custombus/genericstore";
  GenericBookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress,
    GenericBookStoreSpring.class, Collections.singletonList(new JacksonJsonProvider()));
  List<SuperBook> books =
    proxy.echoSuperBookCollectionJson(Collections.singletonList(new SuperBook("Super", 124L, true)));
  assertEquals(124L, books.get(0).getId());
  assertTrue(books.get(0).isSuperBook());
}
origin: apache/cxf

@Test
public void testEchoBookElement() throws Exception {
  BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
  JAXBElement<Book> element = store.echoBookElement(new JAXBElement<Book>(new QName("", "Book"),
                 Book.class,
                 new Book("CXF", 123L)));
  Book book = element.getValue();
  assertEquals(123L, book.getId());
  assertEquals("CXF", book.getName());
}
origin: apache/cxf

@Test
public void testProxyServerInFaultDirectDispatch() throws Exception {
  BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
  WebClient.getConfig(localProxy).getRequestContext().put(LocalConduit.DIRECT_DISPATCH, "true");
  WebClient.getConfig(localProxy).getInFaultInterceptors().add(new TestFaultInInterceptor());
  Response r = localProxy.infault2();
  assertEquals(500, r.getStatus());
}
org.apache.cxf.jaxrs.clientJAXRSClientFactorycreate

Javadoc

Creates a proxy

Popular methods of JAXRSClientFactory

  • fromClient
    Creates a proxy, baseURI will be set to Client currentURI
  • createFromModel
    Creates a proxy using user resource model
  • createProxy
  • getBean

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now