Skip to content

Latest commit

 

History

History
145 lines (119 loc) · 6.59 KB

README.adoc

File metadata and controls

145 lines (119 loc) · 6.59 KB

jaxrs-client: JAX-RS Client API example

The jaxrs-client quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}.

What is it?

The jaxrs-client quickstart demonstrates the JAX-RS Client API which interacts with a JAX-RS Web service.

This client "calls" many POST, GET, and DELETE operations using different ways: synchronized, asynchronous, delayed and filtered invocations.

Investigate the Console Output

When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results.

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
INFO: ### Testing Request and Response Filters ###
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
INFO: dropping all contacts
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
INFO: Invoking create new contact using a ClientRequestFilter
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
INFO: Invoking list all contacts using a ClientResponseFilter
org.jboss.as.quickstarts.jaxrsclient.test.LogResponseFilter filter
INFO: Date: Mon Dec 29 15:34:45 BRST 2014- Status: 200
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: ### Testing Delayed invocaton ###
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: dropping all contacts
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: Creating a new contact invocation
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: Creating list all contacts invocation
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: invoking the new contact
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
INFO: invoking list all contacts ASYNC
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
INFO: ### CRUD tests  ASYNC ###
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
INFO: dropping all contacts ASYNC
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
INFO: creating a new contact ASYNC
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
INFO: delete a contact by id ASYNC
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
INFO: fetching all contacts ASYNC
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
INFO: ### Testing invocation callback ###
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
INFO: dropping all contacts
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
INFO: Creating a InvocationCallback
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
INFO: Invoking a service using the InvocationCallback
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: ### CRUD tests ###
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: dropping all contacts
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: creating a new contact
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: fetching a contact by id
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: fetching all contacts
org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
INFO: delete a contact by id
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.51 sec - in org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

To run the tests in Red Hat JBoss Developer Studio:

  1. You must first set the active Maven profile in project properties to be either arq-managed for running on managed server or arq-remote for running on remote server.

  2. Then, to run the tests, right click on the project or individual classes and select Run As –> JUnit Test in the context menu.