use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusNullThrowableThrowsExceptionTest.
/*
* @testName: constructorStatusNullThrowableThrowsExceptionTest
*
* @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 constructorStatusNullThrowableThrowsExceptionTest() throws Fault {
try {
ClientErrorException e = new ClientErrorException((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 constructorIntThrowableThrowsExceptionTest.
/*
* @testName: constructorIntThrowableThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:314;
*
* @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 constructorIntThrowableThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(status.getStatusCode(), 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 constructorStringIntThrowableThrowsIAETest.
/*
* @testName: constructorStringIntThrowableThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1064;
*
* @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 constructorStringIntThrowableThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(MESSAGE, status.getStatusCode(), 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 constructorStringResponseThrowableThrowsIAETest.
/*
* @testName: constructorStringResponseThrowableThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1065;
*
* @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 constructorStringResponseThrowableThrowsIAETest() 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, 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 constructorStringIntThrowsIAETest.
/*
* @testName: constructorStringIntThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1061;
*
* @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 constructorStringIntThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (Status.Family.familyOf(status.getStatusCode()) != Status.Family.CLIENT_ERROR)
try {
ClientErrorException e = new ClientErrorException(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);
}
}
Aggregations