Hi Tony, Thanks a lot for your answer.
I think what you are working on is absolutely great, and I think it would also perfectly fit for our needs. Starting the OSGi container from a junit rule makes the tests cleaner. I guess this would also work with Karaf, right ? But, just for the curiosity, how do you plan to access the OSGi service from outside the container ? And when do you plan to push your local branch ? :-) 2) Yes I tried booting neo4j from the @Configuration method, but there 2 issues IMHO: a) It provides only a way to start neo4j, obviously no hook to run some post tests code b) since the configure code is also deployed as an OSGi bundle, it forces you to make sure the <Import-Package> does not include the neo4j packages, which cannot be resolved. It is feasible, but this is hard work and I'm not sure about the maintainability of this over the time 3) Not sure I understood your proposal with the RunWith. Do you mean implementing my own Junit runner that wraps the PaxExam runner, and run my tests with it ? Cheers, Nicolas On Fri, Aug 4, 2017 at 12:47 PM, Toni Menzel <[email protected]> wrote: > Hey Nicolas, > > I think you are looking at something like the (new) acceptance test api > that runs from outside of > osgi: https://github.com/ops4j/org.ops4j.pax.exam2/ > blob/master/drivers/pax-exam-acceptance/src/test/java/org/ > ops4j/pax/exam/acceptance/AcceptanceTestApiTest.java > > This is currently in active development and is lacking some features like > smooth access to OSGi Services from the outside. > Currently, only the rest client is available (using RestAssured), but I a > new one making internal services available to the test automatically is > already on my local branch. > > In any way, we also could think of making out-of-container setup code > available in regular "@RunWith(PaxExam.class)" tests. Did you try booting > Neo4j inside the @Configuration method? that is executed before the OSGi > container is launched, so it does run in plain java. > > Another try: did you try using a Junit Rule with "@RunWith()"? this should > work, too. > > Toni > > > > > *www.rebaze.de <http://www.rebaze.de/> | www.rebaze.com > <http://www.rebaze.com/> | @rebazeio <https://twitter.com/rebazeio>* > > On Fri, Aug 4, 2017 at 11:59 AM, Nicolas Brasey <[email protected]> > wrote: > >> Hi, >> >> Context: I want to use pax-exam for our business integration tests that >> needs to have a database (neo4j) that is not OSGi friendly running before >> the test are executed. we use maven. >> >> Also, neo4j provides a embedded server that works extremely well outside >> of an OSGi container, but I can't find a way to start this embedded server >> with pax-exam outside of the container before the pax-exam machinery is >> starting. >> >> The idea is to start the database in the non-OSGi context when the >> pax-runner is starting, something like the beforeClass, and stop the >> database after all the tests are finished ala afterClass. >> >> Does anyone has an idea how to do this ? >> >> Thanks >> Nicolas >> >> -- >> -- >> ------------------ >> OPS4J - http://www.ops4j.org - [email protected] >> >> --- >> 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 [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > 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/RlgwSX04-O8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
