use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithEntityTest.
/*
* @testName: methodWithEntityTest
*
* @assertion_ids: JAXRS:JAVADOC:567;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* synchronously.
*/
@Test
public void methodWithEntityTest() throws Fault {
Response response = null;
for (String method : ENTITY_METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase());
Entity<String> entity = createEntity(method.toLowerCase());
response = sync.method(method, entity);
assertResponseOk(response);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithResponseClassThrowsNoWebApplicationExceptionTest.
/*
* @testName: methodWithResponseClassThrowsNoWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:561;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.method(String) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void methodWithResponseClassThrowsNoWebApplicationExceptionTest() throws Fault {
for (final String method : METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase() + "notok");
Response response = sync.method(method, Response.class);
assertStatusAndLog(response, Status.NOT_ACCEPTABLE);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithGenericTypeResponseThrowsNoWebApplicationExceptionTest.
/*
* @testName: traceWithGenericTypeResponseThrowsNoWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:604;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.trace( 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 traceWithGenericTypeResponseThrowsNoWebApplicationExceptionTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("tracenotok");
GenericType<Response> generic = createGeneric(Response.class);
Response response = sync.trace(generic);
assertStatusAndLog(response, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeStringThrowsProcessingExceptionTest.
/*
* @testName: putWithGenericTypeStringThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:596;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.put( Entity, GenericType )
* throws ProcessingException in case the invocation failed.
*/
@Test
public void putWithGenericTypeStringThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
Entity<String> entity = createEntity("put");
GenericType<String> generic = createGeneric(String.class);
sync.put(entity, generic);
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithResponseClassThrowsNoWebApplicationExceptionTest.
/*
* @testName: getWithResponseClassThrowsNoWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:551;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.get( 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 getWithResponseClassThrowsNoWebApplicationExceptionTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("getnotok");
Response response = sync.get(Response.class);
assertStatusAndLog(response, Status.NOT_ACCEPTABLE);
}
Aggregations