use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithResponseClassTest.
/*
* @testName: methodWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:561;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* synchronously.
*/
@Test
public void methodWithResponseClassTest() throws Fault {
Response response = null;
for (String method : METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase());
response = sync.method(method, Response.class);
assertResponseOk(response);
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithStringClassTest.
/*
* @testName: traceWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:601;
*
* @test_Strategy: Invoke HTTP trace method for the current request
* synchronously.
*/
@Test
public void traceWithStringClassTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("trace");
String response = sync.trace(String.class);
assertResponseString(response, "trace");
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithGenericTypeResponseTest.
/*
* @testName: optionsWithGenericTypeResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:580;
*
* @test_Strategy: Invoke HTTP options method for the current request
* synchronously.
*/
@Test
public void optionsWithGenericTypeResponseTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("options");
GenericType<Response> generic = createGeneric(Response.class);
Response response = sync.options(generic);
assertResponseOk(response);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithStringClassThrowsProcessingExceptionTest.
/*
* @testName: putWithStringClassThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:593;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.put( Entity, Class ) throws
* ProcessingException in case the invocation failed.
*/
@Test
public void putWithStringClassThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
Entity<String> entity = createEntity("put");
sync.put(entity, String.class);
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getThrowsProcessingExceptionTest.
/*
* @testName: getThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:549;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.get throws
* ProcessingException in case the invocation failed.
*/
@Test
public void getThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.get();
}
};
assertProcessingException(run);
}
Aggregations