From a13e6218401a3fb253d73be037339e7a3ac5dcdd Mon Sep 17 00:00:00 2001 From: Christian W. Damus Date: Wed, 23 Jul 2014 12:28:20 -0400 Subject: 440108: [Properties] Warning decoration for name clash shown on nameless element https://bugs.eclipse.org/bugs/show_bug.cgi?id=440108 Use the UML2 API for distinguishability of named elements to validate a prospective new element name. Includes JUnit tests for cases that were spurious warnings (different metaclass, not accounting for operation signature). Also unset names of elements instead of setting their names to empty strings. This uses a new UnsetRequest supported by the UML edit-helpers. --- .../junit/utils/rules/ResourceSetFixture.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java (limited to 'tests/junit/plugins/junit') diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java new file mode 100644 index 00000000000..23b14c2a334 --- /dev/null +++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2014 CEA 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: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; + + +/** + * A simple non-transactional {@link ResourceSet} fixture. + */ +public class ResourceSetFixture extends AbstractModelFixture { + + public ResourceSetFixture() { + super(); + } + + protected EditingDomain createEditingDomain() { + return new AdapterFactoryEditingDomain(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), new BasicCommandStack()); + } +} -- cgit v1.2.3