use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeStringThrowsWebApplicationExceptionTest.
/*
* @testName: putWithGenericTypeStringThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:596;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.put( 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 putWithGenericTypeStringThrowsWebApplicationExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerForMethod("putnotok");
Entity<String> entity = createEntity("put");
GenericType<String> generic = createGeneric(String.class);
sync.put(entity, generic);
}
};
assertWebApplicationException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithResponseClassTest.
/*
* @testName: deleteWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:543;
*
* @test_Strategy: Invoke HTTP DELETE method for the current request
* synchronously.
*/
@Test
public void deleteWithResponseClassTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("delete");
Response response = sync.delete(Response.class);
assertResponseOk(response);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithStringClassThrowsProcessingExceptionTest.
/*
* @testName: deleteWithStringClassThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:543;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.delete( Class ) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void deleteWithStringClassThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.delete(String.class);
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeStringWithEntityThrowsWebApplicationExceptionTest.
/*
* @testName:
* methodWithGenericTypeStringWithEntityThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:572;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.method(String, 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 methodWithGenericTypeStringWithEntityThrowsWebApplicationExceptionTest() throws Fault {
for (final String method : ENTITY_METHODS) {
Runnable run = new Runnable() {
@Override
public void run() {
GenericType<String> generic = createGeneric(String.class);
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase() + "notok");
Entity<String> entity = createEntity(method);
sync.method(method, entity, generic);
}
};
assertWebApplicationException(run);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithEntityThrowsProcessingExceptionTest.
/*
* @testName: methodWithEntityThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:567;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.method(String, Entity)
* throws ProcessingException in case the invocation failed.
*/
@Test
public void methodWithEntityThrowsProcessingExceptionTest() throws Fault {
final Entity<String> entity = createEntity("entity");
for (final String method : ENTITY_METHODS) {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.method(method, entity);
}
};
assertProcessingException(run);
}
}
Aggregations