Hi Philipp, actually, no, exam does not put test dependencies into the probe (thats how we used to call the bundle containing your test). There is an algorithm that tried to find your test classes (physically by crawling the project filesystem), then "walk" back to the package root and include all resources/classes below that root. In essence, if you are in a maven project, it will find target/test-classes as your root. These are all resources that will go into the bundle. Everything else must be provided as bundles on their own. BND generates imports for all missing packages.
This has mostly to do with the idea to not put any black magic or assumptions into the probe itself. Its really just your test class(es) and exam knows how to invoke the methods remotely (pax runner process under the hood). It is already out of your control what the manifest looks like, so it makes sense to put just the minimal amount of resources in there. In order to let your probe resolve, you need to provide all the packages yourself of cause. Toni -- *Toni Menzel || **http://okidokiteam.com* On Tue, Aug 31, 2010 at 5:20 PM, Rossmanith, Philipp < [email protected]> wrote: > Hi, > > I'm trying to run a simple JUnit test with Pax-Exam. I'm using Maven > 2.2.1, POM, JUnit code and Maven output (Surfire and command line) are > attached. > > The test should obtain an object for the interface ApplicationContext. I > can deploy the bundles under test; both of them show in Karaf as > providing the interface.*) > > When I run the test, I get a "java.lang.NoClassDefFoundError: > org/springframework/context/ApplicationContext" error. This surprises > me, as my understanding was that Pax Exam was creating a bundle from the > test's dependencies which should include all of the required > dependencies - and hence, the missing class file. > > Is there something obvious that I'm missing? > > Thanks in advance, > Ciao, Philipp > > *) > E.g.: > org.springframework.context.service.name = tsisb-auto-osgi-wsdl-prov > Bundle-SymbolicName = tsisb-auto-osgi-wsdl-prov Bundle-Version = > 1.0.0.SNAPSHOT objectClass = > org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplication > Context, org.springframework.osgi. > context.ConfigurableOsgiBundleApplicationContext, > org.springframework.context.ConfigurableApplicationContext, org.spring > framework.context.ApplicationContext, > org.springframework.context.Lifecycle, > org.springframework.beans.factory.ListableB > eanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, > org.springframework.context.MessageSource, org.sp > ringframework.context.ApplicationEventPublisher, > org.springframework.core.io.support.ResourcePatternResolver, org.spring > framework.beans.factory.BeanFactory, > org.springframework.core.io.ResourceLoader, > org.springframework.beans.factory.Dispo > sableBean > service.id = 267 > > > http://www.Taglocity.com Tags: Pax Exam, Test, Issue, TSISB > > > This e-mail and any attachments may contain confidential or privileged > information. > Any unauthorized copying, use or distribution of this information is > strictly > prohibited. > > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general > >
_______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
