1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/*****************************************************************************
* Copyright (c) 2014 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:
* Thibault Le Ouay (Sherpa Engineering) t.leouay@sherpa-eng.com - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.profile.tests.canonical;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.papyrus.infra.gmfdiag.common.updater.DiagramUpdater;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.uml.diagram.profile.CreateProfileDiagramCommand;
import org.eclipse.papyrus.uml.diagram.profile.part.UMLDiagramUpdater;
import org.eclipse.papyrus.uml.diagram.profile.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.tests.canonical.TestChildNode;
import org.eclipse.uml2.uml.UMLPackage;
/**
* @author Thibault
*
*/
import org.junit.Test;
public class TestProfileDiagramChildNode extends TestChildNode {
@Override
public DiagramUpdater getDiagramUpdater() {
return UMLDiagramUpdater.INSTANCE;
}
protected CreateViewRequest createViewRequestShapeContainer() {
return CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Package_2007, getDiagramEditPart().getDiagramPreferencesHint());
}
protected ICreationCommand getDiagramCommandCreation() {
return new CreateProfileDiagramCommand();
}
protected String getProjectName() {
return "ProfileDiagramTestProject";
}
protected String getFileName() {
return "ProfileDiagramTest.profile.di";
}
@Test
public void testToManageClassInPackage() {
testToManageNode(UMLElementTypes.Class_3010, UMLPackage.eINSTANCE.getClass_(), UMLElementTypes.Package_2007, false);
}
@Test
public void testToManageDatatypeInPackage() {
testToManageNode(UMLElementTypes.DataType_3027, UMLPackage.eINSTANCE.getDataType(), UMLElementTypes.Package_2007, false);
}
@Test
public void testToManagePackageInPackage() {
testToManageNode(UMLElementTypes.Package_1012, UMLPackage.eINSTANCE.getPackage(), UMLElementTypes.Package_2007, false);
}
@Test
public void testToManageStereoTypeInPackage() {
testToManageNode(UMLElementTypes.Stereotype_1023, UMLPackage.eINSTANCE.getStereotype(), UMLElementTypes.Package_2007, false);
}
@Test
public void testToManageProfileInPackage() {
testToManageNode(UMLElementTypes.Profile_1024, UMLPackage.eINSTANCE.getProfile(), UMLElementTypes.Package_2007, false);
}
@Test
public void testToManageClassInProfile() {
testToManageNode(UMLElementTypes.Class_3010, UMLPackage.eINSTANCE.getClass_(), UMLElementTypes.Profile_1030, false);
}
@Test
public void testToManageDatatypeInProfile() {
testToManageNode(UMLElementTypes.DataType_3027, UMLPackage.eINSTANCE.getDataType(), UMLElementTypes.Profile_1030, false);
}
@Test
public void testToManagePackageInProfile() {
testToManageNode(UMLElementTypes.Package_1012, UMLPackage.eINSTANCE.getPackage(), UMLElementTypes.Profile_1030, false);
}
@Test
public void testToManageStereoTypeInProfile() {
testToManageNode(UMLElementTypes.Stereotype_1023, UMLPackage.eINSTANCE.getStereotype(), UMLElementTypes.Profile_1030, false);
}
@Test
public void testToManageProfileInProfile() {
testToManageNode(UMLElementTypes.Profile_1024, UMLPackage.eINSTANCE.getProfile(), UMLElementTypes.Profile_1030, false);
}
}
|