Pax exam and maven

565 views
Skip to first unread message

Andrea Fino

unread,
Aug 25, 2015, 11:09:15 AM8/25/15
to OPS4J
Hi all,

I'm new in pax exam and i'm trying to create a simple test with maven and pax exam. This is my class:

   package org.sut.paxexam;

   import javax.inject.Inject;

   import org.osgi.framework.BundleContext;
   import static org.ops4j.pax.exam.CoreOptions.*;


   import org.junit.Test;
   import org.junit.runner.RunWith;
   import org.ops4j.pax.exam.Configuration;
   import org.ops4j.pax.exam.Option;
   import org.ops4j.pax.exam.junit.PaxExam;

   @RunWith(PaxExam.class)
   public class SimpleTest {
   
       @Inject
       BundleContext bundleContext;
   
       @Configuration
       public Option[] config() {
           return options(
                   junitBundles()
                   );
       }
   
       @Test
       public void simpleTest() {
           System.out.println("********** Hello Test *************");
       }
   
   }


And this is my pom:

 <build>
      <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
            <source>1.6</source>
            <target>1.6</target>
            </configuration>
        </plugin>
      </plugins>
  </build>
 
  <dependencies>
 
       <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.10</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-native</artifactId>
        <version>4.4.0</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>4.3.0</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-aether</artifactId>
        <version>2.3.0</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-link</artifactId>
        <version>2.3.0</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>
   
    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-classpath</artifactId>
        <version>2.3.0</version>
        <scope>test</scope>
    </dependency>
   
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit4</artifactId>
        <version>4.4.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-link-assembly</artifactId>
        <version>4.4.0</version>
        <scope>test</scope>
    </dependency>
   
  </dependencies>


When i run my project the eclipse console display this error:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.sut.paxexam.SimpleTest
[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.4.0) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class org.sut.paxexam.SimpleTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.932 sec <<< FAILURE!
initializationError(org.sut.paxexam.SimpleTest)  Time elapsed: 0.012 sec  <<< ERROR!
org.ops4j.pax.exam.TestContainerException: No service org.osgi.framework.launch.FrameworkFactory found in META-INF/services on classpath
    at org.ops4j.pax.exam.nat.internal.NativeTestContainerFactory.create(NativeTestContainerFactory.java:55)
    at org.ops4j.pax.exam.spi.DefaultExamReactor.stage(DefaultExamReactor.java:86)
    at org.ops4j.pax.exam.spi.reactors.ReactorManager.stageReactor(ReactorManager.java:198)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner.<init>(ProbeRunner.java:80)
    at org.ops4j.pax.exam.junit.PaxExam.createDelegate(PaxExam.java:82)
    at org.ops4j.pax.exam.junit.PaxExam.<init>(PaxExam.java:73)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Results :

Tests in error:
  initializationError(org.sut.paxexam.SimpleTest): No service org.osgi.framework.launch.FrameworkFactory found in META-INF/services on classpath

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


I can't understand why i have this error, if you know some tutorial that explain how to create a pax exam and maven project show me it. I don't use apache karaf

Toni Menzel

unread,
Aug 25, 2015, 11:21:13 AM8/25/15
to OPS4J Mailing Lists
You are using the native pax exam runner (pax-exam-container-native) which requires you to include an OSGi Framework to your dependencies.

You should:
- remove the osgi core dependency from the pom
- add for example Felix:
<dependency>
    <groupId>org.apache.felix</groupId>
    <artifactId>org.apache.felix.framework</artifactId>
    <version>5.0.1</version>
</dependency>

Also: consider upgrading to Pax Exam 4.6.0

Toni Menzel

Head of Rebaze


Are you curious? Follow us

rebaze GmbH | http://www.rebaze.de | Twitter @rebazeio LinkedIn Profile


--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrea Fino

unread,
Aug 25, 2015, 11:49:17 AM8/25/15
to OPS4J
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.sut.paxexam.SimpleTest
[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.4.0) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class org.sut.paxexam.SimpleTest
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - running test class org.sut.paxexam.SimpleTest
[main] INFO org.ops4j.pax.exam.spi.reactors.ReactorManager - suite finished
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.989 sec <<< FAILURE!
simpleTest
(org.sut.paxexam.SimpleTest)  Time elapsed: 0.621 sec  <<< ERROR!
java
.lang.ClassCastException: org.apache.felix.framework.wiring.BundleCapabilityImpl cannot be cast to org.osgi.resource.Capability
    at org
