blob: 8d5f8f0f7bdafa18c42ff26dbd00ae79f41dab41 [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.Comment;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.DurationConstraint;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.InteractionConstraint;
import org.eclipse.uml2.uml.IntervalConstraint;
import org.eclipse.uml2.uml.Parameter;
import org.eclipse.uml2.uml.ParameterSet;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.TimeConstraint;
/**
* @author Eike Stepper
*/
public class ParameterSetTest
extends _Abstract_Compliance_Test_ {
public void testEAnnotations() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
EAnnotation eAnnotation = ECORE.createEAnnotation();
assertValid(eAnnotation);
parameterSet.getEAnnotations().add(eAnnotation);
}
public void testOwnedComment() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
Comment comment = UML.createComment();
assertValid(comment);
parameterSet.getOwnedComments().add(comment);
assertSuperset(parameterSet.getOwnedElements().contains(comment));
}
public void testOwnedElement() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
EList<Element> elements = parameterSet.getOwnedElements();
EList<Element> elements2 = parameterSet.getOwnedElements();
assertSame(elements, elements2);
}
public void testClientDependency() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
EList<Dependency> dependencys = parameterSet.getClientDependencies();
EList<Dependency> dependencys2 = parameterSet.getClientDependencies();
assertSame(dependencys, dependencys2);
}
public void testNameExpression() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
StringExpression stringExpression = UML.createStringExpression();
assertValid(stringExpression);
parameterSet.setNameExpression(stringExpression);
assertSuperset(
parameterSet.getOwnedElements().contains(stringExpression));
}
public void testCondition() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
IntervalConstraint intervalConstraint = UML.createIntervalConstraint();
assertValid(intervalConstraint);
parameterSet.getConditions().add(intervalConstraint);
assertSuperset(
parameterSet.getOwnedElements().contains(intervalConstraint));
TimeConstraint timeConstraint = UML.createTimeConstraint();
assertValid(timeConstraint);
parameterSet.getConditions().add(timeConstraint);
assertSuperset(
parameterSet.getOwnedElements().contains(timeConstraint));
InteractionConstraint interactionConstraint = UML
.createInteractionConstraint();
assertValid(interactionConstraint);
parameterSet.getConditions().add(interactionConstraint);
assertSuperset(
parameterSet.getOwnedElements().contains(interactionConstraint));
Constraint constraint = UML.createConstraint();
assertValid(constraint);
parameterSet.getConditions().add(constraint);
assertSuperset(parameterSet.getOwnedElements().contains(constraint));
DurationConstraint durationConstraint = UML.createDurationConstraint();
assertValid(durationConstraint);
parameterSet.getConditions().add(durationConstraint);
assertSuperset(
parameterSet.getOwnedElements().contains(durationConstraint));
}
public void testParameter() {
ParameterSet parameterSet = UML.createParameterSet();
assertValid(parameterSet);
Parameter parameter = UML.createParameter();
assertValid(parameter);
parameterSet.getParameters().add(parameter);
}
}