| /* |
| * Copyright (c) 2003, 2005 IBM Corporation 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: |
| * IBM - initial API and implementation |
| * |
| * $Id: ActivityNodeTest.java,v 1.2 2005/04/20 19:00:46 khussey Exp $ |
| */ |
| package org.eclipse.uml2.tests; |
| |
| import java.util.Iterator; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.uml2.ActivityNode; |
| import org.eclipse.uml2.RedefinableElement; |
| import org.eclipse.uml2.UML2Factory; |
| import org.eclipse.uml2.UML2Package; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A test case for the model object '<em><b>Activity Node</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are tested: |
| * <ul> |
| * <li>{@link org.eclipse.uml2.ActivityNode#getInGroups() <em>In Group</em>}</li> |
| * <li>{@link org.eclipse.uml2.ActivityNode#getActivity() <em>Activity</em>}</li> |
| * </ul> |
| * </p> |
| * <p> |
| * The following operations are tested: |
| * <ul> |
| * <li>{@link org.eclipse.uml2.ActivityNode#getOwner() <em>Get Owner</em>}</li> |
| * </ul> |
| * </p> |
| * @generated |
| */ |
| public abstract class ActivityNodeTest extends RedefinableElementTest { |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = "Copyright (c) 2003, 2005 IBM Corporation and others."; //$NON-NLS-1$ |
| |
| /** |
| * Constructs a new Activity Node test case with the given name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ActivityNodeTest(String name) { |
| super(name); |
| } |
| |
| /** |
| * Returns the fixture for this Activity Node test case. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private ActivityNode getFixture() { |
| return (ActivityNode)fixture; |
| } |
| |
| /** |
| * Tests the '{@link org.eclipse.uml2.ActivityNode#getInGroups() <em>In Group</em>}' feature getter. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.uml2.ActivityNode#getInGroups() |
| * @generated |
| */ |
| public void testGetInGroupsGen() { |
| // TODO: implement this feature getter test method |
| // Ensure that you remove @generated or mark it @generated NOT |
| } |
| |
| public void testGetInGroups() { |
| testGetInGroupsGen(); |
| |
| getFixture().setInStructuredNode(UML2Factory.eINSTANCE.createStructuredActivityNode()); |
| |
| getFixture().getInPartitions().add(UML2Factory.eINSTANCE.createActivityPartition()); |
| getFixture().getInPartitions().add(UML2Factory.eINSTANCE.createActivityPartition()); |
| |
| getFixture().getInInterruptibleRegions().add(UML2Factory.eINSTANCE.createInterruptibleActivityRegion()); |
| getFixture().getInInterruptibleRegions().add(UML2Factory.eINSTANCE.createInterruptibleActivityRegion()); |
| |
| assertTrue(getFixture().getInGroups().contains(getFixture().getInStructuredNode())); |
| |
| assertTrue(getFixture().getInGroups().containsAll(getFixture().getInPartitions())); |
| |
| assertTrue(getFixture().getInGroups().containsAll(getFixture().getInInterruptibleRegions())); |
| } |
| |
| /** |
| * Tests the '{@link org.eclipse.uml2.ActivityNode#getActivity() <em>Activity</em>}' feature getter. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.uml2.ActivityNode#getActivity() |
| * @generated |
| */ |
| public void testGetActivity() { |
| // TODO: implement this feature getter test method |
| // Ensure that you remove @generated or mark it @generated NOT |
| } |
| |
| /** |
| * Tests the '{@link org.eclipse.uml2.ActivityNode#setActivity(org.eclipse.uml2.Activity) <em>Activity</em>}' feature setter. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.uml2.ActivityNode#setActivity(org.eclipse.uml2.Activity) |
| * @generated |
| */ |
| public void testSetActivity() { |
| // TODO: implement this feature setter test method |
| // Ensure that you remove @generated or mark it @generated NOT |
| } |
| |
| /** |
| * Tests the '{@link org.eclipse.uml2.ActivityNode#getOwner() <em>Get Owner</em>}' getter operation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.uml2.ActivityNode#getOwner() |
| * @generated |
| */ |
| public void testGetOwnerGen() { |
| // TODO: implement this getter operation test method |
| // Ensure that you remove @generated or mark it @generated NOT |
| } |
| |
| public void testGetOwner() { |
| testGetOwnerGen(); |
| |
| super.testGetOwner(); |
| |
| if (null != getFixture().getActivity()) { |
| assertSame(getFixture().getActivity(), getFixture().getOwner()); |
| } |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.uml2.impl.tests.RedefinableElementImplTest#testGetRedefinedElements() |
| */ |
| public void testGetRedefinedElements() { |
| |
| for (Iterator eAllSubClasses = getEAllSubClasses(UML2Package.eINSTANCE.getRedefinableElement()).iterator(); eAllSubClasses.hasNext();) { |
| RedefinableElement redefinableElement = (RedefinableElement) UML2Factory.eINSTANCE.create((EClass) eAllSubClasses.next()); |
| |
| try { |
| getFixture().getRedefinedElements().add(redefinableElement); |
| |
| assertTrue(getFixture().getRedefinedElements().contains(redefinableElement)); |
| } catch (Exception e) { |
| assertFalse(ActivityNode.class.isInstance(redefinableElement)); |
| } |
| } |
| } |
| |
| } //ActivityNodeImplTest |