Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-03-17 03:06:02 -0400
committerslewis2009-03-17 03:06:02 -0400
commitb1633de7b2739770b01e5214a589f0a43b4a6688 (patch)
tree06d96224fc3a32f3b1a316c209684236aa8b4536 /tests/bundles/org.eclipse.ecf.tests.sharedobject
parentbb8c19dd645b6022ffb9554f6efbe6127c382b1e (diff)
downloadorg.eclipse.ecf-b1633de7b2739770b01e5214a589f0a43b4a6688.tar.gz
org.eclipse.ecf-b1633de7b2739770b01e5214a589f0a43b4a6688.tar.xz
org.eclipse.ecf-b1633de7b2739770b01e5214a589f0a43b4a6688.zip
Fixes for test code problems in AddTest and TestSharedObject
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.sharedobject')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/AddTest.java28
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/TestSharedObject.java6
2 files changed, 3 insertions, 31 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/AddTest.java b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/AddTest.java
index 139a5fd23..bb2d62975 100755
--- a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/AddTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/AddTest.java
@@ -36,7 +36,7 @@ public class AddTest extends ContainerAbstractTestCase {
* @see org.eclipse.ecf.tests.ContainerAbstractTestCase#getClientCount()
*/
protected int getClientCount() {
- return 2;
+ return 1;
}
/*
@@ -76,17 +76,6 @@ public class AddTest extends ContainerAbstractTestCase {
final ISharedObject sharedObject = manager.getSharedObject(id);
assertNotNull(sharedObject);
sleep(3000);
- for (int clientIndex = 0; clientIndex < getClientCount(); clientIndex++) {
- socontainer = (ISharedObjectContainer) getClient(clientIndex)
- .getAdapter(ISharedObjectContainer.class);
- ISharedObject sharedObj = socontainer.getSharedObjectManager()
- .getSharedObject(
- IDFactory.getDefault().createStringID("foo"));
- if (sharedObj != null) {
- System.out.println("foo instance=" + sharedObj.toString());
- }
- }
-
}
public void testAddTwoSharedObjects() throws Exception {
@@ -110,21 +99,6 @@ public class AddTest extends ContainerAbstractTestCase {
final ISharedObject sharedObject1 = manager.getSharedObject(id1);
assertNotNull(sharedObject1);
sleep(3000);
- for (int clientIndex = 0; clientIndex < getClientCount(); clientIndex++) {
- socontainer = (ISharedObjectContainer) getClient(clientIndex)
- .getAdapter(ISharedObjectContainer.class);
- ISharedObject sharedObj = socontainer.getSharedObjectManager()
- .getSharedObject(
- IDFactory.getDefault().createStringID("foo0"));
- if (sharedObj != null) {
- System.out.println("foo0 instance=" + sharedObj.toString());
- }
- sharedObj = socontainer.getSharedObjectManager().getSharedObject(
- IDFactory.getDefault().createStringID("foo1"));
- if (sharedObj != null) {
- System.out.println("foo1 instance=" + sharedObj.toString());
- }
- }
}
}
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/TestSharedObject.java b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/TestSharedObject.java
index 200c0992e..f008e25b2 100755
--- a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/TestSharedObject.java
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/TestSharedObject.java
@@ -59,10 +59,8 @@ public class TestSharedObject extends BaseSharedObject {
addEventProcessor(new IEventProcessor() {
public boolean processEvent(Event event) {
if (event instanceof ISharedObjectActivatedEvent) {
- // If we've been activated, are primary and are connected
- // then replicate to all remotes
- // This calls the getReplicaDescription method below
- if (isPrimary() && isConnected()) {
+ ISharedObjectActivatedEvent ae = (ISharedObjectActivatedEvent) event;
+ if (ae.getActivatedID().equals(getID()) && isConnected()) {
TestSharedObject.this.replicateToRemoteContainers(null);
}
}

Back to the top