Hi Xav,

There is a karaf-exam-container for pax-exam 3.4.0:
https://ops4j1.jira.com/wiki/display/PAXEXAM3/Karaf+Test+Container+Reference

An example of integration here:
https://github.com/ops4j/org.ops4j.pax.exam2/tree/master/samples/exam-itest-sample-karaf
or even here:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features.itests/net.osgiliath.features.karaf-features.itests.cdi
.

It's far much easy than using forked container, etc... And this container
have the features option!

Regards,


2014-04-11 9:31 GMT+02:00 xav <[email protected]>:

> Hi all,
>
> I try to include some integration test with pa-exam 3.4.0.
> I follow the tuto :
>
> http://karaf.apache.org/manual/latest-2.3.x/developers-guide/writing-tests.html
>
> in my pom, I put (copy/paste from different sample!)
>
>  <properties>
>         <exam.version>3.4.0</exam.version>
>         <url.version>1.6.0</url.version>
>     </properties>
>
> <dependency>
>             <groupId>org.apache.karaf.features</groupId>
>             <artifactId>standard</artifactId>
>             <version>3.0.0</version>
>             <classifier>features</classifier>
>             <type>xml</type>
>         </dependency>
>
>         <dependency>
>             <groupId>org.apache.karaf</groupId>
>             <artifactId>apache-karaf</artifactId>
>             <version>${karaf.version}</version>
>             <type>zip</type>
>             <scope>test</scope>
>         </dependency>
>
>
>
>
>         <dependency>
>             <groupId>org.ops4j.pax.exam</groupId>
>             <artifactId>pax-exam</artifactId>
>             <version>${exam.version}</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>org.apache.karaf.tooling.exam</groupId>
>
> <artifactId>org.apache.karaf.tooling.exam.container</artifactId>
>             <version>2.3.1</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>org.ops4j.pax.exam</groupId>
>             <artifactId>pax-exam-junit4</artifactId>
>             <version>${exam.version}</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>org.ops4j.pax.exam</groupId>
>             <artifactId>pax-exam-link-mvn</artifactId>
>             <version>${exam.version}</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>org.ops4j.pax.url</groupId>
>             <artifactId>pax-url-aether</artifactId>
>             <version>${url.version}</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>ch.qos.logback</groupId>
>             <artifactId>logback-core</artifactId>
>             <version>0.9.20</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>ch.qos.logback</groupId>
>             <artifactId>logback-classic</artifactId>
>             <version>0.9.20</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.ops4j.pax.exam</groupId>
>             <artifactId>pax-exam-spi</artifactId>
>             <version>3.4.0</version>
>             <scope>test</scope>
>             <type>jar</type>
>         </dependency>
>
>
> And I have the following error:
>
> org/ops4j/pax/exam/options/extra/FeaturesScannerProvisionOption
> java.lang.NoClassDefFoundError
> ...
> ...
>
> I don't understand, I tried to follow some samples, links, but nothing is
> real clear, which version to use of pax-exam and with which karaf version,
> lot of sample, but...
> moreover, I added this method:
>
> private void switchPlatformEncodingToUTF8() {
>         try {
>             System.setProperty("file.encoding", "UTF-8");
>             Field charset =
> Charset.class.getDeclaredField("defaultCharset");
>             charset.setAccessible(true);
>             charset.set(null, null);
>         } catch (IllegalAccessException | NoSuchFieldException e) {
>             throw new RuntimeException(e);
>         }
>     }
>
> because there is a bug in the 3.4.0 of pax-exam, is it right?
>
> Thanks for your help.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/integrating-test-with-pax-exam-tp4032704.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Reply via email to