Skip to main content
summaryrefslogtreecommitdiffstats
blob: bed8b263da4703a2781352ed6983ade17fea3509 (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
/*****************************************************************************
 * Copyright (c) 2013 CEA
 *
 *    
 * 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:
 *   Soyatec - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.tests.bug.pro20130916;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationLabelEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
import org.junit.Test;


/**
 * @author Jin Liu (jin.liu@soyatec.com)
 */
public class TimeObservationStereotypesTest extends BaseStereotypesTest {

	private TimeObservationEditPart timeObservation;

	/**
	 * @see org.eclipse.papyrus.uml.diagram.sequence.tests.bug.m7.AbstractNodeTest#setUp()
	 * 
	 * @throws Exception
	 */

	@Override
	protected void setUp() throws Exception {
		super.setUp();
		timeObservation = (TimeObservationEditPart)createNode(UMLElementTypes.TimeObservation_3020, getRootEditPart(), new Point(100, 100), null);
		assertNotNull(timeObservation);
	}

	@Test
	public void testDisplayStereotypeComment() {
		//It seems the TimeObservationEditPart can not be selected from diagram, we use the Label EditPart instead.
		IGraphicalEditPart label = timeObservation.getChildBySemanticHint("" + TimeObservationLabelEditPart.VISUAL_ID);
		doTestDisplayStereotypeComment(label);
	}

	@Test
	public void testDisplayStereotypeInCompartment() {
		//It seems the TimeObservationEditPart can not be selected from diagram, we use the Label EditPart instead.
		IGraphicalEditPart label = timeObservation.getChildBySemanticHint("" + TimeObservationLabelEditPart.VISUAL_ID);
		doTestDisplayStereotypeInCompartment(label, timeObservation.getChildBySemanticHint("" + TimeObservationAppliedStereotypeEditPart.VISUAL_ID));
	}

	@Test
	public void testDisplayStereotypeWithBrace() {
		//It seems the TimeObservationEditPart can not be selected from diagram, we use the Label EditPart instead.
		IGraphicalEditPart label = timeObservation.getChildBySemanticHint("" + TimeObservationLabelEditPart.VISUAL_ID);
		doTestDisplayStereotypeWithBrace(label, timeObservation.getChildBySemanticHint("" + TimeObservationAppliedStereotypeEditPart.VISUAL_ID));
	}

}

Back to the top