Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 59ac3a0cc1b084f6ebbde3c7c95999062e39bdc0 (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
/*****************************************************************************
 * Copyright (c) 2018 CEA LIST, EclipseSource 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:
 *   EclipseSource - Initial API and implementation
 *
 *****************************************************************************/

package org.eclipse.papyrus.uml.diagram.sequence.tests.bug;

import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
import org.eclipse.papyrus.uml.diagram.sequence.figures.DurationLinkFigure;
import org.eclipse.uml2.uml.DurationObservation;
import org.eclipse.uml2.uml.Element;

/**
 * Creation test for DurationObservationLinks
 */
@PluginResource({ "resource/bugs/bug536631-durationLinksCreation.di", "resource/bugs/style.css" })
@ActiveDiagram("durationLinksCreation")
public class DurationObservationCreationTest extends AbstractOccurrenceLinkCreationTest<DurationObservation> {

	public DurationObservationCreationTest() {
		super(DurationObservation.class, "createDurationObservationEdgeTool", DurationLinkFigure.class);
	}

	@Override
	protected Element getSemanticSource(DurationObservation link) {
		return link.getEvents().get(0);
	}

	@Override
	protected Element getSemanticTarget(DurationObservation link) {
		return link.getEvents().size() > 1 ? link.getEvents().get(1) : link.getEvents().get(0);
	}

}

Back to the top