You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Stefan Seelmann <ma...@stefan-seelmann.de> on 2014/12/20 18:40:14 UTC

OSGi Tests for API

On 12/16/2014 04:16 PM, Stefan Seelmann wrote:
> re OSGi pax exam test:
> That was a really good pointer, this tool is very helpful. It allows to
> write tests that starts an OSGi container (Felix or Eclipse) and install
> bundles. It is a bit tricky to configure because you need to define all
> bundles it should install including transitive dependencies, but I found
> a way to use the maven-dependency-plugin to generate a file containing
> the dependencies (deps.txt) and then parse that file in the tests.
> Currently its located in my sandbox, I create one test class for each
> shared/api module, 50% is done, I'll do the rest within the next days.
> Then I'd like to move it to shared project, either as its own
> osgi-integrationtest module or if possible move each test directly to
> the maven module it belongs to. Of course the same has to be done also
> for ApacheDS.

I'm finally done with creating the tests. The main thing they test is to
start on OSGi container and install all bundles of the LDAP API to
verify the the bundles are valid an and dependencies can be wired.

I'll move it now from my sandbox to the API trunk as new maven module
and make it part of the main build.

Kind Regards,
Stefan


Re: OSGi Tests for API

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 20/12/14 18:40, Stefan Seelmann a écrit :
> On 12/16/2014 04:16 PM, Stefan Seelmann wrote:
>> re OSGi pax exam test:
>> That was a really good pointer, this tool is very helpful. It allows to
>> write tests that starts an OSGi container (Felix or Eclipse) and install
>> bundles. It is a bit tricky to configure because you need to define all
>> bundles it should install including transitive dependencies, but I found
>> a way to use the maven-dependency-plugin to generate a file containing
>> the dependencies (deps.txt) and then parse that file in the tests.
>> Currently its located in my sandbox, I create one test class for each
>> shared/api module, 50% is done, I'll do the rest within the next days.
>> Then I'd like to move it to shared project, either as its own
>> osgi-integrationtest module or if possible move each test directly to
>> the maven module it belongs to. Of course the same has to be done also
>> for ApacheDS.
> I'm finally done with creating the tests. The main thing they test is to
> start on OSGi container and install all bundles of the LDAP API to
> verify the the bundles are valid an and dependencies can be wired.
>
> I'll move it now from my sandbox to the API trunk as new maven module
> and make it part of the main build

Thanks a lot Stefan !


Re: OSGi Tests for API

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 12/20/2014 06:40 PM, Stefan Seelmann wrote:
> On 12/16/2014 04:16 PM, Stefan Seelmann wrote:
> I'll move it now from my sandbox to the API trunk as new maven module
> and make it part of the main build.

Done.

But Jenkins is not happy. The problem is described at [1], I'll try to
find workaround.

Kind Regards,
Stefan


[1] https://ops4j1.jira.com/browse/PAXEXAM-543


Re: OSGi Tests for API

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 22/12/14 21:14, Stefan Seelmann a écrit :
> On 12/22/2014 04:56 PM, Stefan Seelmann wrote:
>> On 12/22/2014 01:32 PM, Stefan Seelmann wrote:
>>> We need proper OSGi-ified dependencies for antlr, dom4j, xpp3, for
>>> shared/API and probably others for ApacheDS.
>>> * Either we generate and deploy them by ourselfes, similar to what we
>>> did in Studio.
>>> * Or we try to use existing ones. ServiceMix guys hava a bunch available
>>> in maven central with groupId org.apache.servicemix.bundles, at least
>>> dom4j is there. The Spring "Enterprise Bundle Repository" also contains
>>> a lot.
>> I started to replace antlr 2.7.7 with the one provided by ServiceMix,
>> looks good so far, I'll try the same with dom4j and xpp3.
> Done. I replaced antlr, dom4j and xpp3 by OSGi-ified versions provided
> by ServiceMix, kudos to them! See http://svn.apache.org/r1647393.

I was goign to suggest to do that... Do we have any problem with any
other dependency we are using ?

(FTR, the build works like a charm on my machine)



Re: OSGi Tests for API

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 12/22/2014 04:56 PM, Stefan Seelmann wrote:
> On 12/22/2014 01:32 PM, Stefan Seelmann wrote:
>> We need proper OSGi-ified dependencies for antlr, dom4j, xpp3, for
>> shared/API and probably others for ApacheDS.
>> * Either we generate and deploy them by ourselfes, similar to what we
>> did in Studio.
>> * Or we try to use existing ones. ServiceMix guys hava a bunch available
>> in maven central with groupId org.apache.servicemix.bundles, at least
>> dom4j is there. The Spring "Enterprise Bundle Repository" also contains
>> a lot.
> 
> I started to replace antlr 2.7.7 with the one provided by ServiceMix,
> looks good so far, I'll try the same with dom4j and xpp3.

