| /* |
| * 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.Collaboration; |
| 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.FunctionBehavior; |
| 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.Parameter; |
| import org.eclipse.uml2.uml.ParameterSet; |
| import org.eclipse.uml2.uml.PrimitiveType; |
| import org.eclipse.uml2.uml.ProtocolStateMachine; |
| import org.eclipse.uml2.uml.Reception; |
| import org.eclipse.uml2.uml.RedefinableElement; |
| 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.TimeConstraint; |
| import org.eclipse.uml2.uml.UseCase; |
| |
| /** |
| * @author Eike Stepper |
| */ |
| public class ReceptionTest |
| extends _Abstract_Compliance_Test_ { |
| |
| public void testEAnnotations() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| EAnnotation eAnnotation = ECORE.createEAnnotation(); |
| assertValid(eAnnotation); |
| reception.getEAnnotations().add(eAnnotation); |
| } |
| |
| public void testOwnedComment() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| Comment comment = UML.createComment(); |
| assertValid(comment); |
| reception.getOwnedComments().add(comment); |
| assertSuperset(reception.getOwnedElements().contains(comment)); |
| } |
| |
| public void testOwnedElement() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<Element> elements = reception.getOwnedElements(); |
| EList<Element> elements2 = reception.getOwnedElements(); |
| assertSame(elements, elements2); |
| } |
| |
| public void testClientDependency() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<Dependency> dependencys = reception.getClientDependencies(); |
| EList<Dependency> dependencys2 = reception.getClientDependencies(); |
| assertSame(dependencys, dependencys2); |
| } |
| |
| public void testNameExpression() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| StringExpression stringExpression = UML.createStringExpression(); |
| assertValid(stringExpression); |
| reception.setNameExpression(stringExpression); |
| assertSuperset(reception.getOwnedElements().contains(stringExpression)); |
| } |
| |
| public void testOwnedRule() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| IntervalConstraint intervalConstraint = UML.createIntervalConstraint(); |
| assertValid(intervalConstraint); |
| reception.getOwnedRules().add(intervalConstraint); |
| assertSuperset( |
| reception.getOwnedMembers().contains(intervalConstraint)); |
| |
| TimeConstraint timeConstraint = UML.createTimeConstraint(); |
| assertValid(timeConstraint); |
| reception.getOwnedRules().add(timeConstraint); |
| assertSuperset(reception.getOwnedMembers().contains(timeConstraint)); |
| |
| InteractionConstraint interactionConstraint = UML |
| .createInteractionConstraint(); |
| assertValid(interactionConstraint); |
| reception.getOwnedRules().add(interactionConstraint); |
| assertSuperset( |
| reception.getOwnedMembers().contains(interactionConstraint)); |
| |
| Constraint constraint = UML.createConstraint(); |
| assertValid(constraint); |
| reception.getOwnedRules().add(constraint); |
| assertSuperset(reception.getOwnedMembers().contains(constraint)); |
| |
| DurationConstraint durationConstraint = UML.createDurationConstraint(); |
| assertValid(durationConstraint); |
| reception.getOwnedRules().add(durationConstraint); |
| assertSuperset( |
| reception.getOwnedMembers().contains(durationConstraint)); |
| } |
| |
| public void testElementImport() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| ElementImport elementImport = UML.createElementImport(); |
| assertValid(elementImport); |
| reception.getElementImports().add(elementImport); |
| assertSuperset(reception.getOwnedElements().contains(elementImport)); |
| } |
| |
| public void testPackageImport() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| PackageImport packageImport = UML.createPackageImport(); |
| assertValid(packageImport); |
| reception.getPackageImports().add(packageImport); |
| assertSuperset(reception.getOwnedElements().contains(packageImport)); |
| } |
| |
| public void testOwnedMember() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<NamedElement> namedElements = reception.getOwnedMembers(); |
| EList<NamedElement> namedElements2 = reception.getOwnedMembers(); |
| assertSame(namedElements, namedElements2); |
| } |
| |
| public void testImportedMember() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<PackageableElement> packageableElements = reception |
| .getImportedMembers(); |
| EList<PackageableElement> packageableElements2 = reception |
| .getImportedMembers(); |
| assertSame(packageableElements, packageableElements2); |
| } |
| |
| public void testMember() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<NamedElement> namedElements = reception.getMembers(); |
| EList<NamedElement> namedElements2 = reception.getMembers(); |
| assertSame(namedElements, namedElements2); |
| } |
| |
| public void testRedefinedElement() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<RedefinableElement> redefinableElements = reception |
| .getRedefinedElements(); |
| EList<RedefinableElement> redefinableElements2 = reception |
| .getRedefinedElements(); |
| assertSame(redefinableElements, redefinableElements2); |
| } |
| |
| public void testRedefinitionContext() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<Classifier> classifiers = reception.getRedefinitionContexts(); |
| EList<Classifier> classifiers2 = reception.getRedefinitionContexts(); |
| assertSame(classifiers, classifiers2); |
| } |
| |
| public void testFeaturingClassifier() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| EList<Classifier> classifiers = reception.getFeaturingClassifiers(); |
| EList<Classifier> classifiers2 = reception.getFeaturingClassifiers(); |
| assertSame(classifiers, classifiers2); |
| } |
| |
| public void testMethod() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| ProtocolStateMachine protocolStateMachine = UML |
| .createProtocolStateMachine(); |
| assertValid(protocolStateMachine); |
| reception.getMethods().add(protocolStateMachine); |
| |
| FunctionBehavior functionBehavior = UML.createFunctionBehavior(); |
| assertValid(functionBehavior); |
| reception.getMethods().add(functionBehavior); |
| |
| Activity activity = UML.createActivity(); |
| assertValid(activity); |
| reception.getMethods().add(activity); |
| |
| Interaction interaction = UML.createInteraction(); |
| assertValid(interaction); |
| reception.getMethods().add(interaction); |
| |
| OpaqueBehavior opaqueBehavior = UML.createOpaqueBehavior(); |
| assertValid(opaqueBehavior); |
| reception.getMethods().add(opaqueBehavior); |
| |
| StateMachine stateMachine = UML.createStateMachine(); |
| assertValid(stateMachine); |
| reception.getMethods().add(stateMachine); |
| } |
| |
| public void testOwnedParameter() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| Parameter parameter = UML.createParameter(); |
| assertValid(parameter); |
| reception.getOwnedParameters().add(parameter); |
| assertSuperset(reception.getOwnedMembers().contains(parameter)); |
| } |
| |
| public void testOwnedParameterSet() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| ParameterSet parameterSet = UML.createParameterSet(); |
| assertValid(parameterSet); |
| reception.getOwnedParameterSets().add(parameterSet); |
| assertSuperset(reception.getOwnedMembers().contains(parameterSet)); |
| } |
| |
| public void testRaisedException() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| FunctionBehavior functionBehavior = UML.createFunctionBehavior(); |
| assertValid(functionBehavior); |
| reception.getRaisedExceptions().add(functionBehavior); |
| |
| Activity activity = UML.createActivity(); |
| assertValid(activity); |
| reception.getRaisedExceptions().add(activity); |
| |
| Interface interface_ = UML.createInterface(); |
| assertValid(interface_); |
| reception.getRaisedExceptions().add(interface_); |
| |
| InformationItem informationItem = UML.createInformationItem(); |
| assertValid(informationItem); |
| reception.getRaisedExceptions().add(informationItem); |
| |
| CommunicationPath communicationPath = UML.createCommunicationPath(); |
| assertValid(communicationPath); |
| reception.getRaisedExceptions().add(communicationPath); |
| |
| ExecutionEnvironment executionEnvironment = UML |
| .createExecutionEnvironment(); |
| assertValid(executionEnvironment); |
| reception.getRaisedExceptions().add(executionEnvironment); |
| |
| Component component = UML.createComponent(); |
| assertValid(component); |
| reception.getRaisedExceptions().add(component); |
| |
| Interaction interaction = UML.createInteraction(); |
| assertValid(interaction); |
| reception.getRaisedExceptions().add(interaction); |
| |
| DeploymentSpecification deploymentSpecification = UML |
| .createDeploymentSpecification(); |
| assertValid(deploymentSpecification); |
| reception.getRaisedExceptions().add(deploymentSpecification); |
| |
| OpaqueBehavior opaqueBehavior = UML.createOpaqueBehavior(); |
| assertValid(opaqueBehavior); |
| reception.getRaisedExceptions().add(opaqueBehavior); |
| |
| Association association = UML.createAssociation(); |
| assertValid(association); |
| reception.getRaisedExceptions().add(association); |
| |
| DataType dataType = UML.createDataType(); |
| assertValid(dataType); |
| reception.getRaisedExceptions().add(dataType); |
| |
| Device device = UML.createDevice(); |
| assertValid(device); |
| reception.getRaisedExceptions().add(device); |
| |
| Extension extension = UML.createExtension(); |
| assertValid(extension); |
| reception.getRaisedExceptions().add(extension); |
| |
| AssociationClass associationClass = UML.createAssociationClass(); |
| assertValid(associationClass); |
| reception.getRaisedExceptions().add(associationClass); |
| |
| org.eclipse.uml2.uml.Class class_ = UML.createClass(); |
| assertValid(class_); |
| reception.getRaisedExceptions().add(class_); |
| |
| Enumeration enumeration = UML.createEnumeration(); |
| assertValid(enumeration); |
| reception.getRaisedExceptions().add(enumeration); |
| |
| PrimitiveType primitiveType = UML.createPrimitiveType(); |
| assertValid(primitiveType); |
| reception.getRaisedExceptions().add(primitiveType); |
| |
| Actor actor = UML.createActor(); |
| assertValid(actor); |
| reception.getRaisedExceptions().add(actor); |
| |
| ProtocolStateMachine protocolStateMachine = UML |
| .createProtocolStateMachine(); |
| assertValid(protocolStateMachine); |
| reception.getRaisedExceptions().add(protocolStateMachine); |
| |
| UseCase useCase = UML.createUseCase(); |
| assertValid(useCase); |
| reception.getRaisedExceptions().add(useCase); |
| |
| Signal signal = UML.createSignal(); |
| assertValid(signal); |
| reception.getRaisedExceptions().add(signal); |
| |
| Node node = UML.createNode(); |
| assertValid(node); |
| reception.getRaisedExceptions().add(node); |
| |
| Stereotype stereotype = UML.createStereotype(); |
| assertValid(stereotype); |
| reception.getRaisedExceptions().add(stereotype); |
| |
| StateMachine stateMachine = UML.createStateMachine(); |
| assertValid(stateMachine); |
| reception.getRaisedExceptions().add(stateMachine); |
| |
| Artifact artifact = UML.createArtifact(); |
| assertValid(artifact); |
| reception.getRaisedExceptions().add(artifact); |
| |
| Collaboration collaboration = UML.createCollaboration(); |
| assertValid(collaboration); |
| reception.getRaisedExceptions().add(collaboration); |
| } |
| |
| public void testSignal() { |
| Reception reception = UML.createReception(); |
| assertValid(reception); |
| |
| Signal signal = UML.createSignal(); |
| assertValid(signal); |
| reception.setSignal(signal); |
| } |
| |
| } |