use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringStatusThrowableThrowsIAETest.
/*
* @testName: constructorStringStatusThrowableThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1063;
*
* @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 constructorStringStatusThrowableThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(MESSAGE, 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 constructorStringStatusNullThrowableThrowsIAETest.
/*
* @testName: constructorStringStatusNullThrowableThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1063;
*
* @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 constructorStringStatusNullThrowableThrowsIAETest() throws Fault {
try {
ClientErrorException e = new ClientErrorException(MESSAGE, (Status) null, new Throwable());
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 constructorStringResponseThrowsIEATest.
/*
* @testName: constructorStringResponseThrowsIEATest
*
* @assertion_ids: JAXRS:JAVADOC:1062;
*
* @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 constructorStringResponseThrowsIEATest() 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(MESSAGE, 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);
}
}
use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringStatusThrowsIAETest.
/*
* @testName: constructorStringStatusThrowsIAETest
*
* @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 constructorStringStatusThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(MESSAGE, 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 constructorIntThrowsExceptionTest.
/*
* @testName: constructorIntThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:311;
*
* @test_Strategy: Construct a new client error exception.
* java.lang.IllegalArgumentException - in case the status code is not a valid
* HTTP status code or if it is not from the
* Response.Status.Family.CLIENT_ERROR status code family.
*/
@Test
public void constructorIntThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(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);
}
}
Aggregations