Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2011-10-28 15:23:19 +0000
committerMartin Fluegge2011-10-28 15:23:19 +0000
commitb0bbe60695ef9e3c8c79797a41de6437a725c869 (patch)
tree025c88f08e1eb6799adb4f177ef5c072a7d259f7
parent098c0bcf95c27d86b2f012777f1cffadd0c5ad8b (diff)
downloadcdo-b0bbe60695ef9e3c8c79797a41de6437a725c869.tar.gz
cdo-b0bbe60695ef9e3c8c79797a41de6437a725c869.tar.xz
cdo-b0bbe60695ef9e3c8c79797a41de6437a725c869.zip
[359992] [Legacy] CDODeltaNotification.getNewValue() returns a
CDOLegacyWrapper instead of the wrapped EObject https://bugs.eclipse.org/bugs/show_bug.cgi?id=359992
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359992_Test.java56
1 files changed, 21 insertions, 35 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359992_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359992_Test.java
index 753ad24e1f..3ed084a515 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359992_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359992_Test.java
@@ -36,6 +36,8 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
+ * Bug 359992.
+ *
* @author Martin Fluegge
*/
public class Bugzilla_359992_Test extends AbstractCDOTest
@@ -53,7 +55,7 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
@Requires(IModelConfig.CAPABILITY_LEGACY)
@CleanRepositoriesBefore
- public void _testInvalidationNotification() throws Exception
+ public void testInvalidationNotification() throws Exception
{
CDOSession session = openSession();
CDOUtil.setLegacyModeDefault(true);
@@ -86,10 +88,7 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
TestAdapter adapter = new TestAdapter();
customer1.eAdapters().add(adapter);
- Thread thread = new Thread(new RemoteClient());
-
- thread.start();
- thread.join();
+ doClient2();
latch.await(10 * DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
assertEquals(true, adapter.notified());
@@ -131,10 +130,7 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
TestAdapter adapter = new TestAdapter();
customer1.eAdapters().add(adapter);
- Thread thread = new Thread(new RemoteClient());
-
- thread.start();
- thread.join();
+ doClient2();
latch.await(10 * DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
assertEquals(true, adapter.notified());
@@ -155,35 +151,25 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
return customer1;
}
- class RemoteClient implements Runnable
+ private void doClient2() throws CommitException
{
- public void run()
- {
- CDOSession session = openSession();
- CDOUtil.setLegacyModeDefault(true);
- CDONet4jSession.Options options = (Options)session.options();
- options.setCommitTimeout(10 * CommitTransactionRequest.DEFAULT_MONITOR_TIMEOUT_SECONDS);
- CDOTransaction transaction2 = session.openTransaction();
+ CDOSession session = openSession();
+ CDOUtil.setLegacyModeDefault(true);
+ CDONet4jSession.Options options = (Options)session.options();
+ options.setCommitTimeout(10 * CommitTransactionRequest.DEFAULT_MONITOR_TIMEOUT_SECONDS);
+ CDOTransaction transaction2 = session.openTransaction();
- Resource resource2 = transaction2.getResource(getResourcePath(RESOURCE_PATH));
- Customer customer2 = (Customer)resource2.getContents().get(1);
+ Resource resource2 = transaction2.getResource(getResourcePath(RESOURCE_PATH));
+ Customer customer2 = (Customer)resource2.getContents().get(1);
- SalesOrder existingSalesOrder = customer2.getSalesOrders().get(0);
- EcoreUtil.delete(existingSalesOrder);
+ SalesOrder existingSalesOrder = customer2.getSalesOrders().get(0);
+ EcoreUtil.delete(existingSalesOrder);
- SalesOrder newSalesOrder = Model1Factory.eINSTANCE.createSalesOrder();
- customer2.getSalesOrders().add(newSalesOrder);
- resource2.getContents().add(newSalesOrder);
+ SalesOrder newSalesOrder = Model1Factory.eINSTANCE.createSalesOrder();
+ customer2.getSalesOrders().add(newSalesOrder);
+ resource2.getContents().add(newSalesOrder);
- try
- {
- transaction2.commit();
- }
- catch (CommitException ex)
- {
- ex.printStackTrace();
- }
- }
+ transaction2.commit();
}
/**
@@ -231,8 +217,9 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
}
}
}
- latch.countDown();
+
notified = true;
+ latch.countDown();
}
}
@@ -251,5 +238,4 @@ public class Bugzilla_359992_Test extends AbstractCDOTest
return failureMessage;
}
}
-
}

Back to the top