Hi Harald/Toni,

Thanks for your advice, I didn't explain myself very well but was sure I
was missing something wrt pax-exam, however it seems to have been the
structure of my maven project.  In short it's all working fine, so sincere
thanks to all who've contributed.

I've spent today using the paxexam native runner, which is blisteringly
fast to run and a joy to use (debug) within Eclipse (the Karaf flavour of
paxexam works perfectly too, but I'll keep that for just end-to-end and
future stress tests to minimize container coupling).


Longer account (but with no identification of issue):

I'd setup all the plugins (compiler, bundle, scr, jar, surefire, failsafe,
paxexam) in the parent POM using pluginManagement and was using some
archetypes I'd created to automate the creation of new modules (which then
didn't need versions or much config due the fat parent POM - seemed to be
following the DRY principle well).

I was both defining my dependencies in the POM and then using mavenBundle()
to load them within paxexam (the wiki documentation is well written and
perfectly clear as to the "twice" for provisioning - so I didn't think it
was stupid ;-)   But when this failed, I did think I was missing something
- so tried drastic, desperate things like using maven-dependency-plugin to
unpack test dependencies to try to be included in the probe.

After reading your responses and comparing to some examples I'd previously
worked through, I began to suspect my error wasn't paxexam but in maven.
Looking at some Apache projects using pax I saw very different module
layout (much deeper than the broad, top-heavy structure I had, of a lot of
modules referencing a single fat parent).  When I copied this structure it
started to work!

I've tried to create a simple testcase with the same top-heavy structure as
the larger project but can't reproduce the error (so it could easily have
been something else, but I'm damned if I know what).


Thanks,
Caspar


Message: 1
> Date: Fri, 09 Dec 2011 19:11:16 +0100
> From: Harald Wellmann <[email protected]>
> Subject: Re: pax exam and test utilities jar
> To: General OPS4J <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Caspar,
>
> I don't know anything about Karaf, so if your problem is related to that
> specific environment, I wouldn't be of much help...
>
> Am 09.12.2011 18:36, schrieb Caspar MacRae:
> >
> > The utility jar is included in the integration test's POM as a
> > dependency with scope=test, but this results in a NoClassDefFoundError.
>
> But maybe it's just a very simple thing: Any compile time dependencies
> of your own Pax Exam test cases need to be configured twice, once for
> the driver (in your POM) and once for the container (in your
> @Configuration method).
>
> Adding you utility jar to the POM will NOT provision it to the container
> automatically.
>
> Best regards,
> Harald
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 09 Dec 2011 19:15:23 +0100
> From: Harald Wellmann <[email protected]>
> Subject: [ANN] XVisitor 0.1.1 Released
> To: [email protected],        General OPS4J
>        <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> XVisitor 0.1.1 is now available from Maven Central. This release fixes a
> bug related to SKIP actions for mixed content.
>
> More details:
>
>
> http://team.ops4j.org/wiki/display/XVISITOR/2011/12/08/XVisitor+0.1.1+Released
>
> Best regards,
> Harald
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 9 Dec 2011 19:16:06 +0100
> From: Toni Menzel <[email protected]>
> Subject: Re: pax exam and test utilities jar
> To: General OPS4J <[email protected]>
> Message-ID:
>        <cahxgaz5m0ysyhsbllnufgzfgb8wmtmmozalozwjjkgh2acq...@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> That "twice" may sound stupid, but its really about you programming with it
> at compile time (compile your tests) and running the correct set of bundles
> in your target environment.
> Your target environment (osgi container) is solely built out of stuff in
> your @Confuguration. Depending on what you actually configure this target
> environment could end up in a totally different JVM.
>
>
> On Fri, Dec 9, 2011 at 7:11 PM, Harald Wellmann <
> [email protected]
> > wrote:
>
> > Hi Caspar,
> >
> > I don't know anything about Karaf, so if your problem is related to that
> > specific environment, I wouldn't be of much help...
> >
> > Am 09.12.2011 18:36, schrieb Caspar MacRae:
> >
> >
> >> The utility jar is included in the integration test's POM as a
> >> dependency with scope=test, but this results in a NoClassDefFoundError.
> >>
> >
> > But maybe it's just a very simple thing: Any compile time dependencies of
> > your own Pax Exam test cases need to be configured twice, once for the
> > driver (in your POM) and once for the container (in your @Configuration
> > method).
> >
> > Adding you utility jar to the POM will NOT provision it to the container
> > automatically.
> >
> > Best regards,
> > Harald
> >
> > ______________________________**_________________
> > general mailing list
> > [email protected]
> > http://lists.ops4j.org/**mailman/listinfo/general<
> http://lists.ops4j.org/mailman/listinfo/general>
> >
>
>
>
> --
> Toni Menzel Source <http://tonimenzel.com>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.ops4j.org/pipermail/general/attachments/20111209/29c41cd8/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>
>
> End of general Digest, Vol 78, Issue 15
> ***************************************
>
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to