On 04/19/2017 06:32 AM, Katerina Novotna wrote:

----- Original Message -----
This question arises from RESTEASY-1617 "Add support for injection in
constraint validators on Java SE". We already use a CDI aware
ValidatorFactory in the context of Wildfly / EAP, but not in Java SE.

My question is: where do I test this new facility? I've got a test that
makes an invocation to an embedded instance of Undertow. We have
Could you please point me to your branch with the test?

The branch is at https://github.com/ronsigal/Resteasy/tree/1617. The test, temporarily, is at https://github.com/ronsigal/Resteasy/blob/1617/testsuite/integration-tests/src/test/java/org/jboss/resteasy/experiment/undertow/Test1617.java.

I have a lot of tests (in my local branches) in integration-tests/src/test/java/org/jboss/resteasy/experiment/undertow, by the way. I usually start with an embedded undertow server while I'm still investigating or testing.


resteasy-integration-tests for running tests on Wildfly, which isn't
appropriate in this case. We also have resteasy-unit-tests, but my
understanding is that it's not for tests that make network invocations.

We could create a new test module for running tests with embedded
servers. Or I could just put it in resteasy-integration-tests and forget
about it.

It's not a big deal, but I'm open to suggestions.
My opinion is, that it could be placed into resteasy-integration-tests into new package to separate the tests from other integration tests.

So, maybe, .../testsuite/integration-tests/src/test/java/org/jboss/resteasy/undertow ?

If in the future there should be more tests for different server adapters, then new module would be better.

Well, that's an interesting issue. I see that resteasy-undertow, resteasy-netty, and resteasy-netty4, for example, have a src/test/java directory. I haven't looked too closely, but I suppose those tests are specifically for issues related to the particular server adaptors. In the case of my test for RESTEASY-1617, on the other hand, I just want to run with some server outside of Wildfly; that is, I want to run the test with Java SE.

So, I think the question is, how often does Resteasy behavior potentially differ when running with Java SE compared to running with JEE? I don't have a good answer, off the top of my head. I guess at least one relevant situation would be when there are different dependencies for Java SE and JEE. Note that in this case, I added

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator-cdi</artifactId>
    <version>5.4.1.Final</version>
</dependency>

<dependency>
    <groupId>org.jboss.weld.se</groupId>
    <artifactId>weld-se</artifactId>
    <version>2.4.3.Final</version>
</dependency>

to pom.xml in resteasy-integration-tests. Note that org.jboss.weld.se doesn't exist in Wildfly. So, how common is that?



-- Katka

-- 
My company's smarter than your company (unless you work for Red Hat)