Hi Xav,

You don't have to use org.apache.karaf.tooling.exam.container with pax-exam 3.4.0: Karaf is now a "native" Pax Exam test container.

Take a look on the itest of Karaf 3.0.0, you will see how to use it.

Regards
JB

On 04/11/2014 09:31 AM, xav wrote:
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.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to