rest icon indicating copy to clipboard operation
rest copied to clipboard

TCK context root improvements

Open jbescos opened this issue 2 years ago • 2 comments

Many tests are done to have the root context of a war file, but this it not valid in some frameworks like Helidon, where there is no such context root.

Any JAXRSClientIT contains the next 2 things:

setContextRoot("/jaxrs_spec_resource_valueofandfromstring_web");
...
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_valueofandfromstring_web.war");

We can see that explicitly sets the context root with the war name.

It would be really helpful for Helidon developers if TCKs takes the context root in this other way (as it is already done in rest/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/spec/client/exceptions/ClientExceptionsIT.java):

    @ArquillianResource
    private URL baseUrl;

In this way the web container will provide the context root and we get rid of this issue in Helidon.

jbescos avatar Nov 14 '23 14:11 jbescos

My assumption is this was because that's how the tests were and it was minimal effort to get them migrated to Arquillian based tests. However, using the URL, or URI, injection is the correct way to do it.

jamezp avatar Nov 14 '23 15:11 jamezp

@jbescos Feel free to create a PR for this

spericas avatar Nov 21 '23 15:11 spericas