use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithStringClassThrowsWebApplicationExceptionTest.
/*
* @testName: deleteWithStringClassThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:543;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.delete( Class ) 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 deleteWithStringClassThrowsWebApplicationExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerForMethod("deletenotok");
sync.delete(String.class);
}
};
assertWebApplicationException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithStringClassTest.
/*
* @testName: methodWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:561;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* synchronously.
*/
@Test
public void methodWithStringClassTest() throws Fault {
String response = null;
for (String method : METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase());
response = sync.method(method, String.class);
assertResponseString(response, method.toLowerCase());
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithResponseClassTest.
/*
* @testName: traceWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:601;
*
* @test_Strategy: Invoke HTTP trace method for the current request
* synchronously.
*/
@Test
public void traceWithResponseClassTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("trace");
Response response = sync.trace(Response.class);
assertResponseOk(response);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeStringThrowsProcessingExceptionTest.
/*
* @testName: methodWithGenericTypeStringThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:564;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.method(String) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void methodWithGenericTypeStringThrowsProcessingExceptionTest() throws Fault {
final GenericType<String> generic = createGeneric(String.class);
for (final String method : METHODS) {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.method(method, generic);
}
};
assertProcessingException(run);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithResponseClassTest.
/*
* @testName: postWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:585;
*
* @test_Strategy: Invoke HTTP post method for the current request
* synchronously.
*/
@Test
public void postWithResponseClassTest() throws Fault {
Entity<String> entity = createEntity("post");
SyncInvoker sync = createSyncInvokerForMethod("post");
Response response = sync.post(entity, Response.class);
assertResponseOk(response);
}
Aggregations