Hi,

as I had also problems setting up pax exam with the karaf container I wrote a forge plugin to make it much easier to create an itest project. ( jboss forge does the project setup for you ) Just download forge from forge.jboss.org (you'll need the 1.4.4 final version), extract the archiv to a directory of your choice and start the forge executable from the bin folder from command line / shell.

After some time the forge console will open. Then you should cd to the directory where you want to create your test project in. To create a new project execute sth. like:

new-project --named MyKarafTestProject  --topLevelPackage com.example.itests

After that the forge console will automatically go into the project directory. There you can follow the instructions from https://github.com/MarWestermann/forge-paxexam

hope that helps,

regards, Marco

Am 11.04.2014 09:31, schrieb xav:
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.


--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net

interSales AG Internet Commerce
Weinsbergstr. 190
50825 Köln

Tel  02 21 - 27 90 50
Fax  02 21 - 27 90 517
Mail [email protected]
Mail [email protected]
Web  www.intersales.de

Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Hippler
Vorstand: Andrej Radonic, Peter Zander

Reply via email to