Modularization of the test framework - wow that sounds interesting :).
Here's my opinion -
As Paul mentioned, we had seen many limitations with Maven - profile
activation based on multiple conditions, etc.
Also, the current implementation allows developers to provide their own
implementations for test container factories. Wouldn't the creation of
multiple profiles make it complicated to define custom test container
factories and use them? I'm assuming this has been thought about.
- Naresh
On Fri, Feb 12, 2010 at 9:47 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
> Hi Pavel,
>
> Perhaps for now with the samples we do not need to define multiple profiles
> and we can stick to explicitly using a single test framework module
> implementation dependency, as appropriate to the test implementation. (In
> any case not all framework implementations will work with all test setups.)
> Currently some use the low-level grizzly container, others use the grizzly
> servlet container etc.
>
> Jakub knows a lot more than I on the limitations of profiles in maven. IIRC
> he and Naresh has some similar issues. So i would tend to avoid complicating
> matters and keeping things simple.
>
> Paul.
>
>
> On Feb 12, 2010, at 3:12 PM, Pavel Bucek wrote:
>
> Hello,
>>
>> I was able to modularize jersey-test-framework (jersey-test-framework
>> depends only on jersey-client, jersey-server and javax.servlet), introduced
>> several new modules (one for each container).
>>
>> The problem I'm having now is correctly define dependencies in samples or
>> to be more precise - how to define dependency on default or specified test
>> container. I wanted to do this centrally - somehow in jersey-test-framework
>> pom or anywhere else BUT it doesn't seem possible. Maven has limited profile
>> inheritance and it looks like its not really stable (discovered various bug
>> reports).
>>
>> Currently I have to define everything in every samples pom file. Not
>> really convenient but probably the safest way.
>>
>> I'm playing with helloworld sample in
>> jersey-test-framework-modularization branch and current state is:
>>
>> when you execute *mvn clean install*, project will be tested using grizzly
>> web container. If you want to use different one, you need to run
>> *mvn clean install
>> -Djersey.test.containerFactory=com.sun.jersey.test.framework.spi.container.inmemory.InMemoryTestContainerFactory*
>> (or different factory). No further action needed, profile should be selected
>> according to this single property.
>>
>> dependencies:
>>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-server</artifactId>
>> <version>${project.version}</version>
>> </dependency> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework</artifactId>
>> <version>${project.version}</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>com.sun.grizzly</groupId>
>> <artifactId>grizzly-servlet-webserver</artifactId>
>> <version>1.9.8</version>
>> </dependency>
>> </dependencies>
>>
>> profiles (not complete yet):
>>
>> <profile>
>> <id>JDK 1.5</id>
>> <activation>
>> <jdk>1.5</jdk>
>> </activation>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework-grizzly</artifactId>
>> <version>${project.version}</version>
>> </dependency>
>> <dependency> <!-- enabling WADL support -->
>> <groupId>com.sun.xml.bind</groupId>
>> <artifactId>jaxb-impl</artifactId>
>> <version>2.1</version>
>> </dependency>
>> </dependencies>
>> </profile>
>>
>>
>> <profile>
>> <id>Grizzly Default</id>
>> <activation>
>> <property>
>> <name>!jersey.test.containerFactory</name>
>> </property>
>> </activation>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework-grizzly</artifactId>
>> <version>${project.version}</version>
>> </dependency>
>> <dependency> <!-- enabling WADL support -->
>> <groupId>com.sun.xml.bind</groupId>
>> <artifactId>jaxb-impl</artifactId>
>> <version>2.1</version>
>> </dependency>
>> </dependencies>
>> </profile>
>>
>> <profile>
>> <id>Grizzly</id>
>> <activation>
>> <property>
>> <name>jersey.test.containerFactory</name>
>>
>> <value>com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory</value>
>> </property>
>> </activation>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework-grizzly</artifactId>
>> <version>${project.version}</version>
>> </dependency>
>> </dependencies>
>> </profile>
>>
>> <profile>
>> <id>Grizzly Light</id>
>> <activation>
>> <property>
>> <name>jersey.test.containerFactory</name>
>>
>> <value>com.sun.jersey.test.framework.spi.container.grizzly.GrizzlyTestContainerFactory</value>
>> </property>
>> </activation>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework-grizzly</artifactId>
>> <version>${project.version}</version>
>> </dependency>
>> </dependencies>
>> </profile>
>>
>> <profile>
>> <id>InMemory</id>
>> <activation>
>> <property>
>> <name>jersey.test.containerFactory</name>
>>
>> <value>com.sun.jersey.test.framework.spi.container.inmemory.InMemoryTestContainerFactory</value>
>> </property>
>> </activation>
>> <dependencies>
>> <dependency>
>> <groupId>com.sun.jersey</groupId>
>> <artifactId>jersey-test-framework-inmemory</artifactId>
>> <version>${project.version}</version>
>> </dependency>
>> </dependencies>
>> </profile>
>>
>> ... (others)
>>
>>
>> I would like to have feedback from you so if you see some possible issue
>> or if you have any suggestions, please let me know.
>>
>> Thanks,
>> Pavel
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>