Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2009-02-16 10:06:13 +0000
committermkuppe2009-02-16 10:06:13 +0000
commitde3df9a8287a4ff642828fcf0b809925fcb3e462 (patch)
tree1579f3c7a98bd423546b410603b4ee3e0e53f4f3 /providers
parentb37a9beab1fa497171578cc9aa274f2d43a5ca12 (diff)
downloadorg.eclipse.ecf-de3df9a8287a4ff642828fcf0b809925fcb3e462.tar.gz
org.eclipse.ecf-de3df9a8287a4ff642828fcf0b809925fcb3e462.tar.xz
org.eclipse.ecf-de3df9a8287a4ff642828fcf0b809925fcb3e462.zip
RESOLVED - 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/internal/provider/discovery/CompositeServiceContainerEvent.java32
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceTypeContainerEvent.java32
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java10
3 files changed, 69 insertions, 5 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceContainerEvent.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceContainerEvent.java
new file mode 100644
index 000000000..40b00e4bc
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceContainerEvent.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Markus Alexander Kuppe.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Alexander Kuppe (ecf-dev_eclipse.org <at> lemmster <dot> de) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.internal.provider.discovery;
+
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.discovery.IServiceEvent;
+import org.eclipse.ecf.discovery.ServiceContainerEvent;
+
+public class CompositeServiceContainerEvent extends ServiceContainerEvent implements IServiceEvent {
+
+ private ID origId;
+
+ public CompositeServiceContainerEvent(IServiceEvent event, ID connectedId) {
+ super(event.getServiceInfo(), connectedId);
+ origId = event.getLocalContainerID();
+ }
+
+ /**
+ * @return the origId
+ */
+ public ID getOriginalLocalContainerID() {
+ return origId;
+ }
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceTypeContainerEvent.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceTypeContainerEvent.java
new file mode 100644
index 000000000..3824a2f97
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeServiceTypeContainerEvent.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Markus Alexander Kuppe.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Alexander Kuppe (ecf-dev_eclipse.org <at> lemmster <dot> de) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.internal.provider.discovery;
+
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.discovery.IServiceTypeEvent;
+import org.eclipse.ecf.discovery.ServiceTypeContainerEvent;
+
+public class CompositeServiceTypeContainerEvent extends ServiceTypeContainerEvent implements IServiceTypeEvent {
+
+ private ID origLocalContainerId;
+
+ public CompositeServiceTypeContainerEvent(IServiceTypeEvent event, ID connectedId) {
+ super(event.getServiceTypeID(), connectedId);
+ origLocalContainerId = event.getLocalContainerID();
+ }
+
+ /**
+ * @return the origLocalContainerId
+ */
+ public ID getOrigLocalContainerId() {
+ return origLocalContainerId;
+ }
+}
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 aaee4d4d5..d0d5c19fc 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,8 +38,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
if (!col.isEmpty()) {
for (Iterator itr = col.iterator(); itr.hasNext();) {
IServiceListener isl = (IServiceListener) itr.next();
- // we want to pretend the discovery event comes from us, thus we change the connectedid
- isl.serviceDiscovered(new ServiceContainerEvent(event.getServiceInfo(), getConnectedID()));
+ // we want to pretend the discovery event comes from us, thus we change the connectedId
+ isl.serviceDiscovered(new CompositeServiceContainerEvent(event, 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$
@@ -58,8 +58,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
if (!col.isEmpty()) {
for (Iterator itr = col.iterator(); itr.hasNext();) {
IServiceListener isl = (IServiceListener) itr.next();
- // we want to pretend the discovery event comes from us, thus we change the connectedid
- isl.serviceUndiscovered(new ServiceContainerEvent(event.getServiceInfo(), getConnectedID()));
+ // we want to pretend the discovery event comes from us, thus we change the connectedId
+ isl.serviceUndiscovered(new CompositeServiceContainerEvent(event, 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$
@@ -83,7 +83,7 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
for (Iterator itr = serviceTypeListeners.iterator(); itr.hasNext();) {
IServiceTypeListener listener = (IServiceTypeListener) itr.next();
// we want to pretend the discovery event comes from us, thus we change the connectedId
- listener.serviceTypeDiscovered(new ServiceTypeContainerEvent(event.getServiceTypeID(), getConnectedID()));
+ listener.serviceTypeDiscovered(new CompositeServiceTypeContainerEvent(event, 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$

Back to the top