blob: 5701e03721ebaf9cfe1b4b22343b38c7f8115d82 [file] [log] [blame]
/*
* Copyright (c) 2018 CEA, 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:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.uml2.uml.cdo.tests.compliance;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.uml2.uml.CallEvent;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.TemplateParameter;
/**
* @author Eike Stepper
*/
public class CallEventTest
extends _Abstract_Compliance_Test_ {
public void testEAnnotations() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
EAnnotation eAnnotation = ECORE.createEAnnotation();
assertValid(eAnnotation);
callEvent.getEAnnotations().add(eAnnotation);
}
public void testOwnedComment() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
Comment comment = UML.createComment();
assertValid(comment);
callEvent.getOwnedComments().add(comment);
assertSuperset(callEvent.getOwnedElements().contains(comment));
}
public void testOwnedElement() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
EList<Element> elements = callEvent.getOwnedElements();
EList<Element> elements2 = callEvent.getOwnedElements();
assertSame(elements, elements2);
}
public void testClientDependency() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
EList<Dependency> dependencys = callEvent.getClientDependencies();
EList<Dependency> dependencys2 = callEvent.getClientDependencies();
assertSame(dependencys, dependencys2);
}
public void testNameExpression() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
StringExpression stringExpression = UML.createStringExpression();
assertValid(stringExpression);
callEvent.setNameExpression(stringExpression);
assertSuperset(callEvent.getOwnedElements().contains(stringExpression));
}
public void testOwningTemplateParameter() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
callEvent.setOwningTemplateParameter(templateParameter);
assertSuperset(callEvent.getOwner() == templateParameter);
assertSuperset(callEvent.getTemplateParameter() == templateParameter);
}
public void testTemplateParameter() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
callEvent.setTemplateParameter(templateParameter);
}
public void testOperation() {
CallEvent callEvent = UML.createCallEvent();
assertValid(callEvent);
Operation operation = UML.createOperation();
assertValid(operation);
callEvent.setOperation(operation);
}
}