blob: e3fe11e6d3b7e965673f7a192ef9bd497a6c0430 [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.Activity;
import org.eclipse.uml2.uml.Actor;
import org.eclipse.uml2.uml.Artifact;
import org.eclipse.uml2.uml.Association;
import org.eclipse.uml2.uml.AssociationClass;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.ClassifierTemplateParameter;
import org.eclipse.uml2.uml.Collaboration;
import org.eclipse.uml2.uml.CollaborationUse;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.CommunicationPath;
import org.eclipse.uml2.uml.Component;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.DataType;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.DeploymentSpecification;
import org.eclipse.uml2.uml.Device;
import org.eclipse.uml2.uml.DurationConstraint;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.ElementImport;
import org.eclipse.uml2.uml.Enumeration;
import org.eclipse.uml2.uml.ExecutionEnvironment;
import org.eclipse.uml2.uml.Extension;
import org.eclipse.uml2.uml.ExtensionEnd;
import org.eclipse.uml2.uml.Feature;
import org.eclipse.uml2.uml.FunctionBehavior;
import org.eclipse.uml2.uml.Generalization;
import org.eclipse.uml2.uml.GeneralizationSet;
import org.eclipse.uml2.uml.InformationItem;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.InteractionConstraint;
import org.eclipse.uml2.uml.Interface;
import org.eclipse.uml2.uml.IntervalConstraint;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Node;
import org.eclipse.uml2.uml.OpaqueBehavior;
import org.eclipse.uml2.uml.PackageImport;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Port;
import org.eclipse.uml2.uml.PrimitiveType;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.ProtocolStateMachine;
import org.eclipse.uml2.uml.RedefinableElement;
import org.eclipse.uml2.uml.RedefinableTemplateSignature;
import org.eclipse.uml2.uml.Signal;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.Substitution;
import org.eclipse.uml2.uml.TemplateBinding;
import org.eclipse.uml2.uml.TimeConstraint;
import org.eclipse.uml2.uml.UseCase;
/**
* @author Eike Stepper
*/
public class SignalTest
extends _Abstract_Compliance_Test_ {
public void testEAnnotations() {
Signal signal = UML.createSignal();
assertValid(signal);
EAnnotation eAnnotation = ECORE.createEAnnotation();
assertValid(eAnnotation);
signal.getEAnnotations().add(eAnnotation);
}
public void testOwnedComment() {
Signal signal = UML.createSignal();
assertValid(signal);
Comment comment = UML.createComment();
assertValid(comment);
signal.getOwnedComments().add(comment);
assertSuperset(signal.getOwnedElements().contains(comment));
}
public void testOwnedElement() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Element> elements = signal.getOwnedElements();
EList<Element> elements2 = signal.getOwnedElements();
assertSame(elements, elements2);
}
public void testClientDependency() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Dependency> dependencys = signal.getClientDependencies();
EList<Dependency> dependencys2 = signal.getClientDependencies();
assertSame(dependencys, dependencys2);
}
public void testNameExpression() {
Signal signal = UML.createSignal();
assertValid(signal);
StringExpression stringExpression = UML.createStringExpression();
assertValid(stringExpression);
signal.setNameExpression(stringExpression);
assertSuperset(signal.getOwnedElements().contains(stringExpression));
}
public void testOwnedRule() {
Signal signal = UML.createSignal();
assertValid(signal);
IntervalConstraint intervalConstraint = UML.createIntervalConstraint();
assertValid(intervalConstraint);
signal.getOwnedRules().add(intervalConstraint);
assertSuperset(signal.getOwnedMembers().contains(intervalConstraint));
TimeConstraint timeConstraint = UML.createTimeConstraint();
assertValid(timeConstraint);
signal.getOwnedRules().add(timeConstraint);
assertSuperset(signal.getOwnedMembers().contains(timeConstraint));
InteractionConstraint interactionConstraint = UML
.createInteractionConstraint();
assertValid(interactionConstraint);
signal.getOwnedRules().add(interactionConstraint);
assertSuperset(
signal.getOwnedMembers().contains(interactionConstraint));
Constraint constraint = UML.createConstraint();
assertValid(constraint);
signal.getOwnedRules().add(constraint);
assertSuperset(signal.getOwnedMembers().contains(constraint));
DurationConstraint durationConstraint = UML.createDurationConstraint();
assertValid(durationConstraint);
signal.getOwnedRules().add(durationConstraint);
assertSuperset(signal.getOwnedMembers().contains(durationConstraint));
}
public void testElementImport() {
Signal signal = UML.createSignal();
assertValid(signal);
ElementImport elementImport = UML.createElementImport();
assertValid(elementImport);
signal.getElementImports().add(elementImport);
assertSuperset(signal.getOwnedElements().contains(elementImport));
}
public void testPackageImport() {
Signal signal = UML.createSignal();
assertValid(signal);
PackageImport packageImport = UML.createPackageImport();
assertValid(packageImport);
signal.getPackageImports().add(packageImport);
assertSuperset(signal.getOwnedElements().contains(packageImport));
}
public void testOwnedMember() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<NamedElement> namedElements = signal.getOwnedMembers();
EList<NamedElement> namedElements2 = signal.getOwnedMembers();
assertSame(namedElements, namedElements2);
}
public void testImportedMember() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<PackageableElement> packageableElements = signal
.getImportedMembers();
EList<PackageableElement> packageableElements2 = signal
.getImportedMembers();
assertSame(packageableElements, packageableElements2);
}
public void testMember() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<NamedElement> namedElements = signal.getMembers();
EList<NamedElement> namedElements2 = signal.getMembers();
assertSame(namedElements, namedElements2);
}
public void testRedefinedElement() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<RedefinableElement> redefinableElements = signal
.getRedefinedElements();
EList<RedefinableElement> redefinableElements2 = signal
.getRedefinedElements();
assertSame(redefinableElements, redefinableElements2);
}
public void testRedefinitionContext() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Classifier> classifiers = signal.getRedefinitionContexts();
EList<Classifier> classifiers2 = signal.getRedefinitionContexts();
assertSame(classifiers, classifiers2);
}
public void testOwningTemplateParameter() {
Signal signal = UML.createSignal();
assertValid(signal);
ClassifierTemplateParameter classifierTemplateParameter = UML
.createClassifierTemplateParameter();
assertValid(classifierTemplateParameter);
signal.setOwningTemplateParameter(classifierTemplateParameter);
assertSuperset(signal.getOwner() == classifierTemplateParameter);
assertSuperset(
signal.getTemplateParameter() == classifierTemplateParameter);
}
public void testTemplateParameter() {
Signal signal = UML.createSignal();
assertValid(signal);
ClassifierTemplateParameter classifierTemplateParameter = UML
.createClassifierTemplateParameter();
assertValid(classifierTemplateParameter);
signal.setTemplateParameter(classifierTemplateParameter);
}
public void testTemplateBinding() {
Signal signal = UML.createSignal();
assertValid(signal);
TemplateBinding templateBinding = UML.createTemplateBinding();
assertValid(templateBinding);
signal.getTemplateBindings().add(templateBinding);
assertSuperset(signal.getOwnedElements().contains(templateBinding));
}
public void testOwnedTemplateSignature() {
Signal signal = UML.createSignal();
assertValid(signal);
RedefinableTemplateSignature redefinableTemplateSignature = UML
.createRedefinableTemplateSignature();
assertValid(redefinableTemplateSignature);
signal.setOwnedTemplateSignature(redefinableTemplateSignature);
assertSuperset(
signal.getOwnedElements().contains(redefinableTemplateSignature));
}
public void testFeature() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Feature> features = signal.getFeatures();
EList<Feature> features2 = signal.getFeatures();
assertSame(features, features2);
}
public void testAttribute() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Property> propertys = signal.getAttributes();
EList<Property> propertys2 = signal.getAttributes();
assertSame(propertys, propertys2);
}
public void testCollaborationUse() {
Signal signal = UML.createSignal();
assertValid(signal);
CollaborationUse collaborationUse = UML.createCollaborationUse();
assertValid(collaborationUse);
signal.getCollaborationUses().add(collaborationUse);
assertSuperset(signal.getOwnedElements().contains(collaborationUse));
}
public void testGeneral() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<Classifier> classifiers = signal.getGenerals();
EList<Classifier> classifiers2 = signal.getGenerals();
assertSame(classifiers, classifiers2);
}
public void testGeneralization() {
Signal signal = UML.createSignal();
assertValid(signal);
Generalization generalization = UML.createGeneralization();
assertValid(generalization);
signal.getGeneralizations().add(generalization);
assertSuperset(signal.getOwnedElements().contains(generalization));
}
public void testPowertypeExtent() {
Signal signal = UML.createSignal();
assertValid(signal);
GeneralizationSet generalizationSet = UML.createGeneralizationSet();
assertValid(generalizationSet);
signal.getPowertypeExtents().add(generalizationSet);
}
public void testInheritedMember() {
Signal signal = UML.createSignal();
assertValid(signal);
EList<NamedElement> namedElements = signal.getInheritedMembers();
EList<NamedElement> namedElements2 = signal.getInheritedMembers();
assertSame(namedElements, namedElements2);
}
public void testOwnedUseCase() {
Signal signal = UML.createSignal();
assertValid(signal);
UseCase useCase = UML.createUseCase();
assertValid(useCase);
signal.getOwnedUseCases().add(useCase);
assertSuperset(signal.getOwnedMembers().contains(useCase));
}
public void testUseCase() {
Signal signal = UML.createSignal();
assertValid(signal);
UseCase useCase = UML.createUseCase();
assertValid(useCase);
signal.getUseCases().add(useCase);
}
public void testRedefinedClassifier() {
Signal signal = UML.createSignal();
assertValid(signal);
FunctionBehavior functionBehavior = UML.createFunctionBehavior();
assertValid(functionBehavior);
signal.getRedefinedClassifiers().add(functionBehavior);
assertSuperset(
signal.getRedefinedElements().contains(functionBehavior));
Activity activity = UML.createActivity();
assertValid(activity);
signal.getRedefinedClassifiers().add(activity);
assertSuperset(signal.getRedefinedElements().contains(activity));
Interface interface_ = UML.createInterface();
assertValid(interface_);
signal.getRedefinedClassifiers().add(interface_);
assertSuperset(signal.getRedefinedElements().contains(interface_));
InformationItem informationItem = UML.createInformationItem();
assertValid(informationItem);
signal.getRedefinedClassifiers().add(informationItem);
assertSuperset(signal.getRedefinedElements().contains(informationItem));
CommunicationPath communicationPath = UML.createCommunicationPath();
assertValid(communicationPath);
signal.getRedefinedClassifiers().add(communicationPath);
assertSuperset(
signal.getRedefinedElements().contains(communicationPath));
ExecutionEnvironment executionEnvironment = UML
.createExecutionEnvironment();
assertValid(executionEnvironment);
signal.getRedefinedClassifiers().add(executionEnvironment);
assertSuperset(
signal.getRedefinedElements().contains(executionEnvironment));
Component component = UML.createComponent();
assertValid(component);
signal.getRedefinedClassifiers().add(component);
assertSuperset(signal.getRedefinedElements().contains(component));
Interaction interaction = UML.createInteraction();
assertValid(interaction);
signal.getRedefinedClassifiers().add(interaction);
assertSuperset(signal.getRedefinedElements().contains(interaction));
DeploymentSpecification deploymentSpecification = UML
.createDeploymentSpecification();
assertValid(deploymentSpecification);
signal.getRedefinedClassifiers().add(deploymentSpecification);
assertSuperset(
signal.getRedefinedElements().contains(deploymentSpecification));
OpaqueBehavior opaqueBehavior = UML.createOpaqueBehavior();
assertValid(opaqueBehavior);
signal.getRedefinedClassifiers().add(opaqueBehavior);
assertSuperset(signal.getRedefinedElements().contains(opaqueBehavior));
Association association = UML.createAssociation();
assertValid(association);
signal.getRedefinedClassifiers().add(association);
assertSuperset(signal.getRedefinedElements().contains(association));
DataType dataType = UML.createDataType();
assertValid(dataType);
signal.getRedefinedClassifiers().add(dataType);
assertSuperset(signal.getRedefinedElements().contains(dataType));
Device device = UML.createDevice();
assertValid(device);
signal.getRedefinedClassifiers().add(device);
assertSuperset(signal.getRedefinedElements().contains(device));
Extension extension = UML.createExtension();
assertValid(extension);
signal.getRedefinedClassifiers().add(extension);
assertSuperset(signal.getRedefinedElements().contains(extension));
AssociationClass associationClass = UML.createAssociationClass();
assertValid(associationClass);
signal.getRedefinedClassifiers().add(associationClass);
assertSuperset(
signal.getRedefinedElements().contains(associationClass));
org.eclipse.uml2.uml.Class class_ = UML.createClass();
assertValid(class_);
signal.getRedefinedClassifiers().add(class_);
assertSuperset(signal.getRedefinedElements().contains(class_));
Enumeration enumeration = UML.createEnumeration();
assertValid(enumeration);
signal.getRedefinedClassifiers().add(enumeration);
assertSuperset(signal.getRedefinedElements().contains(enumeration));
PrimitiveType primitiveType = UML.createPrimitiveType();
assertValid(primitiveType);
signal.getRedefinedClassifiers().add(primitiveType);
assertSuperset(signal.getRedefinedElements().contains(primitiveType));
Actor actor = UML.createActor();
assertValid(actor);
signal.getRedefinedClassifiers().add(actor);
assertSuperset(signal.getRedefinedElements().contains(actor));
ProtocolStateMachine protocolStateMachine = UML
.createProtocolStateMachine();
assertValid(protocolStateMachine);
signal.getRedefinedClassifiers().add(protocolStateMachine);
assertSuperset(
signal.getRedefinedElements().contains(protocolStateMachine));
UseCase useCase = UML.createUseCase();
assertValid(useCase);
signal.getRedefinedClassifiers().add(useCase);
assertSuperset(signal.getRedefinedElements().contains(useCase));
Signal signal2 = UML.createSignal();
assertValid(signal2);
signal.getRedefinedClassifiers().add(signal2);
assertSuperset(signal.getRedefinedElements().contains(signal2));
Node node = UML.createNode();
assertValid(node);
signal.getRedefinedClassifiers().add(node);
assertSuperset(signal.getRedefinedElements().contains(node));
Stereotype stereotype = UML.createStereotype();
assertValid(stereotype);
signal.getRedefinedClassifiers().add(stereotype);
assertSuperset(signal.getRedefinedElements().contains(stereotype));
StateMachine stateMachine = UML.createStateMachine();
assertValid(stateMachine);
signal.getRedefinedClassifiers().add(stateMachine);
assertSuperset(signal.getRedefinedElements().contains(stateMachine));
Artifact artifact = UML.createArtifact();
assertValid(artifact);
signal.getRedefinedClassifiers().add(artifact);
assertSuperset(signal.getRedefinedElements().contains(artifact));
Collaboration collaboration = UML.createCollaboration();
assertValid(collaboration);
signal.getRedefinedClassifiers().add(collaboration);
assertSuperset(signal.getRedefinedElements().contains(collaboration));
}
public void testRepresentation() {
Signal signal = UML.createSignal();
assertValid(signal);
CollaborationUse collaborationUse = UML.createCollaborationUse();
assertValid(collaborationUse);
signal.setRepresentation(collaborationUse);
assertSuperset(
signal.getCollaborationUses().contains(collaborationUse));
}
public void testSubstitution() {
Signal signal = UML.createSignal();
assertValid(signal);
Substitution substitution = UML.createSubstitution();
assertValid(substitution);
signal.getSubstitutions().add(substitution);
assertSuperset(signal.getOwnedElements().contains(substitution));
assertSuperset(signal.getClientDependencies().contains(substitution));
}
public void testOwnedAttribute() {
Signal signal = UML.createSignal();
assertValid(signal);
Port port = UML.createPort();
assertValid(port);
signal.getOwnedAttributes().add(port);
assertSuperset(signal.getAttributes().contains(port));
assertSuperset(signal.getOwnedMembers().contains(port));
ExtensionEnd extensionEnd = UML.createExtensionEnd();
assertValid(extensionEnd);
signal.getOwnedAttributes().add(extensionEnd);
assertSuperset(signal.getAttributes().contains(extensionEnd));
assertSuperset(signal.getOwnedMembers().contains(extensionEnd));
Property property = UML.createProperty();
assertValid(property);
signal.getOwnedAttributes().add(property);
assertSuperset(signal.getAttributes().contains(property));
assertSuperset(signal.getOwnedMembers().contains(property));
}
}