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 170488 Details for
Bug 315026
Local rollback inadvertently brings in updates from other sessions
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]
Testcase (as a patch)
testcase-for-3.0.txt (text/plain), 4.50 KB, created by
Caspar D.
on 2010-05-31 02:09:00 EDT
(
hide
)
Description:
Testcase (as a patch)
Filename:
MIME Type:
Creator:
Caspar D.
Created:
2010-05-31 02:09:00 EDT
Size:
4.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo.tests >Index: src/org/eclipse/emf/cdo/tests/AllConfigs.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java,v >retrieving revision 1.2 >diff -u -r1.2 AllConfigs.java >--- src/org/eclipse/emf/cdo/tests/AllConfigs.java 27 May 2010 13:44:07 -0000 1.2 >+++ src/org/eclipse/emf/cdo/tests/AllConfigs.java 31 May 2010 06:07:54 -0000 >@@ -72,6 +72,7 @@ > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_306998_Test; > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_308895_Test; > import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_314264_Test; >+import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_315026_Test; > import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; > import org.eclipse.emf.cdo.tests.config.impl.ConfigTestSuite; > >@@ -205,6 +206,7 @@ > testClasses.add(Bugzilla_306998_Test.class); > testClasses.add(Bugzilla_308895_Test.class); > testClasses.add(Bugzilla_314264_Test.class); >+ testClasses.add(Bugzilla_315026_Test.class); > > // TODO testClasses.add(NonCDOResourceTest.class); > // TODO testClasses.add(GeneratedEcoreTest.class); >Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_315026_Test.java >=================================================================== >RCS file: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_315026_Test.java >diff -N src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_315026_Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_315026_Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,86 @@ >+package org.eclipse.emf.cdo.tests.bugzilla; >+ >+import org.eclipse.emf.cdo.eresource.CDOResource; >+import org.eclipse.emf.cdo.session.CDOSession; >+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager; >+import org.eclipse.emf.cdo.tests.AbstractCDOTest; >+import org.eclipse.emf.cdo.tests.model1.Company; >+import org.eclipse.emf.cdo.tests.model1.Model1Factory; >+import org.eclipse.emf.cdo.transaction.CDOTransaction; >+import org.eclipse.emf.cdo.util.CommitException; >+ >+/** >+ * Copyright (c) 2004 - 2010 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: >+ * Caspar De Groot - initial API and implementation >+ */ >+ >+/** >+ * Bugzilla 315026 - Local rollback inadvertently brings in updates from other sessions >+ * >+ * @author Caspar De Groot >+ */ >+public class Bugzilla_315026_Test extends AbstractCDOTest >+{ >+ private final static String ORIGINAL_NAME = "AAA"; >+ >+ private final static String DIRTY_NAME = "BBB"; >+ >+ private final static String OTHER_NAME = "CCC"; >+ >+ public void test() throws Exception >+ { >+ CDOSession session = openSession(); >+ session.options().setPassiveUpdateEnabled(false); >+ CDOTransaction tx = session.openTransaction(); >+ CDOResource r1 = tx.createResource("/r1"); //$NON-NLS-1$ >+ >+ // Create clean content >+ Company company = Model1Factory.eINSTANCE.createCompany(); >+ company.setName(ORIGINAL_NAME); >+ r1.getContents().add(company); >+ tx.commit(); >+ >+ // Make it dirty in this session >+ company.setName(DIRTY_NAME); >+ >+ // Update and commit in another session >+ doSecondSession(); >+ >+ // Rollback this session >+ tx.rollback(); >+ assertProxy(company); >+ >+ // Clear this session's revision cache >+ ((InternalCDORevisionManager)session.getRevisionManager()).getCache().clear(); >+ >+ // Verify that value in this session does *not* match value assigned in 2nd session >+ String name = company.getName(); >+ assertFalse("Should not have the value committed by the other session", OTHER_NAME.equals(name)); >+ >+ // Verify that value in this session still matches value assigned in this session >+ assertEquals("Should have the value originally loaded in this session", ORIGINAL_NAME, name); >+ >+ tx.close(); >+ session.close(); >+ } >+ >+ private void doSecondSession() throws CommitException >+ { >+ CDOSession session = openSession(); >+ CDOTransaction tx = session.openTransaction(); >+ CDOResource r1 = tx.getResource("/r1"); //$NON-NLS-1$ >+ >+ Company company = (Company)r1.getContents().get(0); >+ company.setName(OTHER_NAME); >+ tx.commit(); >+ >+ tx.close(); >+ session.close(); >+ } >+}
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 315026
: 170488