blob: 186c2f962ec10dcc42036459e3859124456fe89e [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.Collaboration;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.CommunicationPath;
import org.eclipse.uml2.uml.Component;
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.Element;
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.Interface;
import org.eclipse.uml2.uml.LiteralReal;
import org.eclipse.uml2.uml.Node;
import org.eclipse.uml2.uml.OpaqueBehavior;
import org.eclipse.uml2.uml.PrimitiveType;
import org.eclipse.uml2.uml.ProtocolStateMachine;
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.TemplateParameter;
import org.eclipse.uml2.uml.UseCase;
/**
* @author Eike Stepper
*/
public class LiteralRealTest
extends _Abstract_Compliance_Test_ {
public void testEAnnotations() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
EAnnotation eAnnotation = ECORE.createEAnnotation();
assertValid(eAnnotation);
literalReal.getEAnnotations().add(eAnnotation);
}
public void testOwnedComment() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
Comment comment = UML.createComment();
assertValid(comment);
literalReal.getOwnedComments().add(comment);
assertSuperset(literalReal.getOwnedElements().contains(comment));
}
public void testOwnedElement() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
EList<Element> elements = literalReal.getOwnedElements();
EList<Element> elements2 = literalReal.getOwnedElements();
assertSame(elements, elements2);
}
public void testClientDependency() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
EList<Dependency> dependencys = literalReal.getClientDependencies();
EList<Dependency> dependencys2 = literalReal.getClientDependencies();
assertSame(dependencys, dependencys2);
}
public void testNameExpression() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
StringExpression stringExpression = UML.createStringExpression();
assertValid(stringExpression);
literalReal.setNameExpression(stringExpression);
assertSuperset(
literalReal.getOwnedElements().contains(stringExpression));
}
public void testOwningTemplateParameter() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
literalReal.setOwningTemplateParameter(templateParameter);
assertSuperset(literalReal.getOwner() == templateParameter);
assertSuperset(literalReal.getTemplateParameter() == templateParameter);
}
public void testTemplateParameter() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
literalReal.setTemplateParameter(templateParameter);
}
public void testType() {
LiteralReal literalReal = UML.createLiteralReal();
assertValid(literalReal);
FunctionBehavior functionBehavior = UML.createFunctionBehavior();
assertValid(functionBehavior);
literalReal.setType(functionBehavior);
Activity activity = UML.createActivity();
assertValid(activity);
literalReal.setType(activity);
LiteralReal literalReal2 = UML.createLiteralReal();
assertValid(literalReal2);
Interface interface_ = UML.createInterface();
assertValid(interface_);
literalReal2.setType(interface_);
InformationItem informationItem = UML.createInformationItem();
assertValid(informationItem);
literalReal2.setType(informationItem);
LiteralReal literalReal3 = UML.createLiteralReal();
assertValid(literalReal3);
CommunicationPath communicationPath = UML.createCommunicationPath();
assertValid(communicationPath);
literalReal3.setType(communicationPath);
ExecutionEnvironment executionEnvironment = UML
.createExecutionEnvironment();
assertValid(executionEnvironment);
literalReal3.setType(executionEnvironment);
LiteralReal literalReal4 = UML.createLiteralReal();
assertValid(literalReal4);
Component component = UML.createComponent();
assertValid(component);
literalReal4.setType(component);
Interaction interaction = UML.createInteraction();
assertValid(interaction);
literalReal4.setType(interaction);
LiteralReal literalReal5 = UML.createLiteralReal();
assertValid(literalReal5);
DeploymentSpecification deploymentSpecification = UML
.createDeploymentSpecification();
assertValid(deploymentSpecification);
literalReal5.setType(deploymentSpecification);
OpaqueBehavior opaqueBehavior = UML.createOpaqueBehavior();
assertValid(opaqueBehavior);
literalReal5.setType(opaqueBehavior);
LiteralReal literalReal6 = UML.createLiteralReal();
assertValid(literalReal6);
Association association = UML.createAssociation();
assertValid(association);
literalReal6.setType(association);
DataType dataType = UML.createDataType();
assertValid(dataType);
literalReal6.setType(dataType);
LiteralReal literalReal7 = UML.createLiteralReal();
assertValid(literalReal7);
Device device = UML.createDevice();
assertValid(device);
literalReal7.setType(device);
Extension extension = UML.createExtension();
assertValid(extension);
literalReal7.setType(extension);
LiteralReal literalReal8 = UML.createLiteralReal();
assertValid(literalReal8);
AssociationClass associationClass = UML.createAssociationClass();
assertValid(associationClass);
literalReal8.setType(associationClass);
org.eclipse.uml2.uml.Class class_ = UML.createClass();
assertValid(class_);
literalReal8.setType(class_);
LiteralReal literalReal9 = UML.createLiteralReal();
assertValid(literalReal9);
Enumeration enumeration = UML.createEnumeration();
assertValid(enumeration);
literalReal9.setType(enumeration);
PrimitiveType primitiveType = UML.createPrimitiveType();
assertValid(primitiveType);
literalReal9.setType(primitiveType);
LiteralReal literalReal10 = UML.createLiteralReal();
assertValid(literalReal10);
Actor actor = UML.createActor();
assertValid(actor);
literalReal10.setType(actor);
ProtocolStateMachine protocolStateMachine = UML
.createProtocolStateMachine();
assertValid(protocolStateMachine);
literalReal10.setType(protocolStateMachine);
LiteralReal literalReal11 = UML.createLiteralReal();
assertValid(literalReal11);
UseCase useCase = UML.createUseCase();
assertValid(useCase);
literalReal11.setType(useCase);
Signal signal = UML.createSignal();
assertValid(signal);
literalReal11.setType(signal);
LiteralReal literalReal12 = UML.createLiteralReal();
assertValid(literalReal12);
Node node = UML.createNode();
assertValid(node);
literalReal12.setType(node);
Stereotype stereotype = UML.createStereotype();
assertValid(stereotype);
literalReal12.setType(stereotype);
LiteralReal literalReal13 = UML.createLiteralReal();
assertValid(literalReal13);
StateMachine stateMachine = UML.createStateMachine();
assertValid(stateMachine);
literalReal13.setType(stateMachine);
Artifact artifact = UML.createArtifact();
assertValid(artifact);
literalReal13.setType(artifact);
LiteralReal literalReal14 = UML.createLiteralReal();
assertValid(literalReal14);
Collaboration collaboration = UML.createCollaboration();
assertValid(collaboration);
literalReal14.setType(collaboration);
}
}