| /* |
| * 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.Dependency; |
| import org.eclipse.uml2.uml.Element; |
| import org.eclipse.uml2.uml.StringExpression; |
| import org.eclipse.uml2.uml.TemplateParameter; |
| import org.eclipse.uml2.uml.TimeEvent; |
| import org.eclipse.uml2.uml.TimeExpression; |
| |
| /** |
| * @author Eike Stepper |
| */ |
| public class TimeEventTest |
| extends _Abstract_Compliance_Test_ { |
| |
| public void testEAnnotations() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| EAnnotation eAnnotation = ECORE.createEAnnotation(); |
| assertValid(eAnnotation); |
| timeEvent.getEAnnotations().add(eAnnotation); |
| } |
| |
| public void testOwnedComment() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| Comment comment = UML.createComment(); |
| assertValid(comment); |
| timeEvent.getOwnedComments().add(comment); |
| assertSuperset(timeEvent.getOwnedElements().contains(comment)); |
| } |
| |
| public void testOwnedElement() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| EList<Element> elements = timeEvent.getOwnedElements(); |
| EList<Element> elements2 = timeEvent.getOwnedElements(); |
| assertSame(elements, elements2); |
| } |
| |
| public void testClientDependency() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| EList<Dependency> dependencys = timeEvent.getClientDependencies(); |
| EList<Dependency> dependencys2 = timeEvent.getClientDependencies(); |
| assertSame(dependencys, dependencys2); |
| } |
| |
| public void testNameExpression() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| StringExpression stringExpression = UML.createStringExpression(); |
| assertValid(stringExpression); |
| timeEvent.setNameExpression(stringExpression); |
| assertSuperset(timeEvent.getOwnedElements().contains(stringExpression)); |
| } |
| |
| public void testOwningTemplateParameter() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| TemplateParameter templateParameter = UML.createTemplateParameter(); |
| assertValid(templateParameter); |
| timeEvent.setOwningTemplateParameter(templateParameter); |
| assertSuperset(timeEvent.getOwner() == templateParameter); |
| assertSuperset(timeEvent.getTemplateParameter() == templateParameter); |
| } |
| |
| public void testTemplateParameter() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| TemplateParameter templateParameter = UML.createTemplateParameter(); |
| assertValid(templateParameter); |
| timeEvent.setTemplateParameter(templateParameter); |
| } |
| |
| public void testWhen() { |
| TimeEvent timeEvent = UML.createTimeEvent(); |
| assertValid(timeEvent); |
| |
| TimeExpression timeExpression = UML.createTimeExpression(); |
| assertValid(timeExpression); |
| timeEvent.setWhen(timeExpression); |
| assertSuperset(timeEvent.getOwnedElements().contains(timeExpression)); |
| } |
| |
| } |