Spring OSGI Testing Framework [message #915945] |
Tue, 18 September 2012 05:15  |
Eclipse User |
|
|
|
Hi,
I have a question regarding the Spring Osgi Testing Framework (spring-osgi-test). The base test class uses a local maven repository to resolve the framework bundles needed to be installed in the osgi platform. I have not much experience with maven and I am having a hard time setting up a maven project with the respective dependencies. Does somebody has an example pom to be used and an example settings.xml that shows the required repositories?
Regards,
Thorsten
|
|
|
|
Re: Spring OSGI Testing Framework [message #920396 is a reply to message #916036] |
Sat, 22 September 2012 22:28   |
Eclipse User |
|
|
|
Hi Thorsten,
spring-osgi-test is no longer maintained, it has become gemini-blueprint-test.
<dependency>
<groupId>org.eclipse.gemini.blueprint</groupId>
<artifactId>gemini-blueprint-test</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>
Alas at the moment Gemini Blueprint is not deployed to any official Maven repository (so this dependency won't work without manual intervention), rest assured we are working on getting it out there.
In the meantime you could clone the project source and # mvn install the 1.0.2.RELEASE version. This will make it available locally to use as a dependency for projects on your machine. Alternatively if have a company wide Maven repository you could deploy it there for everyone (in your company) to use.
From what I can tell from working with Blueprint and it's integration tests, it's not really intended to be used outside of the project. But if you still want to try, some of this information might be of help to you.
Examples of its usage can also be found under gemini-blueprint/integration-tests/tests.
As you mentioned it looks for bundles to deploy, for tests/ing, from the local Maven repository. This means ~/.m2/repository.
This local maven repository is used by Maven to stage artifacts from builds, so they can be resolved and used as dependencies. Maven will install project artifacts to its local repo if you run # mvn install.
I recommend you read through the Maven lifecycle guide, as the lifecycle is very important regarding how Maven works.
h t t p ://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
If your tests extend AbstractConfigurableBundleCreatorTests you can build bundles dynamically from within the test, skipping the local Maven repo altogether.
See the javadoc/code on AbstractOnTheFlyBundleCreatorTests for more details.
I am sorry I cannot be more specific as I am still learning the in's and out's of Blueprint. But I hope I have given you something useful.
As for EBR that is what some OSGi platforms use to resolve bundles and their dependencies automatically. Think of yum for Redhat or apt-get for Ubuntu.. As far as I know it is not used by the blueprint test framework.
If you have any more questions, I'll be happy to try and help some more.
Regards,
Aaron
|
|
|
Re: Spring OSGI Testing Framework [message #923839 is a reply to message #920396] |
Wed, 26 September 2012 04:36  |
Eclipse User |
|
|
|
Thanks a lot for that detailed description. I started out with osgi-test because it was mentioned in the spring-osgi documentation. After a while a also realized that osgi-test is not really up to date. Actually I am using maven tycho now since tycho also supports JUnit4.
After setting up a local updatesite which provides my target platform, the tests are properly run by tycho.
Regards,
Thorsten
|
|
|
Powered by
FUDForum. Page generated in 0.05008 seconds