use of jakarta.ws.rs.core.Response.Status in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringIntThrowsIAETest.
/*
* @testName: constructorStringIntThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1099;
*
* @test_Strategy: Construct a new server error exception.
* java.lang.IllegalArgumentException - in case the status code is not a valid
* HTTP status code or is not from Response.Status.Family.SERVER_ERROR status
* code family.
*/
@Test
public void constructorStringIntThrowsIAETest() throws Fault {
for (Status status : getStatusesOutsideFamily()) {
try {
ServerErrorException e = new ServerErrorException(MESSAGE, status.getStatusCode());
fault("IllegalArgumentException has not 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.core.Response.Status in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusTest.
/*
* @testName: constructorStatusTest
*
* @assertion_ids: JAXRS:JAVADOC:351; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new server error exception.
* java.lang.IllegalArgumentException - in case the status code is null or is
* not from Response.Status.Family.SERVER_ERROR status code family.
*
* getResponse
*/
@Test
public void constructorStatusTest() throws Fault {
for (Status status : getStatusesFromFamily()) {
ServerErrorException e = new ServerErrorException(status);
assertResponse(e, status);
}
}
use of jakarta.ws.rs.core.Response.Status in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringThrowableIntTest.
/*
* @testName: constructorStringThrowableIntTest
*
* @assertion_ids: JAXRS:JAVADOC:1117; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new instance with a message and specified HTTP
* status code.
*
* getResponse
*/
@Test
public void constructorStringThrowableIntTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Status status : Status.values()) {
for (Throwable t : throwables) {
WebApplicationException e = new WebApplicationException(MESSAGE, t, status.getStatusCode());
assertResponse(e, status);
assertMessage(e);
assertCause(e, t);
}
}
}
use of jakarta.ws.rs.core.Response.Status in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseTest.
/*
* @testName: constructorStringResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1112; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new instance using the supplied response.
*
* getResponse
*/
@Test
public void constructorStringResponseTest() throws Fault {
for (Status status : Status.values()) {
Response response = buildResponse(status);
WebApplicationException e = new WebApplicationException(MESSAGE, response);
assertResponse(e, status, HOST);
assertMessage(e);
}
}
use of jakarta.ws.rs.core.Response.Status in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringIntTest.
/*
* @testName: constructorStringIntTest
*
* @assertion_ids: JAXRS:JAVADOC:1113; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new instance with a message and specified HTTP
* status code.
*
* getResponse
*/
@Test
public void constructorStringIntTest() throws Fault {
for (Status status : Status.values()) {
WebApplicationException e = new WebApplicationException(MESSAGE, status.getStatusCode());
assertResponse(e, status);
assertMessage(e);
}
}
Aggregations