use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowableTest.
/*
* @testName: constructorResponseThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:329; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "request not acceptable" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 406.
*
* getResponse
*/
@Test
public void constructorResponseThrowableTest() throws Fault {
Response response = buildResponse();
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
NotAcceptableException e = new NotAcceptableException(response, t);
assertResponse(e, HOST);
assertCause(e, t);
}
}
use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseTest.
/*
* @testName: constructorStringResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1075; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "request not acceptable" exception.
*
* getResponse
*/
@Test
public void constructorStringResponseTest() throws Fault {
Response response = buildResponse();
NotAcceptableException e = new NotAcceptableException(MESSAGE, response);
assertResponse(e, HOST);
assertMessage(e);
}
use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseThrowsIAETest.
/*
* @testName: constructorStringResponseThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1075;
*
* @test_Strategy: Construct a new "request not acceptable" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 406.
*/
@Test
public void constructorStringResponseThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
NotAcceptableException e = new NotAcceptableException(MESSAGE, response);
fault("IllegalArgumentException has not been thrown; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown for status", status, "as expected");
}
}
use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseTest.
/*
* @testName: constructorResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:327; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "request not acceptable" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 406.
*
* getResponse
*/
@Test
public void constructorResponseTest() throws Fault {
Response response = buildResponse();
NotAcceptableException e = new NotAcceptableException(response);
assertResponse(e, HOST);
}
use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowsExceptionTest.
/*
* @testName: constructorResponseThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:327;
*
* @test_Strategy: Construct a new "request not acceptable" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 406.
*/
@Test
public void constructorResponseThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
NotAcceptableException e = new NotAcceptableException(response);
fault("IllegalArgumentException has not been thrown; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown for status", status, "as expected");
}
}
Aggregations