Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSpring OSGI Testing Framework
https://www.eclipse.org/forums/index.php/mv/msg/378115/915945/#msg_915945
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?
Which states that one has to use the SpringSource EBR in conjunction with OSGI which I did not. EBR and maven central have different naming conventions. The maven central repository for example hosts the org.springframework.osgi:spring-osgi-test artifact but that artifact has dependencies of type org.springframework:org.springframework.test, which is EBR style. This artifact is not hosted by maven central. At least not with that artifactId. The artifactId in maven central is spring-test. Using the EBR I managed to run my first test-case.
Since there are a couple of reads for this thread but no comments I wonder if it is really a good idea to use the OSGI Testing Framework. Is that maybe old-fashion and testing should be performed differently?
Regards,
Thorsten]]>Thorsten Schlathölter2012-09-18T12:46:42-00:00Re: Spring OSGI Testing Framework
https://www.eclipse.org/forums/index.php/mv/msg/378115/920396/#msg_920396
spring-osgi-test is no longer maintained, it has become gemini-blueprint-test.
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.
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 ]]>Aaron Whiteside2012-09-23T02:28:19-00:00Re: Spring OSGI Testing Framework
https://www.eclipse.org/forums/index.php/mv/msg/378115/923839/#msg_923839
After setting up a local updatesite which provides my target platform, the tests are properly run by tycho.