PDA

View Full Version : Deployment and Testing via Eclipse



thilker
Oct 2nd, 2008, 05:48 PM
Hi!

1. I've a problem with developing Bundles in Eclipse.

Imagine you want to develop 2 or more bundles in Eclipse whitch depend on each other.
Ok. I created bundle "A" and implemented all the stuff that is needed (interfaces, implementations,MANIFEST.MF, modul-context, osgi-context)

Then I create bundle "B" whitch depends on bundle "A".
So I declared the package I exported in A to be imported in B.
But Eclipse tells me that the package I want to import does not exist.
Hmm. Do I have to deploy "A" to the DM-Server?
(How to deploy a normal bundle from Eclipse to the DM-Server?)
Do I've to press a magic key?
It should be very simple, but I can't resolve this problem.
(In the past you only had to add the project "A" to the build path of project "B" :)
Strange, what did I miss?

2. Is there a manual how to create UnitTests for bundles?
Or do you have a tip how to create UnitTests for bundles?

Thanks in advance!

Reagrads!
Thorsten

Christian Dupuis
Oct 2nd, 2008, 07:07 PM
Thorsten,

there are two approaches to make STS aware for intern bundle project dependencies:

1. Define a PAR project and add both bundles two that PAR. That will automatically handle bundle project dependencies within the scope of that PAR.

2. If you don't want to define PAR, declare a "Project Reference" using the Eclipse project preferences (Right click on project B -> Project References) and select project A.

You might need to edit-save the MANIFEST.MF of project A to make that changes propagate to the classpath container and the validation framework.

HTH

Christian

thilker
Oct 3rd, 2008, 04:39 AM
Thank you for the solution.

BTW
Here is the answer of my question about Testing:

It's in the "Spring Dynamic Modules Reference Guide"
(I'm not allowed to post the URL yet :()

Regards,
Thorsten

Leslie Noth
Oct 15th, 2008, 08:31 AM
Christian,

I am facing the same problem..

Could you elaborate a bit more on how exactly this should work?
I have created a PAR project and made references to projects A and B.

But B still complains that it cannot find A... :(

Regards,
Les

Leslie Noth
Oct 15th, 2008, 09:09 AM
Very intelligent first post, it was a refresh problem...

Christian Dupuis
Oct 16th, 2008, 12:58 AM
Very intelligent first post, it was a refresh problem...

The current behavior is actually not very intuitive and we are working on improving detection of such changes in order to automatically trigger the refresh that needs to be done manually at the moment.

Sorry for the inconvenience.

Christian