.apache.felix.resolver.Util.isFragment(Util.java:63)
    at org
.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:151)
    at org
.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:431)
    at org
.apache.felix.framework.Felix.init(Felix.java:733)
    at org
.apache.felix.framework.Felix.init(Felix.java:624)
    at org
.ops4j.pax.exam.nat.internal.NativeTestContainer.start(NativeTestContainer.java:176)
    at org
.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
    at org
.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
    at org
.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org
.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org
.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org
.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org
.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org
.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org
.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org
.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
    at org
.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
    at org
.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)

    at org
.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org
.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:606)
    at org
.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org
.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org
.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org
.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org
.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
 
Thank you but when i add the depenency and remove the org.osgi.core dependency the console display this error. I have another question i have to put the dependency with scope test or without scope?

Andrea Fino

unread,
Aug 25, 2015, 11:55:04 AM8/25/15
to OPS4J
OK thank. I have remove the org.osgi.core dependency and i have add the felix framework dependency. But when i execute my project the console dispay this error:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.sut.paxexam.SimpleTest
[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.4.0) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class org.sut.paxexam.SimpleTest

    at org
.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org
.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:606)
    at org
.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org
.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org
.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org
.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)

    at org
.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)Inserisci qui il codice...


Harald Wellmann

unread,
Aug 25, 2015, 1:23:02 PM8/25/15
to op...@googlegroups.com
Does your Felix implementation version match the OSGi API version?

I suggest you take a look at Pax Exams integration tests and start from
there.

Or you use one of the Pax Exam Maven archetypes (exam-osgi-archetype) to
create a stub project.

Regards,
Harald
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>
> ---
> You received this message because you are subscribed to the Google
> Groups "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.

Andrea Fino

unread,
Aug 27, 2015, 3:26:57 AM8/27/15
to OPS4J
OK I'have find my error: My maven project can't download pax-exam 4.5.0 jar and so display the error:

WARNING: Error resolving artifactorg.ops4j.pax.exam:pax-exam:jar:4.5.0:Could not transfer artifact org.ops4j.pax.exam:pax-exam:jar:4.5.0 from/to central (http://repo1.maven.org/maven2/): Connect to repo1.maven.org:80 [repo1.maven.org/23.235.43.209] failed: Connection timed out
shaded
.org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.ops4j.pax.exam:pax-exam:jar:4.5.0 from/to central (http://repo1.maven.org/maven2/): Connect to repo1.maven.org:80 [repo1.maven.org/23.235.43.209] failed: Connection timed out
    at shaded
.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at shaded
.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at shaded
.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at shaded
.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
    at org
.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:573)
    at org
.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:528)
    at org
.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:506)
    at org
.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:481)
    at org
.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:123)
    at org
.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:525)
    at org
.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
    at org
.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
    at org
.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:878)
    at org
.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
    at org
.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
    at org
.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
    at org
.apache.felix.framework.Felix.installBundle(Felix.java:2965)
    at org
.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
    at org
.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:140)
    at org
.ops4j.pax.exam.nat.internal.NativeTestContainer.installAndStartBundles(NativeTestContainer.java:308)
    at org
.ops4j.pax.exam.nat.internal.NativeTestContainer.start(NativeTestContainer.java:177)
Caused by: shaded.org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.ops4j.pax.exam:pax-exam:jar:4.5.0 from/to central (http://repo1.maven.org/maven2/): Connect to repo1.maven.org:80 [repo1.maven.org/23.235.43.209] failed: Connection timed out
    at shaded
.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
    at shaded
.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
    at shaded
.org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
    at shaded
.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
    at shaded
.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
    at shaded
.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
    at shaded
.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
   
... 45 more
Caused by: shaded.org.apache.maven.wagon.TransferFailedException: Connect to repo1.maven.org:80 [repo1.maven.org/23.235.43.209] failed: Connection timed out
    at shaded
.org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1085)
    at shaded
.org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:977)
    at shaded
.org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
    at shaded
.org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
    at shaded
.org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
    at shaded
.org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:560)
    at shaded
.org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
    at shaded
.org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:404)
    at shaded
.org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
    at shaded
.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
   
