blob: 62ce4d213ac39259eb84012055211227d0013900 [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.LiteralBoolean;
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 LiteralBooleanTest
extends _Abstract_Compliance_Test_ {
public void testEAnnotations() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
EAnnotation eAnnotation = ECORE.createEAnnotation();
assertValid(eAnnotation);
literalBoolean.getEAnnotations().add(eAnnotation);
}
public void testOwnedComment() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
Comment comment = UML.createComment();
assertValid(comment);
literalBoolean.getOwnedComments().add(comment);
assertSuperset(literalBoolean.getOwnedElements().contains(comment));
}
public void testOwnedElement() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
EList<Element> elements = literalBoolean.getOwnedElements();
EList<Element> elements2 = literalBoolean.getOwnedElements();
assertSame(elements, elements2);
}
public void testClientDependency() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
EList<Dependency> dependencys = literalBoolean.getClientDependencies();
EList<Dependency> dependencys2 = literalBoolean.getClientDependencies();
assertSame(dependencys, dependencys2);
}
public void testNameExpression() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
StringExpression stringExpression = UML.createStringExpression();
assertValid(stringExpression);
literalBoolean.setNameExpression(stringExpression);
assertSuperset(
literalBoolean.getOwnedElements().contains(stringExpression));
}
public void testOwningTemplateParameter() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
literalBoolean.setOwningTemplateParameter(templateParameter);
assertSuperset(literalBoolean.getOwner() == templateParameter);
assertSuperset(
literalBoolean.getTemplateParameter() == templateParameter);
}
public void testTemplateParameter() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
TemplateParameter templateParameter = UML.createTemplateParameter();
assertValid(templateParameter);
literalBoolean.setTemplateParameter(templateParameter);
}
public void testType() {
LiteralBoolean literalBoolean = UML.createLiteralBoolean();
assertValid(literalBoolean);
FunctionBehavior functionBehavior = UML.createFunctionBehavior();
assertValid(functionBehavior);
literalBoolean.setType(functionBehavior);
Activity activity = UML.createActivity();
assertValid(activity);
literalBoolean.setType(activity);
LiteralBoolean literalBoolean2 = UML.createLiteralBoolean();
assertValid(literalBoolean2);
Interface interface_ = UML.createInterface();
assertValid(interface_);
literalBoolean2.setType(interface_);
InformationItem informationItem = UML.createInformationItem();
assertValid(informationItem);
literalBoolean2.setType(informationItem);
LiteralBoolean literalBoolean3 = UML.createLiteralBoolean();
assertValid(literalBoolean3);
CommunicationPath communicationPath = UML.createCommunicationPath();
assertValid(communicationPath);
literalBoolean3.setType(communicationPath);
ExecutionEnvironment executionEnvironment = UML
.createExecutionEnvironment();
assertValid(executionEnvironment);
literalBoolean3.setType(executionEnvironment);
LiteralBoolean literalBoolean4 = UML.createLiteralBoolean();
assertValid(literalBoolean4);
Component component = UML.createComponent();
assertValid(component);
literalBoolean4.setType(component);
Interaction interaction = UML.createInteraction();
assertValid(interaction);
literalBoolean4.setType(interaction);
LiteralBoolean literalBoolean5 = UML.createLiteralBoolean();
assertValid(literalBoolean5);
DeploymentSpecification deploymentSpecification = UML
.createDeploymentSpecification();
assertValid(deploymentSpecification);
literalBoolean5.setType(deploymentSpecification);
OpaqueBehavior opaqueBehavior = UML.createOpaqueBehavior();
assertValid(opaqueBehavior);
literalBoolean5.setType(opaqueBehavior);
LiteralBoolean literalBoolean6 = UML.createLiteralBoolean();
assertValid(literalBoolean6);
Association association = UML.createAssociation();
assertValid(association);
literalBoolean6.setType(association);
DataType dataType = UML.createDataType();
assertValid(dataType);
literalBoolean6.setType(dataType);
LiteralBoolean literalBoolean7 = UML.createLiteralBoolean();
assertValid(literalBoolean7);
Device device = UML.createDevice();
assertValid(device);
literalBoolean7.setType(device);
Extension extension = UML.createExtension();
assertValid(extension);
literalBoolean7.setType(extension);
LiteralBoolean literalBoolean8 = UML.createLiteralBoolean();
assertValid(literalBoolean8);
AssociationClass associationClass = UML.createAssociationClass();
assertValid(associationClass);
literalBoolean8.setType(associationClass);
org.eclipse.uml2.uml.Class class_ = UML.createClass();
assertValid(class_);
literalBoolean8.setType(class_);
LiteralBoolean literalBoolean9 = UML.createLiteralBoolean();
assertValid(literalBoolean9);
Enumeration enumeration = UML.createEnumeration();
assertValid(enumeration);
literalBoolean9.setType(enumeration);
PrimitiveType primitiveType = UML.createPrimitiveType();
assertValid(primitiveType);
literalBoolean9.setType(primitiveType);
LiteralBoolean literalBoolean10 = UML.createLiteralBoolean();
assertValid(literalBoolean10);
Actor actor = UML.createActor();
assertValid(actor);
literalBoolean10.setType(actor);
ProtocolStateMachine protocolStateMachine = UML
.createProtocolStateMachine();
assertValid(protocolStateMachine);
literalBoolean10.setType(protocolStateMachine);
LiteralBoolean literalBoolean11 = UML.createLiteralBoolean();
assertValid(literalBoolean11);
UseCase useCase = UML.createUseCase();
assertValid(useCase);
literalBoolean11.setType(useCase);
Signal signal = UML.createSignal();
assertValid(signal);
literalBoolean11.setType(signal);
LiteralBoolean literalBoolean12 = UML.createLiteralBoolean();
assertValid(literalBoolean12);
Node node = UML.createNode();
assertValid(node);
literalBoolean12.setType(node);
Stereotype stereotype = UML.createStereotype();
assertValid(stereotype);
literalBoolean12.setType(stereotype);
LiteralBoolean literalBoolean13 = UML.createLiteralBoolean();
assertValid(literalBoolean13);
StateMachine stateMachine = UML.createStateMachine();
assertValid(stateMachine);
literalBoolean13.setType(stateMachine);
Artifact artifact = UML.createArtifact();
assertValid(artifact);
literalBoolean13.setType(artifact);
LiteralBoolean literalBoolean14 = UML.createLiteralBoolean();
assertValid(literalBoolean14);
Collaboration collaboration = UML.createCollaboration();
assertValid(collaboration);
literalBoolean14.setType(collaboration);
}
}