Thanks Toni, the wrap suffix now works. But importing sadly still fails. I'm currently doing this:
public static CompositeOption junitBundles() { return new DefaultCompositeOption( wrappedBundle(bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.junit.link").noUpdate().startLevel(START_LEVEL_SYSTEM_BUNDLES)) .imports("org.easymock,org.easymock.internal;poweruser=true", "org.easymock.internal.matchers;poweruser=true"), systemProperty("pax.exam.invoker").value("junit"), wrappedBundle(bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.hamcrest.core.link")) .imports("org.easymock,org.easymock.internal;poweruser=true", "org.easymock.internal.matchers;poweruser=true"), wrappedBundle(bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")) .imports("org.easymock,org.easymock.internal;poweruser=true", "org.easymock.internal.matchers;poweruser=true") ); } On 30 December 2016 at 06:19, Toni Menzel <toni.men...@rebaze.com> wrote: > Why shouldn't it work? the link handler resolves to an InputStream thas is > being consumed by wrap protocol handler. > Otherwise i would consider it a bug in the url parser of pax-url-wrap. > The error to me indicates a missing dependency, like: > org.ops4j.pax.url:pax-url-wrap:2.5.2 > in your pom or gradle file. > > Toni > > *Toni Menzel* > > > *www.rebaze.de <http://www.rebaze.de/> | www.rebaze.com > <http://www.rebaze.com/> | @rebazeio <https://twitter.com/rebazeio>* > > On Fri, Dec 30, 2016 at 12:14 PM, 'Achim Nierbeck' via OPS4J < > ops4j@googlegroups.com> wrote: > >> Hi, >> >> I'm not sure if wrap and link do work in combination. >> It does work nicely though with maven bundles, so if you give a maven >> coordinate instead of a link, that should work well. >> I fear with link, which is another URL handler, the mixing of wrap >> doesn't work well. >> >> regards, Achim >> >> >> 2016-12-29 6:16 GMT+01:00 Henri Tremblay <henri.tremb...@gmail.com>: >> >>> I'm currently trying but with mild results. >>> >>> I tried this: >>> >>> public static CompositeOption junitBundles() { >>> return new DefaultCompositeOption(new JUnitBundlesOption(), >>> systemProperty("pax.exam.invoker").value("junit"), >>> >>> bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.hamcrest.core.link"), >>> >>> wrappedBundle(bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")) >>> .imports( >>> "org.easymock", >>> "org.easymock.internal;poweruser=true", >>> "org.easymock.internal.matchers;poweruser=true") >>> ); >>> } >>> >>> >>> But get "java.lang.IllegalStateException: Unknown protocol: wrap" >>> >>> Any idea? >>> >>> On Wednesday, December 28, 2016 at 9:59:19 AM UTC-5, Henri Tremblay >>> wrote: >>>> >>>> Thanks. I will try to wrap everything. >>>> >>>> In fact, I'm testing OSGi. I have an attribute that is supposed to >>>> allow poweruser to access EasyMock internal packages. This was done to >>>> allow compatibility for framework like PowerMock when using EasyMock in >>>> OSGi. However, normal use should not use these packages. My other solution >>>> would be to expose everything. >>>> >>>> On Wednesday, December 28, 2016 at 3:06:42 AM UTC-5, Achim Nierbeck >>>> wrote: >>>>> >>>>> hmm ... might be exotic, as Pax-Exam is more an integration test suit. >>>>> If you want to test the functionality of your code, usually you don't >>>>> need OSGi therefore a unit test itself is enough. >>>>> With Pax-Exam you can make sure the wiring of your bundles and the >>>>> functionality of your code inside an OSGi environment is fully functional. >>>>> Some tests only work when the complete environment is accessible, like >>>>> gogo shell commands etc. >>>>> >>>>> At [1], you'll find the definition for the junit bundles used inside >>>>> pax-exam. >>>>> >>>>> The wrapping of the junitBundles() dosn't work, you'll need to wrap >>>>> each of the corresponding bundles. >>>>> >>>>> regards, Achim >>>>> >>>>> [1] - https://github.com/ops4j/org.ops4j.pax.tipi/blob/master/ju >>>>> nit-4.12/pom.xml >>>>> >>>>> 2016-12-28 4:55 GMT+01:00 Henri Tremblay <henri.t...@gmail.com>: >>>>> >>>>>> Thanks. I was pretty much there but I can't wrappedBundle(junitBundl >>>>>> es()) >>>>>> >>>>>> So I guess I need to wrap one of the 3 bundles inside the >>>>>> junitBundles. Probably bundle("link:classpat >>>>>> h:META-INF/links/org.ops4j.pax.tipi.junit.link"). I will try tonight >>>>>> but will be happy if there is an easier way. >>>>>> >>>>>> But is my use-case that exotic? I thought it was pretty classic. >>>>>> >>>>>> On Tuesday, December 27, 2016 at 5:31:00 PM UTC-5, Achim Nierbeck >>>>>> wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> you can wrap the junit bundle and add those export declarations to >>>>>>> it. [1] >>>>>>> >>>>>>> Just make sure you don't have the junit configuration [2] in your >>>>>>> project, as that will collide with your own custom declaration. >>>>>>> >>>>>>> Hope this helps, Achim >>>>>>> >>>>>>> >>>>>>> [1] - https://ops4j1.jira.com/wiki/display/PAXEXAM4/Configuratio >>>>>>> n+Options#ConfigurationOptions-wrappedBundle >>>>>>> [2] - https://ops4j1.jira.com/wiki/display/PAXEXAM4/Configuratio >>>>>>> n+Options#ConfigurationOptions-junitBundles >>>>>>> >>>>>>> 2016-12-27 22:34 GMT+01:00 Henri Tremblay <henri.t...@gmail.com>: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I've been fighting for a bunch of hours now so I hope someone can >>>>>>>> help me. >>>>>>>> >>>>>>>> I've trying to test EasyMock OSGi configuration with Pax-Exam. >>>>>>>> Everything works fine except one thing. >>>>>>>> >>>>>>>> I need to export a conditional package from the JUnit bundle. With >>>>>>>> an attribute. >>>>>>>> >>>>>>>> Normally I would import like this in my MANIFEST.MF: >>>>>>>> >>>>>>>> org.easymock.internal;poweruser=true >>>>>>>> >>>>>>>> I have no idea how to do that. >>>>>>>> >>>>>>>> With Pax-Exam 4. >>>>>>>> >>>>>>>> Thanks for your help, >>>>>>>> Henri >>>>>>>> >>>>>>>> -- >>>>>>>> -- >>>>>>>> ------------------ >>>>>>>> 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 >>>>>>> >>>>>>> -- >>>>>> -- >>>>>> ------------------ >>>>>> 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 >>>>> >>>>> -- >>> -- >>> ------------------ >>> OPS4J - http://www.ops4j.org - ops4j@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+unsubscr...@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 >> >> -- >> -- >> ------------------ >> OPS4J - http://www.ops4j.org - ops4j@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+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - ops4j@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/IPIN9G0cIw0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > ops4j+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- ------------------ OPS4J - http://www.ops4j.org - ops4j@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.