use of jakarta.ws.rs.core.NoContentException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorNullStringTest.
/*
* @testName: constructorNullStringTest
*
* @assertion_ids: JAXRS:JAVADOC:1127;
*
* @test_Strategy: Construct a new NoContentException instance. message - the
* detail message (which is saved for later retrieval by the
* Throwable.getMessage() method).
*/
@Test
public void constructorNullStringTest() throws Fault {
NoContentException e = new NoContentException((String) null);
assertNullMessage(e);
}
use of jakarta.ws.rs.core.NoContentException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorThrowableTest.
/*
* @testName: constructorThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:1129;
*
* @test_Strategy: Construct a new NoContentException instance.
*/
@Test
public void constructorThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
NoContentException e = new NoContentException(t);
assertCause(e, t);
}
}
use of jakarta.ws.rs.core.NoContentException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringTest.
/* Run test */
/*
* @testName: constructorStringTest
*
* @assertion_ids: JAXRS:JAVADOC:1127;
*
* @test_Strategy: Construct a new NoContentException instance. message - the
* detail message (which is saved for later retrieval by the
* Throwable.getMessage() method).
*/
@Test
public void constructorStringTest() throws Fault {
NoContentException e = new NoContentException(MESSAGE);
assertMessage(MESSAGE, e);
}
use of jakarta.ws.rs.core.NoContentException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method clientBigDecimalProviderTest.
/*
* @testName: clientBigDecimalProviderTest
*
* @assertion_ids: JAXRS:JAVADOC:863;
*
* @test_Strategy: Integer, text/plain media type
*
* the pre-packaged primitive type MessageBodyReader implementations MUST
* throw a NoContentException for zero-length message entities.
*
* readEntity throws Processing Exception
*/
@Test
@Tag("xml_binding")
public void clientBigDecimalProviderTest() throws Fault {
setProperty(Property.REQUEST, buildRequest(Request.GET, "entity"));
invoke();
Response response = getResponse();
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_TYPE);
try {
BigDecimal entity = getResponseBody(BigDecimal.class);
fault("No expcetion thrown and entity is", entity);
} catch (Exception e) {
ProcessingException p = assertCause(e, ProcessingException.class, "Processing exception has not been thrown", e);
NoContentException nce = assertCause(e, NoContentException.class, "NoContentException has not been thrown", p);
logMsg("Found expected NoContentException", nce);
}
}
use of jakarta.ws.rs.core.NoContentException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringThrowableTest.
/*
* @testName: constructorStringThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:1128;
*
* @test_Strategy: Construct a new NoContentException instance.
*/
@Test
public void constructorStringThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
NoContentException e = new NoContentException(MESSAGE, t);
assertMessage(MESSAGE, e);
assertCause(e, t);
e = new NoContentException(null, t);
assertNullMessage(e);
assertCause(e, t);
}
}
Aggregations