Open bjhargrave opened 13 years ago
Comment author: @bjhargrave
EEG agreed that this is a CT deviation.
A compliant implementation can fail org.osgi.test.cases.remoteserviceadmin.junit.RemoteServiceAdminTest.testExportImportManually() for the assert expecting the event property "bundle" is equal to the bundle registering the imported service.
+++ This bug was initially created as a clone of Bug BZ#1985 +++
From Scott Lewis <slewis@ composent.com>:
In the Remote Service Admin specification (chapter 122 in enterprise spec), in section 122.7.1 it says that that the 'bundle' property of the RemoteServiceAdminEvent should be set to the 'Remote Service Admin' bundle:
The Event Admin event must have the following properties: • bundle – (Bundle) The Remote Service Admin bundle
In the RSA CT, the test method org.osgi.test.cases.remoteserviceadmin.junit.RemoteServiceAdminTest.testExportImportManually()
has the following assert:
assertEquals(sref.getBundle(), event.getProperty("bundle"));
'sref' is a ServiceReference instance for the RSA-created proxy, and 'event' is a RemoteServiceAdminEvent (sent from our RSA implementation).
In ECF's implementation, we use a ServiceFactory to create a proxy, and as per a discussion on osgi-dev, use an 'extender' bundle that registers this service factory. See discussion of 'extender' usage here:
https://mail.osgi.org/pipermail/osgi-dev/2011-February/003001.html
So in the case of ECF's implementation, since we register the proxy ServiceFactory with the extender bundle, the sref.getBundle() call in the test returns the extender bundle (in our case: org.eclipse.ecf.osgi.service.remoteserviceadmin.proxy), and the event.getProperty("bundle") return the RSA bundle (as per the specification), and the assert fails. We are not clear on what the right solution is to this...
e.g. change in specification (RSA extender as event.getProperty("bundle")), or change in TCK behavior (e.g. rsaRef.getBundle() rather than sref.getBundle()). Each seem reasonable to us.
Original bug ID: BZ#2022 From: @bjhargrave Reported version: R4 V4.2
Depends on: BZ#1985