use of jakarta.ws.rs.RedirectionException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusUriThrowsExceptionTest.
/*
* @testName: constructorStatusUriThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:348;
*
* @test_Strategy: Construct a new redirection exception.
* java.lang.IllegalArgumentException - in case the status code is null or is
* not from Response.Status.Family.REDIRECTION status code family.
*/
@Test
public void constructorStatusUriThrowsExceptionTest() throws Fault {
for (Status status : getStatusesOutsideFamily()) {
try {
RedirectionException e = new RedirectionException(status, LOCATION);
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.RedirectionException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringIntNotValidStatusThrowsIAETest.
/*
* @testName: constructorStringIntNotValidStatusThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1096;
*
* @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.REDIRECTION status
* code family.
*/
@Test
public void constructorStringIntNotValidStatusThrowsIAETest() throws Fault {
for (int status : new int[] { -1, Integer.MAX_VALUE, Integer.MIN_VALUE }) {
try {
RedirectionException e = new RedirectionException(MESSAGE, status, LOCATION);
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.RedirectionException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusNullUriThrowsExceptionTest.
/*
* @testName: constructorStatusNullUriThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:348;
*
* @test_Strategy: Construct a new redirection exception.
* java.lang.IllegalArgumentException - in case the status code is null or is
* not from Response.Status.Family.REDIRECTION status code family.
*/
@Test
public void constructorStatusNullUriThrowsExceptionTest() throws Fault {
try {
RedirectionException e = new RedirectionException((Status) null, LOCATION);
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.RedirectionException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringStatusNullUriThrowsIAETest.
/*
* @testName: constructorStringStatusNullUriThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1095;
*
* @test_Strategy: Construct a new redirection exception.
* java.lang.IllegalArgumentException - in case the status code is null or is
* not from Response.Status.Family.REDIRECTION status code family.
*/
@Test
public void constructorStringStatusNullUriThrowsIAETest() throws Fault {
try {
RedirectionException e = new RedirectionException(MESSAGE, (Status) null, LOCATION);
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.RedirectionException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStatusUriTest.
/*
* @testName: constructorStatusUriTest
*
* @assertion_ids: JAXRS:JAVADOC:348; JAXRS:JAVADOC:347; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new redirection exception.
* java.lang.IllegalArgumentException - in case the status code is null or is
* not from Response.Status.Family.REDIRECTION status code family.
*
* Get the redirection response location.
*
* getResponse
*/
@Test
public void constructorStatusUriTest() throws Fault {
for (Status status : getStatusesFromFamily()) {
RedirectionException e = new RedirectionException(status, LOCATION);
assertResponse(e, status);
assertLocation(e, LOCATION);
}
}
Aggregations