Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2009-02-16 08:50:37 +0000
committermkuppe2009-02-16 08:50:37 +0000
commit3dde7ffeeeb48854a04450a732837b665c87a962 (patch)
treefa2d0e0b0fbfc237bfad2cb76d9ac1ae78b1c023 /providers
parent3fa26db145a504a1fc3d58ceffcae5e133123a8c (diff)
downloadorg.eclipse.ecf-3dde7ffeeeb48854a04450a732837b665c87a962.tar.gz
org.eclipse.ecf-3dde7ffeeeb48854a04450a732837b665c87a962.tar.xz
org.eclipse.ecf-3dde7ffeeeb48854a04450a732837b665c87a962.zip
NEW - bug 264983: [Discovery][Composite] junit.framework.AssertionFailedError: Container mismatch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=264983
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
index e193ade42..4dbb6a89f 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
@@ -38,7 +38,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
if (!col.isEmpty()) {
for (Iterator itr = col.iterator(); itr.hasNext();) {
IServiceListener isl = (IServiceListener) itr.next();
- isl.serviceDiscovered(event);
+ // we want to pretend the discovery event comes from us, thus we change the connectedid
+ isl.serviceDiscovered(new ServiceContainerEvent(event.getServiceInfo(), getConnectedID()));
Trace.trace(Activator.PLUGIN_ID, METHODS_TRACING, this.getClass(), "serviceDiscovered", //$NON-NLS-1$
"serviceResolved fired for listener " //$NON-NLS-1$
+ isl.toString() + " with event: " + event.toString()); //$NON-NLS-1$
@@ -57,7 +58,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
if (!col.isEmpty()) {
for (Iterator itr = col.iterator(); itr.hasNext();) {
IServiceListener isl = (IServiceListener) itr.next();
- isl.serviceUndiscovered(event);
+ // we want to pretend the discovery event comes from us, thus we change the connectedid
+ isl.serviceUndiscovered(new ServiceContainerEvent(event.getServiceInfo(), getConnectedID()));
Trace.trace(Activator.PLUGIN_ID, METHODS_TRACING, this.getClass(), "serviceUndiscovered", //$NON-NLS-1$
"serviceRemoved fired for listener " //$NON-NLS-1$
+ isl.toString() + " with event: " + event.toString()); //$NON-NLS-1$
@@ -80,7 +82,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
synchronized (serviceTypeListeners) {
for (Iterator itr = serviceTypeListeners.iterator(); itr.hasNext();) {
IServiceTypeListener listener = (IServiceTypeListener) itr.next();
- listener.serviceTypeDiscovered(event);
+ // we want to pretend the discovery event comes from us, thus we change the connectedId
+ listener.serviceTypeDiscovered(new ServiceTypeContainerEvent(event.getServiceTypeID(), getConnectedID()));
Trace.trace(Activator.PLUGIN_ID, METHODS_TRACING, this.getClass(), "serviceTypeDiscovered", //$NON-NLS-1$
"serviceTypeDiscovered fired for listener " //$NON-NLS-1$
+ listener.toString() + " with event: " + event.toString()); //$NON-NLS-1$
@@ -193,7 +196,7 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
private IServiceID getServiceIDForDiscoveryContainer(IServiceID service, IDiscoveryContainerAdapter dca) {
Namespace connectNamespace = dca.getServicesNamespace();
if (!connectNamespace.equals(service.getNamespace())) {
- return ServiceIDFactory.getDefault().createServiceID(connectNamespace, service.getServiceTypeID().getName(), service.getName());
+ return ServiceIDFactory.getDefault().createServiceID(connectNamespace, service.getServiceTypeID().getName(), service.getServiceName());
}
return service;
}

Back to the top