Search in sources :

Example 6 with NotAcceptableException

use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorStringResponseThrowableTest.

/*
   * @testName: constructorStringResponseThrowableTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:329; JAXRS:JAVADOC:12;
   * 
   * @test_Strategy: Construct a new "request not acceptable" exception.
   * 
   * getResponse
   */
@Test
public void constructorStringResponseThrowableTest() throws Fault {
    Response response = buildResponse();
    Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
    for (Throwable t : throwables) {
        NotAcceptableException e = new NotAcceptableException(MESSAGE, response, t);
        assertResponse(e, HOST);
        assertCause(e, t);
        assertMessage(e);
    }
}
Also used : Response(jakarta.ws.rs.core.Response) NotAcceptableException(jakarta.ws.rs.NotAcceptableException) IOException(java.io.IOException) Test(org.junit.jupiter.api.Test)

Example 7 with NotAcceptableException

use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorThrowableTest.

/*
   * @testName: constructorThrowableTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:328; JAXRS:JAVADOC:12;
   * 
   * @test_Strategy: Construct a new "request not acceptable" exception. cause -
   * the underlying cause of the exception.
   * 
   * getResponse
   */
@Test
public void constructorThrowableTest() throws Fault {
    Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
    for (Throwable t : throwables) {
        NotAcceptableException e = new NotAcceptableException(t);
        assertResponse(e);
        assertCause(e, t);
    }
}
Also used : NotAcceptableException(jakarta.ws.rs.NotAcceptableException) IOException(java.io.IOException) Test(org.junit.jupiter.api.Test)

Example 8 with NotAcceptableException

use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorStringThrowableTest.

/*
   * @testName: constructorStringThrowableTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1076; JAXRS:JAVADOC:12;
   * 
   * @test_Strategy: Construct a new "request not acceptable" exception. cause -
   * the underlying cause of the exception.
   * 
   * getResponse
   */
@Test
public void constructorStringThrowableTest() throws Fault {
    Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
    for (Throwable t : throwables) {
        NotAcceptableException e = new NotAcceptableException(MESSAGE, t);
        assertResponse(e);
        assertCause(e, t);
        assertMessage(e);
    }
}
Also used : NotAcceptableException(jakarta.ws.rs.NotAcceptableException) IOException(java.io.IOException) Test(org.junit.jupiter.api.Test)

Example 9 with NotAcceptableException

use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorTest.

/*
   * @testName: constructorTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:326; JAXRS:JAVADOC:12;
   * 
   * @test_Strategy: Construct a new "request not acceptable" exception.
   * 
   * getResponse
   */
@Test
public void constructorTest() throws Fault {
    NotAcceptableException e = new NotAcceptableException();
    assertResponse(e);
}
Also used : NotAcceptableException(jakarta.ws.rs.NotAcceptableException) Test(org.junit.jupiter.api.Test)

Example 10 with NotAcceptableException

use of jakarta.ws.rs.NotAcceptableException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorStringTest.

/*
   * @testName: constructorStringTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1074;
   * 
   * @test_Strategy: Construct a new "request not acceptable" exception.
   */
@Test
public void constructorStringTest() throws Fault {
    NotAcceptableException e = new NotAcceptableException(MESSAGE);
    assertResponse(e);
    assertMessage(e);
}
Also used : NotAcceptableException(jakarta.ws.rs.NotAcceptableException) Test(org.junit.jupiter.api.Test)

Aggregations

NotAcceptableException (jakarta.ws.rs.NotAcceptableException)10 Test (org.junit.jupiter.api.Test)10 Response (jakarta.ws.rs.core.Response)6 IOException (java.io.IOException)4 Status (jakarta.ws.rs.core.Response.Status)2