diff options
4 files changed, 65 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllTests.java index d8c894b17e..cf250fcd48 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllTests.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllTests.java @@ -31,6 +31,7 @@ public class AllTests suite.addTestSuite(BidiReferencesTest.class); suite.addTestSuite(Bugzilla154389Test.class); suite.addTestSuite(Bugzilla155899Test.class); + suite.addTestSuite(Bugzilla162017Test.class); return suite; } } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java index ef34403810..e6ed88f42b 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java @@ -29,8 +29,6 @@ import testmodel1.TreeNode; * * So, it looks like the client and server don't match here. * - * Both client and server are current with CVS as of today. - * * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389 */ public class Bugzilla154389Test extends AbstractModel1Test diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162017Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162017Test.java new file mode 100644 index 0000000000..4c5f5252fa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162017Test.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.tests.model1; + + +import testmodel1.ExtendedNode; + + +/** + * transmit object change using incorrect EClass for attributes. + * + * When an attribute is changed in an EClass with a super class, and that + * attribute happens to be in the super class definition, the changes transmitted + * to the CDO server include the super class EClass, not the class that was modified. + * + * To temporarily fix this I added an new argument to the rememberAttributeChange() + * method. I added the EClass returned from the classInfo.getEClass() method. + * In this way rememberAttributeChange() does not depend of finding the EClass + * from the feature itself. A patch follows. + * + * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=162017 + */ +public class Bugzilla162017Test extends AbstractModel1Test +{ + public void testChangeSuperClassAttribute() throws Exception + { + { + ExtendedNode node = createExtended("extended"); + node.setBooleanFeature(true); + node.setIntFeature(4711); + node.setStringFeature("tree node feature"); + node.setStringFeature2("extended node feature"); + saveRoot(node, "/test/res"); + } + + { + ExtendedNode node = (ExtendedNode) loadRoot("/test/res"); + assertEquals(true, node.isBooleanFeature()); + assertEquals(4711, node.getIntFeature()); + assertEquals("tree node feature", node.getStringFeature()); + assertEquals("extended node feature", node.getStringFeature2()); + + node.setStringFeature("changed tree node feature"); + node.eResource().save(null); + } + + { + ExtendedNode node = (ExtendedNode) loadRoot("/test/res"); + assertEquals(true, node.isBooleanFeature()); + assertEquals(4711, node.getIntFeature()); + assertEquals("changed tree node feature", node.getStringFeature()); + assertEquals("extended node feature", node.getStringFeature2()); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java index f6ae274bc0..10f71ef766 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java @@ -80,6 +80,7 @@ public abstract class AbstractTopologyTest extends TestCase implements ITopology @Override protected void tearDown() throws Exception { + Thread.sleep(200); JdbcTemplate jdbc = jdbc(); wipeDatabase(jdbc); |