use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowableThrowsExceptionTest.
/*
* @testName: constructorResponseThrowableThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:315;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the response status code is
* not from the Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorResponseThrowableThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
Response response = Response.status(status).build();
ClientErrorException e = new ClientErrorException(response, new Throwable());
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.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringStatusNullThrowsIAETest.
/*
* @testName: constructorStringStatusNullThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1060;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the status code is null or if
* it is not from the Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorStringStatusNullThrowsIAETest() throws Fault {
try {
ClientErrorException e = new ClientErrorException(MESSAGE, (Status) null);
fault("IllegalArgumentException has not been thrown for null status; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown as expected for null status");
}
}
use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusThrowableThrowsExceptionTest.
/*
* @testName: constructorStatusThrowableThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:313;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the status code is null or if
* it is not from the Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorStatusThrowableThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(status, new Throwable());
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.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusThrowsExceptionTest.
/*
* @testName: constructorStatusThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:310;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the status code is null or if
* it is not from the Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorStatusThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(status);
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.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowsExceptionTest.
/*
* @testName: constructorResponseThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:312;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the response status code is
* not from the Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorResponseThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
Response response = Response.status(status).build();
ClientErrorException e = new ClientErrorException(response);
fault("IllegalArgumentException has not been thrown for status", status, "; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown as expected for status", status);
}
}
Aggregations