Done. I replaced antlr, dom4j and xpp3 by OSGi-ified versions provided
by ServiceMix, kudos to them! See http://svn.apache.org/r1647393.

Kind Regards,
Stefan



Re: OSGi Tests for API

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 12/22/2014 01:32 PM, Stefan Seelmann wrote:
> We need proper OSGi-ified dependencies for antlr, dom4j, xpp3, for
> shared/API and probably others for ApacheDS.
> * Either we generate and deploy them by ourselfes, similar to what we
> did in Studio.
> * Or we try to use existing ones. ServiceMix guys hava a bunch available
> in maven central with groupId org.apache.servicemix.bundles, at least
> dom4j is there. The Spring "Enterprise Bundle Repository" also contains
> a lot.

I started to replace antlr 2.7.7 with the one provided by ServiceMix,
looks good so far, I'll try the same with dom4j and xpp3.

Kind Regards,
Stefan



Re: OSGi Tests for API

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 12/22/2014 12:32 PM, Stefan Seelmann wrote:
> On 12/20/2014 06:40 PM, Stefan Seelmann wrote:
>> I'm finally done with creating the tests. The main thing they test is to
>> start on OSGi container and install all bundles of the LDAP API to
>> verify the the bundles are valid an and dependencies can be wired.
>>
>> I'll move it now from my sandbox to the API trunk as new maven module
>> and make it part of the main build.
> 
> Hi guys,
> 
> I just wanted to ask if the shared/API project build works for you,
> especially the new integ-osgi module I added. It worked for me, but now
> I wiped my .m2/repository (because of some strange behaviour, I'll write
> more about that later) and the OSGi tests fail now:
> 
> ERROR: Bundle org.apache.directory.api.ldap.codec.core [18] Error
> starting
> file:/tmp/1419246180714-0/bundles/org.apache.directory.api.ldap.codec.core_1.0.0.M27-SNAPSHOT.jar
> (org.osgi.framework.BundleException: Unresolved constraint in bundle
> org.apache.directory.api.ldap.codec.core [18]: Unable to resolve 18.0:
> missing requirement [18.0] osgi.wiring.package;
> (&(osgi.wiring.package=org.apache.directory.api.ldap.model.entry)(version>=1.0.0.M27-SNAPSHOT))
> [caused by: Unable to resolve 42.0: missing requirement [42.0]
> osgi.wiring.package; (&(osgi.wiring.package=antlr)(version>=2.7.7))])

I found the problem, I was able to reproduce it on Jenkins by
configuring "Use private Maven repository".

For OSGi tests I replace the original Maven artifacts that are not valid
OSGi bundles (like antlr, dom4j, etc.) with valid ones.

For Studio we already generated them, e.g.
org.apache.directory.studio:org.antlr.antlr:2.7.7, back in 2012 and
deployed it to maven central. Unfortunately the version deployed on
maven central doesn't contain version information in export-package
instruction, so an import-package with version 2.7.7 won't work.

However when building the Studio trunk locally (which I did before) our
custom antlr is built again and installed to the local maven repo, with
same version 2.7.7, but now the export-package instruction of the
generated manifest.mf now contian the version information.

Holy crap. One step up and two steps back.

What to do?

We need proper OSGi-ified dependencies for antlr, dom4j, xpp3, for
shared/API and probably others for ApacheDS.
* Either we generate and deploy them by ourselfes, similar to what we
did in Studio.
* Or we try to use existing ones. ServiceMix guys hava a bunch available
in maven central with groupId org.apache.servicemix.bundles, at least
dom4j is there. The Spring "Enterprise Bundle Repository" also contains
a lot.

Kind Regards,
Stefan


Re: OSGi Tests for API

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 12/20/2014 06:40 PM, Stefan Seelmann wrote:
> I'm finally done with creating the tests. The main thing they test is to
> start on OSGi container and install all bundles of the LDAP API to
> verify the the bundles are valid an and dependencies can be wired.
> 
> I'll move it now from my sandbox to the API trunk as new maven module
> and make it part of the main build.

Hi guys,

I just wanted to ask if the shared/API project build works for you,
especially the new integ-osgi module I added. It worked for me, but now
I wiped my .m2/repository (because of some strange behaviour, I'll write
more about that later) and the OSGi tests fail now:

ERROR: Bundle org.apache.directory.api.ldap.codec.core [18] Error
starting
file:/tmp/1419246180714-0/bundles/org.apache.directory.api.ldap.codec.core_1.0.0.M27-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.directory.api.ldap.codec.core [18]: Unable to resolve 18.0:
missing requirement [18.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.directory.api.ldap.model.entry)(version>=1.0.0.M27-SNAPSHOT))
[caused by: Unable to resolve 42.0: missing requirement [42.0]
osgi.wiring.package; (&(osgi.wiring.package=antlr)(version>=2.7.7))])

I'll continue to investigate...

Kind Regards,
Stefan