use of jakarta.ws.rs.InternalServerErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseThrowableTest.
/*
* @testName: constructorStringResponseThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:1073; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new internal server error exception.
*
* getResponse
*/
@Test
public void constructorStringResponseThrowableTest() throws Fault {
Response response = buildResponse();
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
InternalServerErrorException e = new InternalServerErrorException(MESSAGE, response, t);
assertResponse(e, HOST);
assertCause(e, t);
assertMessage(e);
}
}
use of jakarta.ws.rs.InternalServerErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseThrowsIAETest.
/*
* @testName: constructorStringResponseThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1071;
*
* @test_Strategy: Construct a new internal server error exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 500.
*/
@Test
public void constructorStringResponseThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
InternalServerErrorException e = new InternalServerErrorException(MESSAGE, response);
fault("No exception has been thrown for status", status, "; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown as expected for status", status);
}
}
use of jakarta.ws.rs.InternalServerErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorThrowableTest.
/*
* @testName: constructorThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:321; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new internal server error exception. cause -
* the underlying cause of the exception.
*
* getResponse
*/
@Test
public void constructorThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
InternalServerErrorException e = new InternalServerErrorException(t);
assertResponse(e);
assertCause(e, t);
}
}
use of jakarta.ws.rs.InternalServerErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseTest.
/*
* @testName: constructorResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:320; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new internal server error exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 500.
*
* getResponse
*/
@Test
public void constructorResponseTest() throws Fault {
Response response = buildResponse();
InternalServerErrorException e = new InternalServerErrorException(response);
assertResponse(e, HOST);
}
use of jakarta.ws.rs.InternalServerErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowableThrowsExceptionTest.
/*
* @testName: constructorResponseThrowableThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:322;
*
* @test_Strategy: Construct a new internal server error exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 500.
*/
@Test
public void constructorResponseThrowableThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
InternalServerErrorException e = new InternalServerErrorException(response, new Throwable());
fault("No exception has been thrown for status", status, "exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown as expected for status", status);
}
}
Aggregations