blob: 4e808d3159ab58a4ef3b20e4277c00755a9237e8 [file] [log] [blame]
/*
* 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: ConstraintTest.java,v 1.2 2005/04/20 19:00:46 khussey Exp $
*/
package org.eclipse.uml2.tests;
import junit.textui.TestRunner;
import org.eclipse.uml2.Constraint;
import org.eclipse.uml2.UML2Factory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Constraint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are tested:
* <ul>
* <li>{@link org.eclipse.uml2.Constraint#getContext() <em>Context</em>}</li>
* <li>{@link org.eclipse.uml2.Constraint#getNamespace() <em>Namespace</em>}</li>
* <li>{@link org.eclipse.uml2.Constraint#getSpecification() <em>Specification</em>}</li>
* </ul>
* </p>
* <p>
* The following operations are tested:
* <ul>
* <li>{@link org.eclipse.uml2.Constraint#validateNotApplyToSelf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Not Apply To Self</em>}</li>
* <li>{@link org.eclipse.uml2.Constraint#getOwnedElements() <em>Get Owned Elements</em>}</li>
* </ul>
* </p>
* @generated
*/
public class ConstraintTest extends PackageableElementTest {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2003, 2005 IBM Corporation and others."; //$NON-NLS-1$
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(ConstraintTest.class);
}
/**
* Constructs a new Constraint test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstraintTest(String name) {
super(name);
}
/**
* Returns the fixture for this Constraint test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private Constraint getFixture() {
return (Constraint)fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
protected void setUp() throws Exception {
setFixture(UML2Factory.eINSTANCE.createConstraint());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
protected void tearDown() throws Exception {
setFixture(null);
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#getContext() <em>Context</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#getContext()
* @generated
*/
public void testGetContextGen() {
// TODO: implement this feature getter test method
// Ensure that you remove @generated or mark it @generated NOT
}
public void testGetContext() {
testGetContextGen();
setUpNamespace();
assertSame(getFixture().getNamespace(), getFixture().getContext());
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#getNamespace() <em>Namespace</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#getNamespace()
* @generated
*/
public void testGetNamespace() {
// TODO: implement this feature getter test method
// Ensure that you remove @generated or mark it @generated NOT
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#setNamespace(org.eclipse.uml2.Namespace) <em>Namespace</em>}' feature setter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#setNamespace(org.eclipse.uml2.Namespace)
* @generated
*/
public void testSetNamespace() {
// TODO: implement this feature setter test method
// Ensure that you remove @generated or mark it @generated NOT
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#getSpecification() <em>Specification</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#getSpecification()
* @generated
*/
public void testGetSpecification() {
// TODO: implement this feature getter test method
// Ensure that you remove @generated or mark it @generated NOT
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#setSpecification(org.eclipse.uml2.ValueSpecification) <em>Specification</em>}' feature setter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#setSpecification(org.eclipse.uml2.ValueSpecification)
* @generated
*/
public void testSetSpecification() {
// TODO: implement this feature setter test method
// Ensure that you remove @generated or mark it @generated NOT
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#validateNotApplyToSelf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Not Apply To Self</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#validateNotApplyToSelf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
* @generated
*/
public void testValidateNotApplyToSelf__DiagnosticChain_Map() {
// TODO: implement this operation test method
// Ensure that you remove @generated or mark it @generated NOT
}
/**
* Tests the '{@link org.eclipse.uml2.Constraint#getOwnedElements() <em>Get Owned Elements</em>}' getter operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.Constraint#getOwnedElements()
* @generated
*/
public void testGetOwnedElementsGen() {
// TODO: implement this getter operation test method
// Ensure that you remove @generated or mark it @generated NOT
}
public void testGetOwnedElements() {
testGetOwnedElementsGen();
super.testGetOwnedElements();
assertTrue(getFixture().getOwnedElements().contains(getFixture().getSpecification()));
}
/* (non-Javadoc)
* @see org.eclipse.uml2.impl.tests.NamedElementImplTest#setUpNamespace()
*/
protected void setUpNamespace() {
UML2Factory.eINSTANCE.createPackage().getOwnedRules().add(getFixture());
}
/* (non-Javadoc)
* @see org.eclipse.uml2.impl.tests.ElementImplTest#setUpOwner()
*/
protected void setUpOwner() {
UML2Factory.eINSTANCE.createTemplateParameter().setOwnedParameteredElement(getFixture());
}
/* (non-Javadoc)
* @see org.eclipse.uml2.impl.tests.ElementImplTest#setUpOwnedElements()
*/
protected void setUpOwnedElements() {
super.setUpOwnedElements();
getFixture().setSpecification(UML2Factory.eINSTANCE.createLiteralString());
}
} //ConstraintImplTest