| /***************************************************************************** |
| * Copyright (c) 2012 CEA LIST. |
| * |
| * 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: |
| * |
| * CEA LIST - Initial API and implementation |
| * |
| *****************************************************************************/ |
| package org.eclipse.papyrus.sysml.diagram.internalblock.tests.dnd.link; |
| |
| import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView; |
| import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createElement; |
| import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createLink; |
| import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.dropFromModelExplorer; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; |
| import org.eclipse.gmf.runtime.notation.View; |
| import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; |
| import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest; |
| import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; |
| import org.junit.BeforeClass; |
| import org.junit.Test; |
| |
| /** |
| * JUnit tests for Link DnD tests (via palette tools). |
| */ |
| public class TestLinkDropOnDiagram extends AbstractTest { |
| |
| public static EObject constraintTarget; |
| public static EObject dependency; |
| |
| @BeforeClass |
| public static void prepare() throws Exception { |
| View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); |
| constraintTarget = createElement(UMLElementTypes.CONSTRAINT, getDiagramView()); |
| dependency = createLink(UMLElementTypes.DEPENDENCY, blockView.getElement(), constraintTarget); |
| } |
| |
| @Test |
| public void dropDependencyInDiagram() throws Exception { |
| dropFromModelExplorer(dependency, getDiagramView(), true); |
| } |
| } |