Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 170958 Details for
Bug 306710
IndexOutOfBoundsException upon invalidation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated TestCase
TestBugzilla306710Patch.txt (text/plain), 3.06 KB, created by
Pascal Lehmann
on 2010-06-03 10:01:16 EDT
(
hide
)
Description:
Updated TestCase
Filename:
MIME Type:
Creator:
Pascal Lehmann
Created:
2010-06-03 10:01:16 EDT
Size:
3.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo.tests >Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_306710_Test.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_306710_Test.java,v >retrieving revision 1.1 >diff -u -r1.1 Bugzilla_306710_Test.java >--- src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_306710_Test.java 7 May 2010 09:06:12 -0000 1.1 >+++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_306710_Test.java 3 Jun 2010 13:54:29 -0000 >@@ -28,7 +28,7 @@ > */ > public class Bugzilla_306710_Test extends AbstractCDOTest > { >- public void testBugzilla_306710() throws Exception >+ public void testBugzilla_306710_remove() throws Exception > { > final NotifyCounter counter = new NotifyCounter(); > >@@ -91,6 +91,67 @@ > assertEquals(1, counter.getRemoves()); > } > >+ public void testBugzilla_306710_addRemove() throws Exception >+ { >+ final NotifyCounter counter = new NotifyCounter(); >+ >+ // setup connection1. >+ CDOSession session1 = openSession(); >+ CDOTransaction transaction1 = session1.openTransaction(); >+ CDOResource resource1 = transaction1.createResource("/test1"); >+ >+ // add initial model. >+ Company company1 = getModel1Factory().createCompany(); >+ resource1.getContents().add(company1); >+ transaction1.commit(); >+ >+ Thread.sleep(100); >+ >+ // setup connection2. >+ CDOSession session2 = openSession(); >+ CDOTransaction transaction2 = session2.openTransaction(); >+ transaction2.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); >+ CDOResource resource2 = transaction2.getOrCreateResource("/test1"); >+ >+ // add adapter to company2 to have sendDeltaNotification being called. >+ Company company2 = (Company)resource2.getContents().get(0); >+ company2.eAdapters().add(new AdapterImpl() >+ { >+ @Override >+ public void notifyChanged(Notification msg) >+ { >+ if (msg.getEventType() == Notification.ADD) >+ { >+ counter.incAdds(); >+ } >+ else if (msg.getEventType() == Notification.REMOVE) >+ { >+ counter.incRemoves(); >+ } >+ } >+ }); >+ >+ // add and remove an object from category list of company to have the CDONotificationBuilder call remove with an >+ // index not known to the oldRevision. >+ Category category1a = getModel1Factory().createCategory(); >+ company1.getCategories().add(0, category1a); >+ company1.getCategories().remove(0); >+ >+ // commit the changes. >+ transaction1.commit(); >+ >+ // wait for the invalidation to arrive on transaction2. >+ Thread.sleep(1000); >+ >+ // cleanup. >+ session1.close(); >+ session2.close(); >+ >+ // check if the notifications arrived (which is not the case because of the exception). >+ assertEquals(1, counter.getAdds()); >+ assertEquals(1, counter.getRemoves()); >+ } >+ > /** > * Helper class to count the notifications. > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 306710
:
165282
|
167345
|
170330
|
170332
|
170958
|
171709