Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cb82da2bf2c103a4dc8ff2bf78c739bb8ac7fe24 (plain) (blame)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/*****************************************************************************
 * Copyright (c) 2009 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:
 *  Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
 *  Nizar GUEDIDI (CEA LIST) - Add tests for Primitive Type properties and operations 
 *  Nizar GUEDIDI (CEA LIST) - Add tests for nested classifier compartments
 *
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.clazz.test.canonical;

import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.junit.framework.classification.FailingTest;
import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomUMLDiagramUpdater;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassAttributeCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNestedClassifierCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassOperationCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentAttributeCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentNestedClassifierCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ComponentOperationCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.EnumerationEnumerationLiteralCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InstanceSpecificationSlotCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceAttributeCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceNestedClassifierCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.InterfaceOperationCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PrimitiveTypeAttributeCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PrimitiveTypeOperationCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.SignalAttributeCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.clazz.test.IClassDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.tests.canonical.TestChildLabel;
import org.junit.Test;

/**
 * The Class TestClassDiagramChildLabel.
 */
public class TestClassDiagramChildLabel extends TestChildLabel {
	@Override
	public DiagramUpdater getDiagramUpdater() {
		return CustomUMLDiagramUpdater.INSTANCE;
	}
	
	@Override
	protected ICreationCommand getDiagramCommandCreation() {
		return new CreateClassDiagramCommand();
	}

	@Override
	protected String getProjectName() {
		return IClassDiagramTestsConstants.PROJECT_NAME;
	}

	@Override
	protected String getFileName() {
		return IClassDiagramTestsConstants.FILE_NAME;
	}

	@Test
	@FailingTest
	public void testToManageInstanceSlot() {
		//instance specification
		testToManageTopNode(UMLElementTypes.InstanceSpecification_2001, UMLElementTypes.Slot_3030, InstanceSpecificationSlotCompartmentEditPart.VISUAL_ID, "<UNDEFINED>");
	}

	@Test
	public void testToManageComponentProperty() {
		//instance specification
		testToManageTopNodeWithMask(UMLElementTypes.Component_2002, UMLElementTypes.Property_3002, ComponentAttributeCompartmentEditPart.VISUAL_ID,"Attribute");
	}

	@Test
	public void testToManageComponentNestedClass() {
		//Class
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.Class_3004, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentNestedInterface() {
		//Interface
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.Interface_3037, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentNestedSignal() {
		//Signal
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.Signal_3051, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentNestedDataType() {
		//Data Type
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.DataType_3045, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentNestedEnumeration() {
		//Enumeration
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.Enumeration_3053, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentNestedPrimitiveType() {
		//primitive Type
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.PrimitiveType_3046, ComponentNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentOperation() {
		//instance specification
		testToManageTopNodeWithMask(UMLElementTypes.Component_2002, UMLElementTypes.Operation_3003, ComponentOperationCompartmentEditPart.VISUAL_ID,null);
	}

	@Test
	public void testToManageSignalProperty() {
		//instance specification
		testToManageTopNodeWithMask(UMLElementTypes.Signal_2003, UMLElementTypes.Property_3005, SignalAttributeCompartmentEditPart.VISUAL_ID,"Attribute");
	}

	@Test
	public void testToManageInterfaceProperty() {
		//interface
		testToManageTopNodeWithMask(UMLElementTypes.Interface_2004, UMLElementTypes.Property_3006, InterfaceAttributeCompartmentEditPart.VISUAL_ID,"Attribute");
	}

	@Test
	public void testToManageInterfaceOperation() {
		//interface
		testToManageTopNodeWithMask(UMLElementTypes.Interface_2004, UMLElementTypes.Operation_3007, InterfaceOperationCompartmentEditPart.VISUAL_ID,null);
	}

	@Test
	public void testToManageInterfaceNestedClass() {
		//Class
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.Class_3008, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceNestedInterface() {
		//Interface
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.Interface_3038, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceNestedSignal() {
		//Signal
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.Signal_3049, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceNestedDataType() {
		//Data Type
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.DataType_3043, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceNestedEnumeration() {
		//Enumeration
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.Enumeration_3054, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceNestedPrimitiveType() {
		//Primitive Type
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.PrimitiveType_3048, InterfaceNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageEnumerationLiteralEnumeration() {
		//Enumeration
		testToManageTopNode(UMLElementTypes.Enumeration_2006, UMLElementTypes.EnumerationLiteral_3017, EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassProperty() {
		//Enumeration
		testToManageTopNodeWithMask(UMLElementTypes.Class_2008, UMLElementTypes.Property_3012, ClassAttributeCompartmentEditPart.VISUAL_ID,"Attribute");
	}

	@Test
	public void testToManageClassReception() {
		//Enumeration
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.Reception_3011, ClassOperationCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassOperation() {
		//Enumeration
		testToManageTopNodeWithMask(UMLElementTypes.Class_2008, UMLElementTypes.Operation_3013, ClassOperationCompartmentEditPart.VISUAL_ID,null);
	}

	@Test
	public void testToManageClassNestedClass() {
		//class
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.Class_3014, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassNestedInetrface() {
		//Interface
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.Interface_3036, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassNestedSignal() {
		//Signal
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.Signal_3050, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassNestedDataType() {
		//Data Type
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.DataType_3044, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassNestedEnumeration() {
		//Enumeration
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.Enumeration_3052, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageClassNestedPrimitiveType() {
		//Primitive Type
		testToManageTopNode(UMLElementTypes.Class_2008, UMLElementTypes.PrimitiveType_3047, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageComponentReception() {
		//class
		testToManageTopNode(UMLElementTypes.Component_2002, UMLElementTypes.Reception_3011, ComponentOperationCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManageInterfaceReception() {
		//class
		testToManageTopNode(UMLElementTypes.Interface_2004, UMLElementTypes.Reception_3039, InterfaceOperationCompartmentEditPart.VISUAL_ID);
	}

	@Test
	public void testToManagePrimitiveTypeProperty() {
		//class
		testToManageTopNodeWithMask(UMLElementTypes.PrimitiveType_2009, UMLElementTypes.Property_3041, PrimitiveTypeAttributeCompartmentEditPart.VISUAL_ID,"Attribute");
	}

	@Test
	public void testToManagePrimitiveTypeOperation() {
		//class
		testToManageTopNodeWithMask(UMLElementTypes.PrimitiveType_2009, UMLElementTypes.Operation_3042, PrimitiveTypeOperationCompartmentEditPart.VISUAL_ID,null);
	}
}

Back to the top