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.