use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeStringTest.
/*
* @testName: methodWithGenericTypeStringTest
*
* @assertion_ids: JAXRS:JAVADOC:564;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* synchronously.
*/
@Test
public void methodWithGenericTypeStringTest() throws Fault {
GenericType<String> generic = createGeneric(String.class);
String response = null;
for (String method : METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase());
response = sync.method(method, generic);
assertResponseString(response, method.toLowerCase());
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithGenericTypeResponseThrowsNoWebApplicationExceptionTest.
/*
* @testName: postWithGenericTypeResponseThrowsNoWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:588;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.post( Entity, GenericType )
* throws WebApplicationException - in case the response status code of the
* response returned by the server is not successful and the specified
* response type is not Response.
*/
@Test
public void postWithGenericTypeResponseThrowsNoWebApplicationExceptionTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("postnotok");
Entity<String> entity = createEntity("post");
GenericType<Response> generic = createGeneric(Response.class);
Response response = sync.post(entity, generic);
assertStatusAndLog(response, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postThrowsProcessingExceptionTest.
/*
* @testName: postThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:583;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.post(Entity) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void postThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
Entity<String> entity = createEntity("post");
sync.post(entity);
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method headThrowsProcessingExceptionTest.
/*
* @testName: headThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:557;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.head throws
* ProcessingException in case the invocation failed.
*/
@Test
public void headThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.head();
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteTest.
/* Run test */
// --------------------------------------------------------------------
// ---------------------- DELETE --------------------------------------
// --------------------------------------------------------------------
/*
* @testName: deleteTest
*
* @assertion_ids: JAXRS:JAVADOC:541;
*
* @test_Strategy: Invoke HTTP DELETE method for the current request
* synchronously.
*/
@Test
public void deleteTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("delete");
Response response = sync.delete();
assertResponseOk(response);
}
Aggregations