... 50 more
Caused by: shaded.org.apache.http.conn.ConnectTimeoutException: Connect to repo1.maven.org:80 [repo1.maven.org/23.235.43.209] failed: Connection timed out
    at shaded
.org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138)
    at shaded
.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
    at shaded
.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at shaded
.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at shaded
.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at shaded
.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at shaded
.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at shaded
.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at shaded
.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org
.ops4j.pax.url.mvn.internal.wagon.ConfigurableHttpWagon.execute(ConfigurableHttpWagon.java:142)
    at shaded
.org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1000)
   
... 59 more
Caused by: java.net.ConnectException: Connection timed out
    at java
.net.PlainSocketImpl.socketConnect(Native Method)
    at java
.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java
.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java
.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java
.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java
.net.Socket.connect(Socket.java:579)
    at shaded
.org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
    at shaded
.org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
   
... 69 more

java
.lang.Exception: Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException
    at org
.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
    at org
.apache.felix.framework.Felix.init(Felix.java:689)
Aug 27, 2015 9:12:43 AM org.ops4j.pax.exam.spi.reactors.ReactorManager afterClass
Inserisci qui il codice...

Inserisci
qui il codice...



Benson Margulies

unread,
Aug 27, 2015, 6:52:23 PM8/27/15
to OPS4J
There's a question that the archetype does not answer: How to add a pax-exam test to the very same project that builds a bundle?

I've worked out a mechanism that involves picking up the bundle via the jar file in target, but it left me curious; what about other bundles built in the reactor? pax-url-aether talks to the repository, but does it talk to the reactor?

My other alternative was to eschew the use of the pax-url-aether altogether, and use the dependency plugin to gather the bundles, since I believe that this _does_ respect the reactor.

Achim Nierbeck

unread,
Aug 28, 2015, 4:13:38 AM8/28/15
to op...@googlegroups.com
Hi Benson, 

as Pax-Exam is actually an Integration-Test tool, it expects to be used with a fully build artifact and therefore it's not meant to be used within the same module. But never the less it can be done. 
If you dig in this mailinglist you'll find a couple of different ways. One way can also be found in the Apache Karaf Cookbook and it's corresponding sources [1]. 

regards, Achim 


--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Harald Wellmann

unread,
Aug 28, 2015, 6:29:46 AM8/28/15
to OPS4J Mailing Lists
You can use the reference: protocol to provision exploded (i.e. unzipped) bundles directly from the workspace of your current project. This is done a lot in other Pax projects like Pax CDI or Pax Warp.

See e.g. https://github.com/ops4j/org.ops4j.pax.cdi/blob/cdi-1.0.0.RC1/pax-cdi-test-support/src/main/java/org/ops4j/pax/cdi/test/support/TestConfiguration.java#L329

Regards,
Harald


2015-08-28 0:52 GMT+02:00 Benson Margulies <bimar...@gmail.com>:

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.

Andreas Veithen

unread,
Aug 29, 2015, 6:09:19 PM8/29/15
to OPS4J
Or you can use the solution I've documented here:


That solution is indeed able to load bundles from the reactor, i.e. in a multi-module build, it gives the expected result when "mvn clean verify" is used instead of "mvn clean install".

Andreas

Benson Margulies

unread,
Aug 29, 2015, 8:00:32 PM8/29/15
to op...@googlegroups.com
Andreas,

Thank you very much. Not only is this a practical solution to some of
my problems, but I was feeling like I must be crazy that no one else
felt that this stuff was interesting or important.


>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OPS4J" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ops4j/NUEc3cYdwd4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ops4j+un...@googlegroups.com.

Achim Nierbeck

unread,
Aug 30, 2015, 5:11:37 AM8/30/15
to op...@googlegroups.com
Well, 

if one would just do a quick glimpse on the integration tests of 
Pax-Exam, Pax-Web, Apache Karaf, Apache Karaf Cellar and various more open source projects. 
You'd see how those Projects actually use Pax-Exam. 
Now a little number: Pax-Web itself does have about 300+ tests using Pax-Exam. 
Also you'd find a number of tutorials using Pax-Exam. 
Not speaking of a pretty good documentation at [1]. 
So to actually say there is no interesting or important parts documented is just not fair!
All of the Pax projects are maintained only in private spare time. 
If you feel that this documentation isn't enough feel free to improve it. 

regards, Achim 



You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages