use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithGenericTypeStringThrowsProcessingExceptionTest.
/*
* @testName: deleteWithGenericTypeStringThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:546;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.delete( Class ) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void deleteWithGenericTypeStringThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
GenericType<String> generic = createGeneric(String.class);
sync.delete(generic);
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithStringClassThrowsWebApplicationExceptionTest.
/*
* @testName: traceWithStringClassThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:601;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.trace( Entity, 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 traceWithStringClassThrowsWebApplicationExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerForMethod("tracenotok");
sync.trace(String.class);
}
};
assertWebApplicationException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithResponseClassThrowsNoWebApplicationExceptionTest.
/*
* @testName: postWithResponseClassThrowsNoWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:585;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.post( Entity, 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 postWithResponseClassThrowsNoWebApplicationExceptionTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("postnotok");
Entity<String> entity = createEntity("post");
Response response = sync.post(entity, 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 methodWithGenericTypeStringWithEntityThrowsProcessingExceptionTest.
/*
* @testName:
* methodWithGenericTypeStringWithEntityThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:572;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.method(String, Entity,
* GenericType) throws ProcessingException in case the invocation failed.
*/
@Test
public void methodWithGenericTypeStringWithEntityThrowsProcessingExceptionTest() throws Fault {
for (final String method : ENTITY_METHODS) {
Runnable run = new Runnable() {
@Override
public void run() {
GenericType<String> generic = createGeneric(String.class);
SyncInvoker sync = createSyncInvokerWrongUrl();
Entity<String> entity = createEntity(method);
sync.method(method, entity, generic);
}
};
assertProcessingException(run);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithStringClassTest.
/*
* @testName: putWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:593;
*
* @test_Strategy: Invoke HTTP put method for the current request
* synchronously.
*/
@Test
public void putWithStringClassTest() throws Fault {
Entity<String> entity = createEntity("put");
SyncInvoker sync = createSyncInvokerForMethod("put");
String response = sync.put(entity, String.class);
assertResponseString(response, "put");
}
Aggregations