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 128849 Details for
Bug 267050
Add new packages infos in the Notifications process at the client side
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]
Patch v2
patch.txt (text/plain), 15.79 KB, created by
Eike Stepper
on 2009-03-15 14:30:16 EDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
Eike Stepper
Created:
2009-03-15 14:30:16 EDT
Size:
15.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo.tests >Index: src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java,v >retrieving revision 1.39 >diff -u -r1.39 AllTestsAllConfigs.java >--- src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java 23 Feb 2009 09:14:53 -0000 1.39 >+++ src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java 15 Mar 2009 18:27:33 -0000 >@@ -41,6 +41,7 @@ > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_260764_Test; > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_261218_Test; > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_265114_Test; >+import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_267050_Test; > import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; > import org.eclipse.emf.cdo.tests.config.impl.ConfigTestSuite; > >@@ -128,6 +129,7 @@ > testClasses.add(Bugzilla_260764_Test.class); > testClasses.add(Bugzilla_261218_Test.class); > testClasses.add(Bugzilla_265114_Test.class); >+ testClasses.add(Bugzilla_267050_Test.class); > > // TODO testClasses.add(NonCDOResourceTest.class); > // TODO testClasses.add(GeneratedEcoreTest.class); >Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_267050_Test.java >=================================================================== >RCS file: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_267050_Test.java >diff -N src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_267050_Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_267050_Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,76 @@ >+/** >+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. >+ * 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: >+ * Simon McDuff - initial API and implementation >+ */ >+package org.eclipse.emf.cdo.tests.bugzilla; >+ >+import org.eclipse.emf.cdo.common.model.CDOPackageUnit; >+import org.eclipse.emf.cdo.eresource.CDOResource; >+import org.eclipse.emf.cdo.session.CDOSession; >+import org.eclipse.emf.cdo.session.CDOSessionInvalidationEvent; >+import org.eclipse.emf.cdo.tests.AbstractCDOTest; >+import org.eclipse.emf.cdo.tests.model1.Company; >+import org.eclipse.emf.cdo.transaction.CDOTransaction; >+ >+import org.eclipse.net4j.util.event.IEvent; >+import org.eclipse.net4j.util.event.IListener; >+ >+import java.util.Collection; >+ >+/** >+ * Add new packages infos in the Notifications process at the client side >+ * >+ * @see https://bugs.eclipse.org/267050 >+ * @author Simon McDuff >+ */ >+public class Bugzilla_267050_Test extends AbstractCDOTest >+{ >+ @SuppressWarnings("unchecked") >+ public void testBugzilla_267050() throws InterruptedException >+ { >+ final Collection<CDOPackageUnit> newPackagesUnits[] = new Collection[1]; >+ CDOSession session = openSession(); >+ CDOTransaction transaction = session.openTransaction(); >+ >+ CDOSession session2 = openSession(); >+ session2.addListener(new IListener() >+ { >+ public void notifyEvent(IEvent event) >+ { >+ if (event instanceof CDOSessionInvalidationEvent) >+ { >+ CDOSessionInvalidationEvent e = (CDOSessionInvalidationEvent)event; >+ newPackagesUnits[0] = e.getNewPackageUnits(); >+ } >+ } >+ }); >+ >+ session.getPackageRegistry().putEPackage(getModel1Package()); >+ >+ CDOResource res = transaction.createResource("/res"); >+ Company specialPurchaseOrder = getModel1Factory().createCompany(); >+ res.getContents().add(specialPurchaseOrder); >+ transaction.commit(); >+ >+ boolean timedOut = new PollingTimeOuter(10, 100) >+ { >+ @Override >+ protected boolean successful() >+ { >+ return newPackagesUnits[0] != null; >+ } >+ }.timedOut(); >+ >+ assertEquals(false, timedOut); >+ >+ assertEquals(1, newPackagesUnits[0].size()); >+ assertEquals(getModel1Package().getNsURI(), newPackagesUnits[0].iterator().next().getTopLevelPackageInfo() >+ .getPackageURI()); >+ } >+} >#P org.eclipse.emf.cdo >Index: src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java,v >retrieving revision 1.6 >diff -u -r1.6 CDOSessionImpl.java >--- src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java 14 Mar 2009 11:07:30 -0000 1.6 >+++ src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java 15 Mar 2009 18:27:35 -0000 >@@ -385,24 +385,27 @@ > /** > * @since 2.0 > */ >- public void handleSyncResponse(long timestamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) >+ public void handleSyncResponse(long timestamp, Collection<CDOPackageUnit> newPackageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) > { >- handleCommitNotification(timestamp, dirtyOIDs, detachedObjects, null, null, true, false); >+ handleCommitNotification(timestamp, newPackageUnits, dirtyOIDs, detachedObjects, null, null, true, false); > } > > /** > * @since 2.0 > */ >- public void handleCommitNotification(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, >- final Collection<CDOID> detachedObjects, final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView) >+ public void handleCommitNotification(final long timeStamp, final Collection<CDOPackageUnit> newPackageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, final Collection<CDOID> detachedObjects, >+ final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView) > { >- handleCommitNotification(timeStamp, dirtyOIDs, detachedObjects, deltas, excludedView, options() >+ handleCommitNotification(timeStamp, newPackageUnits, dirtyOIDs, detachedObjects, deltas, excludedView, options() > .isPassiveUpdateEnabled(), true); > } > >- private void handleCommitNotification(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, >- final Collection<CDOID> detachedObjects, final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView, >- final boolean passiveUpdate, boolean async) >+ private void handleCommitNotification(final long timeStamp, final Collection<CDOPackageUnit> newPackageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, final Collection<CDOID> detachedObjects, >+ final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView, final boolean passiveUpdate, >+ boolean async) > { > if (passiveUpdate) > { >@@ -459,7 +462,7 @@ > } > } > >- fireInvalidationEvent(timeStamp, dirtyOIDs, detachedObjects, excludedView); >+ fireInvalidationEvent(timeStamp, newPackageUnits, dirtyOIDs, detachedObjects, excludedView); > } > > private void updateRevisionForRemoteChanges(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, >@@ -514,12 +517,13 @@ > } > > /** >+ * @param packageUnits > * @since 2.0 > */ >- public void fireInvalidationEvent(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, >- InternalCDOView excludedView) >+ public void fireInvalidationEvent(long timeStamp, Collection<CDOPackageUnit> packageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, InternalCDOView excludedView) > { >- fireEvent(new InvalidationEvent(excludedView, timeStamp, dirtyOIDs, detachedObjects)); >+ fireEvent(new InvalidationEvent(excludedView, timeStamp, packageUnits, dirtyOIDs, detachedObjects)); > } > > @Override >@@ -1090,12 +1094,15 @@ > > private Collection<CDOID> detachedObjects; > >- public InvalidationEvent(InternalCDOView view, long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, >- Collection<CDOID> detachedObjects) >+ private Collection<CDOPackageUnit> newPackageUnits; >+ >+ public InvalidationEvent(InternalCDOView view, long timeStamp, Collection<CDOPackageUnit> packageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) > { > super(CDOSessionImpl.this); > this.view = view; > this.timeStamp = timeStamp; >+ newPackageUnits = packageUnits; > this.dirtyOIDs = dirtyOIDs; > this.detachedObjects = detachedObjects; > } >@@ -1125,6 +1132,11 @@ > return detachedObjects; > } > >+ public Collection<CDOPackageUnit> getNewPackageUnits() >+ { >+ return newPackageUnits; >+ } >+ > @Override > public String toString() > { >Index: src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java,v >retrieving revision 1.4 >diff -u -r1.4 SyncRevisionsRequest.java >--- src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java 14 Mar 2009 11:07:28 -0000 1.4 >+++ src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java 15 Mar 2009 18:27:34 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.emf.cdo.common.id.CDOIDUtil; > import org.eclipse.emf.cdo.common.io.CDODataInput; > import org.eclipse.emf.cdo.common.io.CDODataOutput; >+import org.eclipse.emf.cdo.common.model.CDOPackageUnit; > import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; > import org.eclipse.emf.cdo.common.revision.CDORevision; > import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; >@@ -113,7 +114,8 @@ > Collection<CDOID> detachedObjects = getMap(mapofContext, revised).getDetachedObjects(); > detachedObjects.add(id); > } >- >+ >+ Collection<CDOPackageUnit> emptyNewPackageUnits = Collections.emptyList(); > for (CDOTimeStampContext timestampContext : mapofContext.values()) > { > Set<CDOIDAndVersion> dirtyObjects = timestampContext.getDirtyObjects(); >@@ -125,7 +127,7 @@ > ((CDOTimeStampContextImpl)timestampContext).setDirtyObjects(dirtyObjects); > ((CDOTimeStampContextImpl)timestampContext).setDetachedObjects(detachedObjects); > >- getSession().handleSyncResponse(timestampContext.getTimeStamp(), dirtyObjects, detachedObjects); >+ getSession().handleSyncResponse(timestampContext.getTimeStamp(), emptyNewPackageUnits, dirtyObjects, detachedObjects); > } > > return Collections.unmodifiableCollection(mapofContext.values()); >Index: src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java,v >retrieving revision 1.4 >diff -u -r1.4 CommitNotificationIndication.java >--- src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java 14 Mar 2009 11:07:29 -0000 1.4 >+++ src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java 15 Mar 2009 18:27:34 -0000 >@@ -28,6 +28,7 @@ > > import java.io.IOException; > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.HashSet; > import java.util.List; > import java.util.Set; >@@ -104,6 +105,6 @@ > detachedObjects.add(in.readCDOID()); > } > >- session.handleCommitNotification(timeStamp, dirtyOIDs, detachedObjects, deltas, null); >+ session.handleCommitNotification(timeStamp, Arrays.asList(packageUnits), dirtyOIDs, detachedObjects, deltas, null); > } > } >Index: src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java,v >retrieving revision 1.6 >diff -u -r1.6 CDOTransactionImpl.java >--- src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java 14 Mar 2009 11:07:29 -0000 1.6 >+++ src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java 15 Mar 2009 18:27:35 -0000 >@@ -1305,7 +1305,8 @@ > ((InternalCDORevisionDelta)dirtyObjectDelta).adjustReferences(result.getReferenceAdjuster()); > } > >- session.handleCommitNotification(timeStamp, dirtyIDs, detachedIDs, deltasCopy, getTransaction()); >+ session.handleCommitNotification(timeStamp, newPackageUnits, dirtyIDs, detachedIDs, deltasCopy, >+ getTransaction()); > } > > lastCommitTime = timeStamp; >Index: src/org/eclipse/emf/spi/cdo/InternalCDOSession.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java,v >retrieving revision 1.5 >diff -u -r1.5 InternalCDOSession.java >--- src/org/eclipse/emf/spi/cdo/InternalCDOSession.java 14 Mar 2009 11:07:28 -0000 1.5 >+++ src/org/eclipse/emf/spi/cdo/InternalCDOSession.java 15 Mar 2009 18:27:35 -0000 >@@ -14,6 +14,7 @@ > import org.eclipse.emf.cdo.common.id.CDOIDAndVersion; > import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; > import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; >+import org.eclipse.emf.cdo.common.model.CDOPackageUnit; > import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; > import org.eclipse.emf.cdo.session.CDOSession; > import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; >@@ -38,8 +39,10 @@ > > public void viewDetached(InternalCDOView view); > >- public void handleCommitNotification(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, >- Collection<CDOID> detachedObjects, Collection<CDORevisionDelta> deltas, InternalCDOView excludedView); >+ public void handleCommitNotification(long timeStamp, Collection<CDOPackageUnit> newPackageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, Collection<CDORevisionDelta> deltas, >+ InternalCDOView excludedView); > >- public void handleSyncResponse(long timestamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects); >+ public void handleSyncResponse(long timestamp, Collection<CDOPackageUnit> newPackageUnits, >+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects); > } >Index: src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java,v >retrieving revision 1.4 >diff -u -r1.4 CDOSessionInvalidationEvent.java >--- src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java 13 Jan 2009 12:14:21 -0000 1.4 >+++ src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java 15 Mar 2009 18:27:34 -0000 >@@ -14,6 +14,7 @@ > import org.eclipse.emf.cdo.CDOInvalidationNotification; > import org.eclipse.emf.cdo.common.id.CDOID; > import org.eclipse.emf.cdo.common.id.CDOIDAndVersion; >+import org.eclipse.emf.cdo.common.model.CDOPackageUnit; > import org.eclipse.emf.cdo.common.revision.CDORevision; > import org.eclipse.emf.cdo.view.CDOAdapterPolicy; > import org.eclipse.emf.cdo.view.CDOView; >@@ -58,4 +59,10 @@ > * Returns a collection of the {@link CDOID CDOIDs} of the removed objects. > */ > public Collection<CDOID> getDetachedObjects(); >+ >+ /** >+ * Returns a collection of the new {@link CDOPackageUnit package units}. >+ */ >+ public Collection<CDOPackageUnit> getNewPackageUnits(); >+ > }
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 267050
:
128844
|
128845
|
128849