[
https://jira.jboss.org/browse/JBOSGI-381?page=com.atlassian.jira.plugin.s...
]
David Bosschaert updated JBOSGI-381:
------------------------------------
Description:
Sometimes you need to wait until something has happened on the remote side, for instance
you want all packages refreshed and need to wait for that until you can proceed with a
test.
This is currently not possible and it causes
OSGi287TestCase.testResolvedOptionalImportReverse() to fail in the remote scenario which
is caused by interaction with the other tests in that class. Most likely this could be
fixed by being able to execute a remote PackageAdmin.refreshPackages() and wait for that.
I think that a remote refresh packages for all bundles can be initiated like this:
{{ OSGiBundle[] bundles = runtime.getBundles();
long[] ids = new long[bundles.length];
for (int i = 0; i < bundles.length; i++)
ids[i] = bundles[i].getBundleId();
FrameworkMBean fmb = runtime.getFrameworkMBean();
fmb.refreshBundles(ids);}}
but its not possible to wait for the PACKAGES_REFRESHED framework event so you never know
when it will be finished.
I think a remote event callback API is probably not possible via JMX, but an alternative
could be a polling API that allows the test to probe the events emitted.
was:
Sometimes you need to wait until something has happened on the remote side, for instance
you want all packages refreshed and need to wait for that until you can proceed with a
test.
This is currently not possible and it causes
OSGi287TestCase.testResolvedOptionalImportReverse() to fail in the remote scenario which
is caused by interaction with the other tests in that class. Most likely this could be
fixed by being able to execute a remote PackageAdmin.refreshPackages() and wait for that.
I think that a remote refresh packages for all bundles can be initiated like this:
{code} OSGiBundle[] bundles = runtime.getBundles();
long[] ids = new long[bundles.length];
for (int i = 0; i < bundles.length; i++)
ids[i] = bundles[i].getBundleId();
FrameworkMBean fmb = runtime.getFrameworkMBean();
fmb.refreshBundles(ids);{code}
but its not possible to wait for the PACKAGES_REFRESHED framework event so you never know
when it will be finished.
I think a remote event callback API is probably not possible via JMX, but an alternative
could be a polling API that allows the test to probe the events emitted.
Remote tests: Make it possible to listen to remote framework events
-------------------------------------------------------------------
Key: JBOSGI-381
URL:
https://jira.jboss.org/browse/JBOSGI-381
Project: JBoss OSGi
Issue Type: Task
Security Level: Public(Everyone can see)
Components: jboss-osgi-spi
Reporter: David Bosschaert
Sometimes you need to wait until something has happened on the remote side, for instance
you want all packages refreshed and need to wait for that until you can proceed with a
test.
This is currently not possible and it causes
OSGi287TestCase.testResolvedOptionalImportReverse() to fail in the remote scenario which
is caused by interaction with the other tests in that class. Most likely this could be
fixed by being able to execute a remote PackageAdmin.refreshPackages() and wait for that.
I think that a remote refresh packages for all bundles can be initiated like this:
{{ OSGiBundle[] bundles = runtime.getBundles();
long[] ids = new long[bundles.length];
for (int i = 0; i < bundles.length; i++)
ids[i] = bundles[i].getBundleId();
FrameworkMBean fmb = runtime.getFrameworkMBean();
fmb.refreshBundles(ids);}}
but its not possible to wait for the PACKAGES_REFRESHED framework event so you never know
when it will be finished.
I think a remote event callback API is probably not possible via JMX, but an alternative
could be a polling API that allows the test to probe the events emitted.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira