Skip to content

JochenHiller/concierge-tests

Repository files navigation

Concierge-Tests

This project documents testing the Eclipse OSGi framework Concierge. It will be committed at GitHub to make it public available during development. Test cases which have been developed have been contributed to Concierge project meanwhile.

Eclipse SmartHome running on Concierge

See documentation at https://github.com/JochenHiller/concierge-tests/blob/master/docs/Concierge-EclipseSmartHome.md to see how to run Eclipse SmartHome on Concierge.

Overview of testing framework

The tests are based on these general concepts:

  • Tests are simple JUnit 4 based unit tests
  • The OSGi Concierge framework will be started via Concierge based FrameworkLauncher
  • An AbstractConciergeTestCase base class will provide helping methods for simple testing
    • start/stop the framework
    • install and start bundles
    • check for resolved bundles
    • add support for calling Java code in context of a bundle classloader
  • All used 3rd party bundles will be retrieved from their corresponding repositories in Internet
  • For performance reasons, these bundles will be locally cached
    • The default folder is ./target/localCache
  • The repositories can be configured in file ./test/concierge-test.properties
  • Tests can run within a simple shell for interactive testing
    • just implement the method MyTests.stayInShell() returning true
    • the bundle from ./target/plugins/shell-1.0.0.jar will be used
  • Unit tests will run in an order by specifying @FixMethodOrder(MethodSorters.NAME_ASCENDING) on test classes where required or useful
  • The ConciergeTestSuite in package org.eclipse.concierge.test.suite will run all tests
  • Actually the tests are focused on installation and resolving bundles. In most cases there are no functional tests for checking whether the bundle is really working
  • Specific bundles will be added to ./target/<some-dir> where there are no online bundles available
  • "Synthethic" Bundles can be installed from test case to avoid duplicate code management
    • Manifest file can be specified as properties
    • Files can be added to bundle
    • Code can be executed via reflection in bundle classloader

Overview of Failed Tests

The unit tests showed some bugs in Concierge and some bugs in bundles installed in Concierge due to dependencies, in most cases dependencies to Equinox.

Closed bugs in Concierge

Identified bugs in other bundles

Eclipse Kura running on Concierge

1. How to build Eclipse Kura

See https://github.com/eclipse/kura for details how to build.

// build target platform
git clone -b develop https://github.com/eclipse/kura.git
cd kura/target-platform
mvn clean install
// build kura core
cd ../kura/
mvn -Dmaven.test.skip=true -f manifest_pom.xml clean install
mvn -Dmaven.test.skip=true -f pom_pom.xml -Pweb clean install
mvn -Dmaven.test.skip=true -f pom_pom.xml clean install
2. Unpack distribution file
cd distrib/target
unzip kura-raspberry-pi-jars_0.2.0-SNAPSHOT.zip
3. Add the directory with unpacked files to file test/concierge-test.properties

This will extend the paths to be searched for bundles to lookup into Kura distribution. If we assume that kura is on same directory level as org.eclipse.concierge, this configuration can be added:

concierge.test.localDirectories=\
    ../kura/kura/distrib/target/kura-raspberry-pi-jars_0.2.0-SNAPSHOT/kura/plugins:\
    ../kura/kura/distrib/target/kura-raspberry-pi-jars_0.2.0-SNAPSHOT/plugins:\
    ...

References for Concierge

For more details see

  • Concierge project page: http://projects.eclipse.org/projects/rt.concierge
  • Concierge Git repo: git://git.eclipse.org/gitroot/concierge/org.eclipse.concierge.git
  • Equinox framework repo: git://git.eclipse.org/gitroot/equinox/rt.equinox.framework.git
    • Checkout luna branch
git clone git://git.eclipse.org/gitroot/equinox/rt.equinox.framework.git -b R4_4_maintenance
  • Equinox bundles repo: git://git.eclipse.org/gitroot/equinox/rt.equinox.bundles.git
    • Checkout luna branch
git clone git://git.eclipse.org/gitroot/equinox/rt.equinox.bundles.git -b R4_4_maintenance
  • Eclipse Platform bundles repo: git://git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git
    • Checkout luna branch
git clone git://git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git -b R4_4_maintenance
  • Xtext repo: git://git.eclipse.org/gitroot/tmf/org.eclipse.xtext.git
git clone git://git.eclipse.org/gitroot/tmf/org.eclipse.xtext.git -b v2.6.x_Maintenance

TODO

  • Xtext: Activator, get rid of platform, use OSGi Service tracker instead
  • EMF-Core: Change activator to create Implementation only when Plugin is available. Otherwise make the initialization code from activator protected BundleActivator createBundle() { return new Implementation(); }
  • Add test cases for Xargs with initLevel
  • Download all bundles when remote URL is a p2-repo
  • Add wildcard capability to AbstractConciergeTestCase.installBundle to avoid to specify the version
    • Shall use the latest found version of a bundle
  • Use Xtext online repo (check Hudson builds) ==> ask Xtext where to find repo
  • Provide a way how EMF (and other bundles) can be used from workspace for testing (as requested by Ed Merks)
  • Create bug to EMF to adapt other bundles (like EMF-examples) to do NOT require-bundle to Equinox too

About

Test cases for Eclipse OSGi framework Concierge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published