tags:

views:

11

answers:

0

I am writing up a PaxExam test and i am getting strange behaviour when i reference classes belonging to a different bundle in the configure() method of my Test. I have simplified the problem to the following:

I create 2x bundles on the fly. Test Bundle * configure builds up 2 x bundles. * build Service bundle by adding(Class). * imports Service bundle.

Service bundle * only exports Service intf. * Activator and Impl are in sub pkg that is not exported or required by Test.

Under eclipse test lives in one package and within the same project live the service classes under a different pkg. With this setup if i run PaxExam i can exceptions and have included print statements to print the Service classloader inside the test method and inside the activator. Both get different values which of course means the test has 2 different Service classes loaded.

However if i take the Service packages and move them to a separate project and change the configure of Test to build the jar without referring to any classes by simply pulling in the entire bin dir of the now separate Service pkg everything works. The print statements dumping the classloader inside the test method and inside the activator.start both print the same value. This is good because it prooves only one Service.class exists in the system.

1/ Both the Test and Service project are eclipse plugin projects. It appears that having classes belonging to a single project some how screws up eclipse's equinox container. How can i fix ?

Forgot to mention I am running the tests as a junit not a plugin'd junit test.