use of jakarta.ws.rs.core.UriBuilderException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method uriBuilderExceptionTest3.
/*
* @testName: uriBuilderExceptionTest3
*
* @assertion_ids: JAXRS:JAVADOC:234;
*
* @test_Strategy: Create an UriBuilderException instance using
* UriBuilderException(String msg, throwable ex). Verify that message msg is
* associated with the exception.
*/
@Test
public void uriBuilderExceptionTest3() throws Fault {
String msg = "JAX-RS Test Message: xyz";
String msg1 = "JAX-RS Test Message Again: xyz";
try {
throw new UriBuilderException(msg, new Exception(msg1));
} catch (UriBuilderException ube) {
if (ube.getMessage().contains(msg)) {
TestUtil.logTrace("Test Passed with correct message: " + ube.getMessage() + ".");
} else {
throw new Fault("Test Failed. Expecting message," + msg + ", got " + ube.getMessage() + ".");
}
}
}
use of jakarta.ws.rs.core.UriBuilderException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method buildRelativizedThrowsUriBuilderExceptionTest.
/*
* @testName: buildRelativizedThrowsUriBuilderExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1054; JAXRS:JAVADOC:1053;
*
* @test_Strategy: Throws: UriBuilderException - if a URI cannot be constructed
* based on the current state of the underlying URI builder.
* jakarta.ws.rs.ext.RuntimeDelegate.createLinkBuilder
*/
@Test
public void buildRelativizedThrowsUriBuilderExceptionTest() throws Fault {
Builder linkBuilder = RuntimeDelegate.getInstance().createLinkBuilder();
URI respect = null;
try {
respect = new URI(url());
} catch (URISyntaxException e) {
fault(e);
}
try {
Link link = linkBuilder.uri("http://@").buildRelativized(respect);
fault("UriBuilderException has not been thrown, link=", link.toString());
} catch (UriBuilderException iae) {
logMsg("UriBuilderException has been thrown as expected");
}
}
use of jakarta.ws.rs.core.UriBuilderException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method buildNoArgsThrowsUriBuilderExceptionTest.
/*
* @testName: buildNoArgsThrowsUriBuilderExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:804;
*
* @test_Strategy: throws UriBuilderException if a URI cannot be constructed
* based on the current state of the underlying URI builder.
*/
@Test
public void buildNoArgsThrowsUriBuilderExceptionTest() throws Fault {
Link.Builder builder = Link.fromUri("http://:@");
try {
Link link = builder.build();
assertTrue(false, "No exception has been thrown for link " + link);
} catch (UriBuilderException e) {
logMsg("#build() throw UriBuilderException as expected");
}
}
use of jakarta.ws.rs.core.UriBuilderException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method buildObjectsThrowsUriBuilderExceptionTest.
/*
* @testName: buildObjectsThrowsUriBuilderExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:804;
*
* @test_Strategy: throws UriBuilderException if a URI cannot be constructed
* based on the current state of the underlying URI builder.
*/
@Test
public void buildObjectsThrowsUriBuilderExceptionTest() throws Fault {
Link.Builder builder = Link.fromUri("http://:@");
try {
Link link = builder.build("aaa");
assertTrue(false, "No exception has been thrown for link " + link);
} catch (UriBuilderException e) {
logMsg("#build(someNonURIObjects) throw UriBuilderException as expected");
}
}
Aggregations