On Tuesday, July 23, 2019 10:08:39 PM CEST Jörg Hoh wrote:
> Hi Oli,
> 
> 
> Am Di., 23. Juli 2019 um 16:12 Uhr schrieb Oliver Lietz <
> 
> [email protected]>:
> > It's already implemented based on Sling's Karaf Features:
> > 
> > https://sling.apache.org/documentation/development/testing-paxexam.html
> 
> Hm, it still seems to me that the list of bundles and their versions are
> all hardcoded (see SlingOptions.java). I would like to use complete
> features (as provided by the feature model), because these features are
> often already defined and used elsewhere (thus reuse), and secondly I can
> reference them from within the POM (instead of hardcoding them in a bundle).
> 
> As much as I like your approach, I see the problem that the maven
> dependencies and the IT dependencies are maintained twice and also at
> different locations.

The Sling "Features" (Options) provided by Testing PaxExam are really coming 
from this feature file (no double maintenance):

https://github.com/apache/sling-org-apache-sling-karaf-features/blob/master/
src/main/feature/feature.xml

The two Java files are a result of applying the Handlebars templates on the 
data from Sling's Karaf Features:

https://github.com/apache/sling-org-apache-sling-testing-paxexam/tree/master/
src/main/resources/templates

We have some ITs where the Provisioning Model is used, but three (probably 
more) shortcomings which come to mind are:
  - dedicated module for ITs required 
  - single instance for all tests (?)
  - no way to adjust Features

Solved already with Testing PaxExam, for adjusting a Feature (Option) see

https://github.com/apache/sling-org-apache-sling-jcr-contentloader/blob/
master/src/test/java/org/apache/sling/jcr/contentloader/it/
ContentloaderTestSupport.java#L89

It takes the existing Option (Features), removes the 
org.apache.sling.jcr.contentloader bundle and the current bundle from build is 
added as usual. The first two points are default.

There are of course more goodies included and having direct access into the 
OSGi container makes several workarounds unnecessary (via HTTP: deploying 
bundles, waiting for services, running tests...).

Regards,
O.

> Jörg





Reply via email to