Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error when no bundle context is available #504

Merged
merged 2 commits into from
Mar 29, 2022

Conversation

bjhargrave
Copy link
Member

We add a new common method to obtain the BundleContext for a test class.
If the class is not in a bundle or the bundle is not started, the
method will now throw an exception with the appropriate message.

A test class must be in a bundle loaded by an OSGi framework and that
bundle must be started (lazy activation is OK since the test runner
must have loaded the test class which would complete activation).

Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
We add a new common method to obtain the BundleContext for a test class.
If the class is not in a bundle or the bundle is not started, the
method will now throw an exception with the appropriate message.

A test class must be in a bundle loaded by an OSGi framework and that
bundle must be started (lazy activation is OK since the test runner
must have loaded the test class which would complete activation).

Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
@bjhargrave bjhargrave merged commit c70f2c8 into osgi:main Mar 29, 2022
@bjhargrave bjhargrave deleted the no-bundle-context branch March 29, 2022 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant