)arguments.get(1));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} //AlwaysPassiveJavaImpl
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfileFactoryImpl.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfileFactoryImpl.java
new file mode 100644
index 00000000000..d28d40292f6
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfileFactoryImpl.java
@@ -0,0 +1,128 @@
+/**
+ */
+package profile.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import profile.*;
+
+/**
+ *
+ * An implementation of the model Factory .
+ *
+ * @generated
+ */
+public class ProfileFactoryImpl extends EFactoryImpl implements ProfileFactory {
+ /**
+ * Creates the default factory implementation.
+ *
+ *
+ * @generated
+ */
+ public static ProfileFactory init() {
+ try {
+ ProfileFactory theProfileFactory = (ProfileFactory)EPackage.Registry.INSTANCE.getEFactory(ProfilePackage.eNS_URI);
+ if (theProfileFactory != null) {
+ return theProfileFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new ProfileFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ *
+ *
+ * @generated
+ */
+ public ProfileFactoryImpl() {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case ProfilePackage.ALWAYS_ACTIVE: return createAlwaysActive();
+ case ProfilePackage.TST: return createTst();
+ case ProfilePackage.ALWAYS_ACTIVE_MALFORMED: return createAlwaysActiveMalformed();
+ case ProfilePackage.ALWAYS_PASSIVE_JAVA: return createAlwaysPassiveJava();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AlwaysActive createAlwaysActive() {
+ AlwaysActiveImpl alwaysActive = new AlwaysActiveImpl();
+ return alwaysActive;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Tst createTst() {
+ TstImpl tst = new TstImpl();
+ return tst;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AlwaysActiveMalformed createAlwaysActiveMalformed() {
+ AlwaysActiveMalformedImpl alwaysActiveMalformed = new AlwaysActiveMalformedImpl();
+ return alwaysActiveMalformed;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AlwaysPassiveJava createAlwaysPassiveJava() {
+ AlwaysPassiveJavaImpl alwaysPassiveJava = new AlwaysPassiveJavaImpl();
+ return alwaysPassiveJava;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ProfilePackage getProfilePackage() {
+ return (ProfilePackage)getEPackage();
+ }
+
+ /**
+ *
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static ProfilePackage getPackage() {
+ return ProfilePackage.eINSTANCE;
+ }
+
+} //ProfileFactoryImpl
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfilePackageImpl.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfilePackageImpl.java
new file mode 100644
index 00000000000..7919f616184
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/ProfilePackageImpl.java
@@ -0,0 +1,384 @@
+/**
+ */
+package profile.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EGenericType;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EValidator;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.uml2.uml.UMLPackage;
+
+import profile.AlwaysActive;
+import profile.AlwaysActiveMalformed;
+import profile.AlwaysPassiveJava;
+import profile.ProfileFactory;
+import profile.ProfilePackage;
+import profile.Tst;
+
+import profile.util.ProfileValidator;
+
+/**
+ *
+ * An implementation of the model Package .
+ *
+ * @generated
+ */
+public class ProfilePackageImpl extends EPackageImpl implements ProfilePackage {
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass alwaysActiveEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass tstEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass alwaysActiveMalformedEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass alwaysPassiveJavaEClass = null;
+
+ /**
+ * Creates an instance of the model Package , registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ *
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see profile.ProfilePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private ProfilePackageImpl() {
+ super(eNS_URI, ProfileFactory.eINSTANCE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the Package for this model, and for any others upon which it depends.
+ *
+ *
This method is used to initialize {@link ProfilePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ *
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static ProfilePackage init() {
+ if (isInited) return (ProfilePackage)EPackage.Registry.INSTANCE.getEPackage(ProfilePackage.eNS_URI);
+
+ // Obtain or create and register package
+ ProfilePackageImpl theProfilePackage = (ProfilePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ProfilePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ProfilePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ UMLPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theProfilePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theProfilePackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put
+ (theProfilePackage,
+ new EValidator.Descriptor() {
+ public EValidator getEValidator() {
+ return ProfileValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theProfilePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(ProfilePackage.eNS_URI, theProfilePackage);
+ return theProfilePackage;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAlwaysActive() {
+ return alwaysActiveEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAlwaysActive_Base_Class() {
+ return (EReference)alwaysActiveEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getAlwaysActive__ConstraintAlwaysActive__DiagnosticChain_Map() {
+ return alwaysActiveEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getTst() {
+ return tstEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getTst_Base_Package() {
+ return (EReference)tstEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAlwaysActiveMalformed() {
+ return alwaysActiveMalformedEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAlwaysActiveMalformed_Base_Class() {
+ return (EReference)alwaysActiveMalformedEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getAlwaysActiveMalformed__ConstraintAlwaysActiveMF__DiagnosticChain_Map() {
+ return alwaysActiveMalformedEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAlwaysPassiveJava() {
+ return alwaysPassiveJavaEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getAlwaysPassiveJava_Base_Class() {
+ return (EReference)alwaysPassiveJavaEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getAlwaysPassiveJava__AlwaysPassive__DiagnosticChain_Map() {
+ return alwaysPassiveJavaEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ProfileFactory getProfileFactory() {
+ return (ProfileFactory)getEFactoryInstance();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ alwaysActiveEClass = createEClass(ALWAYS_ACTIVE);
+ createEReference(alwaysActiveEClass, ALWAYS_ACTIVE__BASE_CLASS);
+ createEOperation(alwaysActiveEClass, ALWAYS_ACTIVE___CONSTRAINT_ALWAYS_ACTIVE__DIAGNOSTICCHAIN_MAP);
+
+ tstEClass = createEClass(TST);
+ createEReference(tstEClass, TST__BASE_PACKAGE);
+
+ alwaysActiveMalformedEClass = createEClass(ALWAYS_ACTIVE_MALFORMED);
+ createEReference(alwaysActiveMalformedEClass, ALWAYS_ACTIVE_MALFORMED__BASE_CLASS);
+ createEOperation(alwaysActiveMalformedEClass, ALWAYS_ACTIVE_MALFORMED___CONSTRAINT_ALWAYS_ACTIVE_MF__DIAGNOSTICCHAIN_MAP);
+
+ alwaysPassiveJavaEClass = createEClass(ALWAYS_PASSIVE_JAVA);
+ createEReference(alwaysPassiveJavaEClass, ALWAYS_PASSIVE_JAVA__BASE_CLASS);
+ createEOperation(alwaysPassiveJavaEClass, ALWAYS_PASSIVE_JAVA___ALWAYS_PASSIVE__DIAGNOSTICCHAIN_MAP);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(alwaysActiveEClass, AlwaysActive.class, "AlwaysActive", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getAlwaysActive_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, AlwaysActive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+
+ EOperation op = initEOperation(getAlwaysActive__ConstraintAlwaysActive__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "ConstraintAlwaysActive", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED);
+ EGenericType g1 = createEGenericType(ecorePackage.getEMap());
+ EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(tstEClass, Tst.class, "Tst", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getTst_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, Tst.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+
+ initEClass(alwaysActiveMalformedEClass, AlwaysActiveMalformed.class, "AlwaysActiveMalformed", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getAlwaysActiveMalformed_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, AlwaysActiveMalformed.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+
+ op = initEOperation(getAlwaysActiveMalformed__ConstraintAlwaysActiveMF__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "ConstraintAlwaysActiveMF", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED);
+ g1 = createEGenericType(ecorePackage.getEMap());
+ g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(alwaysPassiveJavaEClass, AlwaysPassiveJava.class, "AlwaysPassiveJava", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getAlwaysPassiveJava_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, AlwaysPassiveJava.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+
+ op = initEOperation(getAlwaysPassiveJava__AlwaysPassive__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "AlwaysPassive", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED);
+ g1 = createEGenericType(ecorePackage.getEMap());
+ g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ g2 = createEGenericType(ecorePackage.getEJavaObject());
+ g1.getETypeArguments().add(g2);
+ addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://www.eclipse.org/uml2/1.1.0/GenModel
+ createGenModelAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for http://www.eclipse.org/uml2/1.1.0/GenModel .
+ *
+ *
+ * @generated
+ */
+ protected void createGenModelAnnotations() {
+ String source = "http://www.eclipse.org/uml2/1.1.0/GenModel";
+ addAnnotation
+ (getAlwaysActive__ConstraintAlwaysActive__DiagnosticChain_Map(),
+ source,
+ new String[] {
+ "body", "base_Class.isActive"
+ });
+ addAnnotation
+ (getAlwaysActiveMalformed__ConstraintAlwaysActiveMF__DiagnosticChain_Map(),
+ source,
+ new String[] {
+ "body", "self.oclAsType(Class).isActive"
+ });
+ addAnnotation
+ (getAlwaysPassiveJava__AlwaysPassive__DiagnosticChain_Map(),
+ source,
+ new String[] {
+ "body", "return !self.getBase_Class().isActive();"
+ });
+ }
+
+} //ProfilePackageImpl
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/TstImpl.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/TstImpl.java
new file mode 100644
index 00000000000..5b39987d73c
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/impl/TstImpl.java
@@ -0,0 +1,156 @@
+/**
+ */
+package profile.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import profile.ProfilePackage;
+import profile.Tst;
+
+/**
+ *
+ * An implementation of the model object 'Tst '.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * {@link profile.impl.TstImpl#getBase_Package Base Package }
+ *
+ *
+ * @generated
+ */
+public class TstImpl extends MinimalEObjectImpl.Container implements Tst {
+ /**
+ * The cached value of the '{@link #getBase_Package() Base Package }' reference.
+ *
+ *
+ * @see #getBase_Package()
+ * @generated
+ * @ordered
+ */
+ protected org.eclipse.uml2.uml.Package base_Package;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected TstImpl() {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ProfilePackage.Literals.TST;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public org.eclipse.uml2.uml.Package getBase_Package() {
+ if (base_Package != null && base_Package.eIsProxy()) {
+ InternalEObject oldBase_Package = (InternalEObject)base_Package;
+ base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package);
+ if (base_Package != oldBase_Package) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProfilePackage.TST__BASE_PACKAGE, oldBase_Package, base_Package));
+ }
+ }
+ return base_Package;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public org.eclipse.uml2.uml.Package basicGetBase_Package() {
+ return base_Package;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) {
+ org.eclipse.uml2.uml.Package oldBase_Package = base_Package;
+ base_Package = newBase_Package;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ProfilePackage.TST__BASE_PACKAGE, oldBase_Package, base_Package));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ProfilePackage.TST__BASE_PACKAGE:
+ if (resolve) return getBase_Package();
+ return basicGetBase_Package();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ProfilePackage.TST__BASE_PACKAGE:
+ setBase_Package((org.eclipse.uml2.uml.Package)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ProfilePackage.TST__BASE_PACKAGE:
+ setBase_Package((org.eclipse.uml2.uml.Package)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ProfilePackage.TST__BASE_PACKAGE:
+ return base_Package != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //TstImpl
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileAdapterFactory.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileAdapterFactory.java
new file mode 100644
index 00000000000..2f4c9374d6f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileAdapterFactory.java
@@ -0,0 +1,174 @@
+/**
+ */
+package profile.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import profile.*;
+
+/**
+ *
+ * The Adapter Factory for the model.
+ * It provides an adapter createXXX
method for each class of the model.
+ *
+ * @see profile.ProfilePackage
+ * @generated
+ */
+public class ProfileAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ *
+ *
+ * @generated
+ */
+ protected static ProfilePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ *
+ *
+ * @generated
+ */
+ public ProfileAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = ProfilePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ *
+ * This implementation returns true
if the object is either the model's package or is an instance object of the model.
+ *
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the createXXX
methods.
+ *
+ *
+ * @generated
+ */
+ protected ProfileSwitch modelSwitch =
+ new ProfileSwitch() {
+ @Override
+ public Adapter caseAlwaysActive(AlwaysActive object) {
+ return createAlwaysActiveAdapter();
+ }
+ @Override
+ public Adapter caseTst(Tst object) {
+ return createTstAdapter();
+ }
+ @Override
+ public Adapter caseAlwaysActiveMalformed(AlwaysActiveMalformed object) {
+ return createAlwaysActiveMalformedAdapter();
+ }
+ @Override
+ public Adapter caseAlwaysPassiveJava(AlwaysPassiveJava object) {
+ return createAlwaysPassiveJavaAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the target
.
+ *
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the target
.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link profile.AlwaysActive Always Active }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see profile.AlwaysActive
+ * @generated
+ */
+ public Adapter createAlwaysActiveAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link profile.Tst Tst }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see profile.Tst
+ * @generated
+ */
+ public Adapter createTstAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link profile.AlwaysActiveMalformed Always Active Malformed }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see profile.AlwaysActiveMalformed
+ * @generated
+ */
+ public Adapter createAlwaysActiveMalformedAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link profile.AlwaysPassiveJava Always Passive Java }'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see profile.AlwaysPassiveJava
+ * @generated
+ */
+ public Adapter createAlwaysPassiveJavaAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ *
+ * This default implementation returns null.
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //ProfileAdapterFactory
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileSwitch.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileSwitch.java
new file mode 100644
index 00000000000..2eab23ad54b
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileSwitch.java
@@ -0,0 +1,173 @@
+/**
+ */
+package profile.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import profile.*;
+
+/**
+ *
+ * The Switch for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the caseXXX
method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ *
+ * @see profile.ProfilePackage
+ * @generated
+ */
+public class ProfileSwitch extends Switch {
+ /**
+ * The cached model package
+ *
+ *
+ * @generated
+ */
+ protected static ProfilePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ *
+ *
+ * @generated
+ */
+ public ProfileSwitch() {
+ if (modelPackage == null) {
+ modelPackage = ProfilePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ *
+ *
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
+ *
+ *
+ * @return the first non-null result returned by a caseXXX
call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case ProfilePackage.ALWAYS_ACTIVE: {
+ AlwaysActive alwaysActive = (AlwaysActive)theEObject;
+ T result = caseAlwaysActive(alwaysActive);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ProfilePackage.TST: {
+ Tst tst = (Tst)theEObject;
+ T result = caseTst(tst);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ProfilePackage.ALWAYS_ACTIVE_MALFORMED: {
+ AlwaysActiveMalformed alwaysActiveMalformed = (AlwaysActiveMalformed)theEObject;
+ T result = caseAlwaysActiveMalformed(alwaysActiveMalformed);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ProfilePackage.ALWAYS_PASSIVE_JAVA: {
+ AlwaysPassiveJava alwaysPassiveJava = (AlwaysPassiveJava)theEObject;
+ T result = caseAlwaysPassiveJava(alwaysPassiveJava);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Always Active '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Always Active '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAlwaysActive(AlwaysActive object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Tst '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Tst '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTst(Tst object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Always Active Malformed '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Always Active Malformed '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAlwaysActiveMalformed(AlwaysActiveMalformed object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Always Passive Java '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Always Passive Java '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAlwaysPassiveJava(AlwaysPassiveJava object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'EObject '.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'EObject '.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //ProfileSwitch
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileValidator.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileValidator.java
new file mode 100644
index 00000000000..e7cd93c5d18
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src-gen/profile/util/ProfileValidator.java
@@ -0,0 +1,235 @@
+/**
+ */
+package profile.util;
+
+import java.util.Map;
+
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.EObjectValidator;
+
+import profile.*;
+
+/**
+ *
+ * The Validator for the model.
+ *
+ * @see profile.ProfilePackage
+ * @generated
+ */
+public class ProfileValidator extends EObjectValidator {
+ /**
+ * The cached model package
+ *
+ *
+ * @generated
+ */
+ public static final ProfileValidator INSTANCE = new ProfileValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ *
+ *
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "profile";
+
+ /**
+ * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Constraint Always Active' of 'Always Active'.
+ *
+ *
+ * @generated
+ */
+ public static final int ALWAYS_ACTIVE__CONSTRAINT_ALWAYS_ACTIVE = 1;
+
+ /**
+ * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Constraint Always Active MF' of 'Always Active Malformed'.
+ *
+ *
+ * @generated
+ */
+ public static final int ALWAYS_ACTIVE_MALFORMED__CONSTRAINT_ALWAYS_ACTIVE_MF = 2;
+
+ /**
+ * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Always Passive' of 'Always Passive Java'.
+ *
+ *
+ * @generated
+ */
+ public static final int ALWAYS_PASSIVE_JAVA__ALWAYS_PASSIVE = 3;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ *
+ *
+ * @generated
+ */
+ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 3;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ *
+ *
+ * @generated
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
+
+ /**
+ * Creates an instance of the switch.
+ *
+ *
+ * @generated
+ */
+ public ProfileValidator() {
+ super();
+ }
+
+ /**
+ * Returns the package of this validator switch.
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EPackage getEPackage() {
+ return ProfilePackage.eINSTANCE;
+ }
+
+ /**
+ * Calls validateXXX
for the corresponding classifier of the model.
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map context) {
+ switch (classifierID) {
+ case ProfilePackage.ALWAYS_ACTIVE:
+ return validateAlwaysActive((AlwaysActive)value, diagnostics, context);
+ case ProfilePackage.TST:
+ return validateTst((Tst)value, diagnostics, context);
+ case ProfilePackage.ALWAYS_ACTIVE_MALFORMED:
+ return validateAlwaysActiveMalformed((AlwaysActiveMalformed)value, diagnostics, context);
+ case ProfilePackage.ALWAYS_PASSIVE_JAVA:
+ return validateAlwaysPassiveJava((AlwaysPassiveJava)value, diagnostics, context);
+ default:
+ return true;
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysActive(AlwaysActive alwaysActive, DiagnosticChain diagnostics, Map context) {
+ if (!validate_NoCircularContainment(alwaysActive, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(alwaysActive, diagnostics, context);
+ if (result || diagnostics != null) result &= validateAlwaysActive_ConstraintAlwaysActive(alwaysActive, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * Validates the ConstraintAlwaysActive constraint of 'Always Active '.
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysActive_ConstraintAlwaysActive(AlwaysActive alwaysActive, DiagnosticChain diagnostics, Map context) {
+ return alwaysActive.ConstraintAlwaysActive(diagnostics, context);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean validateTst(Tst tst, DiagnosticChain diagnostics, Map context) {
+ return validate_EveryDefaultConstraint(tst, diagnostics, context);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysActiveMalformed(AlwaysActiveMalformed alwaysActiveMalformed, DiagnosticChain diagnostics, Map context) {
+ if (!validate_NoCircularContainment(alwaysActiveMalformed, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(alwaysActiveMalformed, diagnostics, context);
+ if (result || diagnostics != null) result &= validateAlwaysActiveMalformed_ConstraintAlwaysActiveMF(alwaysActiveMalformed, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * Validates the ConstraintAlwaysActiveMF constraint of 'Always Active Malformed '.
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysActiveMalformed_ConstraintAlwaysActiveMF(AlwaysActiveMalformed alwaysActiveMalformed, DiagnosticChain diagnostics, Map context) {
+ return alwaysActiveMalformed.ConstraintAlwaysActiveMF(diagnostics, context);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysPassiveJava(AlwaysPassiveJava alwaysPassiveJava, DiagnosticChain diagnostics, Map context) {
+ if (!validate_NoCircularContainment(alwaysPassiveJava, diagnostics, context)) return false;
+ boolean result = validate_EveryMultiplicityConforms(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryDataValueConforms(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryProxyResolves(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_UniqueID(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryKeyUnique(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(alwaysPassiveJava, diagnostics, context);
+ if (result || diagnostics != null) result &= validateAlwaysPassiveJava_AlwaysPassive(alwaysPassiveJava, diagnostics, context);
+ return result;
+ }
+
+ /**
+ * Validates the AlwaysPassive constraint of 'Always Passive Java '.
+ *
+ *
+ * @generated
+ */
+ public boolean validateAlwaysPassiveJava_AlwaysPassive(AlwaysPassiveJava alwaysPassiveJava, DiagnosticChain diagnostics, Map context) {
+ return alwaysPassiveJava.AlwaysPassive(diagnostics, context);
+ }
+
+ /**
+ * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
+ *
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ // TODO
+ // Specialize this to return a resource locator for messages specific to this validator.
+ // Ensure that you remove @generated or mark it @generated NOT
+ return super.getResourceLocator();
+ }
+
+} //ProfileValidator
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src/org/eclipse/papyrus/uml/validation/tests/staticprofile/Activator.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src/org/eclipse/papyrus/uml/validation/tests/staticprofile/Activator.java
new file mode 100644
index 00000000000..982fd2e175d
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/src/org/eclipse/papyrus/uml/validation/tests/staticprofile/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.papyrus.uml.validation.tests.staticprofile;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.validation.tests.staticprofile"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.classpath b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.project b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.project
new file mode 100644
index 00000000000..baf5b5828b9
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.uml.validation.tests
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..410244d65a6
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=/**\n * @return the ${bare_field_name}\n */ /**\n * @param ${param} the ${bare_field_name} to set\n */ /**\n * Constructor.\n *\n * ${tags}\n */ /*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n /**\n * @author ${user}\n *\n * ${tags}\n */ /**\n * \n */ /**\n * ${tags}\n */ /**\n * ${see_to_overridden}\n *\n * ${tags}\n */ /**\n * ${see_to_target}\n *\n * ${tags}\n */ ${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration} \n \n \n \n // ${todo} Auto-generated catch block\n${exception_var}.printStackTrace(); // ${todo} Auto-generated method stub\n${body_statement} ${body_statement}\n// ${todo} Auto-generated constructor stub return ${field}; ${field} \= ${param};
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..37bdf767b12
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,46 @@
+Manifest-Version: 1.0
+Bundle-Description: Tests for validation rules of the UmlRT profile
+Bundle-SymbolicName: org.eclipse.papyrus.uml.validation.tests;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-ClassPath: .
+Bundle-Name: %pluginName
+Require-Bundle: org.eclipse.papyrus.junit.utils;bundle-version="1.2.0",
+ org.junit,
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.6.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.services.validation;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.service.validation;bundle-version="1.2.0",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0",
+ org.eclipse.uml2.uml;bundle-version="5.0.0";visibility:=reexport,
+ org.eclipse.ui.navigator;bundle-version="3.5.400",
+ org.eclipse.ui.ide;bundle-version="3.10.0",
+ org.eclipse.ui,
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0",
+ org.eclipse.papyrus.junit.framework;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.emf.facet.util.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.2.0",
+ org.eclipse.emf.workspace;bundle-version="1.5.1",
+ org.eclipse.emf.validation,
+ org.eclipse.emf.transaction;bundle-version="1.8.0",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.uml2.types;visibility:=reexport,
+ org.eclipse.core.resources;bundle-version="3.9.0",
+ org.eclipse.ocl.pivot;bundle-version="1.1.0",
+ org.eclipse.ocl;bundle-version="3.5.100",
+ org.eclipse.ocl.xtext.completeocl;bundle-version="1.1.0",
+ org.eclipse.papyrus.dsml.validation
+Bundle-ActivationPolicy: lazy
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.uml.validation.tests.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.papyrus.uml.validation.tests,
+ org.eclipse.papyrus.uml.validation.tests.rules
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/about.html b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+About This Content
+
+November 14, 2008
+License
+
+The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at http://www.eclipse.org/legal/epl-v10.html .
+For purposes of the EPL, "Program" will mean the Content.
+
+If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org .
+
+
+
\ No newline at end of file
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/build.properties b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/build.properties
new file mode 100644
index 00000000000..fcf7058002e
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ resources/,\
+ META-INF/,\
+ plugin.properties,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/plugin.properties b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/plugin.properties
new file mode 100644
index 00000000000..07f9a91b3c2
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/plugin.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2015 CEA LIST.
+# 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:
+# Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - initial API and implementation
+################################################################################
+pluginName=Papyrus UML validation tests
+pluginProvider=Eclipse Modeling Project
+providerName = www.example.org
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml
new file mode 100644
index 00000000000..f1dfbdf15f6
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+
+ org.eclipse.papyrus
+ org.eclipse.papyrus.tests.releng
+ 1.2.0-SNAPSHOT
+ ../../../../../../releng/main-tests
+
+ org.eclipse.papyrus
+ org.eclipse.papyrus.uml.validation.tests
+ 1.2.0-SNAPSHOT
+ eclipse-test-plugin
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/ExtraUMLValidation.ocl b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/ExtraUMLValidation.ocl
new file mode 100644
index 00000000000..d859fa0da47
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/ExtraUMLValidation.ocl
@@ -0,0 +1,5 @@
+import uml : 'http://www.eclipse.org/uml2/5.0.0/UML#/'
+
+context uml::Class
+
+inv CamelCaseName : name.at(1)=name.at(1).toUpperCase()
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.notation
new file mode 100644
index 00000000000..b8ee8d5e4d5
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.notation
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ multiplicity
+ name
+ derived
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.uml
new file mode 100644
index 00000000000..33d49eb1f7e
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/UMLValidationTests.uml
@@ -0,0 +1,27 @@
+
+
+
+
+ Check a simple standard UML constraint: elements in the same namespace must have unique names
+
+
+
+
+
+
+ The attribute in this class has a non-integer multiplicity. This must not be detected as a failure
+
+
+
+
+
+
+
+
+
+
+ This naming of this class is normally valid. However, the test loads an OCL constraint from a file that checks that all classes start with an upper case letter, i.e. this class violates this constraints.
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.notation
new file mode 100644
index 00000000000..bf66ab27ffc
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.notation
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.uml
new file mode 100644
index 00000000000..14bb7691204
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-definition.uml
@@ -0,0 +1,30 @@
+
+
+
+
+ An inactive class with the stereotype AlwaysActive. This stereotype has an OCL constraint that verifies that the class is active. Thus, the class violates the constraints
+
+
+ An active class with the stereotype AlwaysActiveMalformed. This stereotype has an OCL constraint which is not well formed. Validation should result in an error reporting the mal-formedness
+
+
+ This model applies a profile with constraints embedded into the profile definition. This is currently only possible for OCL constraints
+
+
+ An inacitve class with the stereotype AlwaysActive. The stereotype constraint is violated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.notation
new file mode 100644
index 00000000000..32e022abd34
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.notation
@@ -0,0 +1,238 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.uml
new file mode 100644
index 00000000000..02f900b938b
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active-tst.rule-in-plugin.uml
@@ -0,0 +1,34 @@
+
+
+
+
+ An inactive class with the stereotype AlwaysActive. This stereotype has an OCL constraint that verifies that the class is active. Thus, the class violates the constraints
+
+
+ An active class with the stereotype AlwaysActiveMalformed. This stereotype has an OCL constraint which is not well formed. Validation should result in an error reporting the mal-formedness
+
+
+ An inactive class with the stereotype AlwaysPassive. This stereotype has a Java constraint that verifies that the class is passive. Thus, this class should not have an error.
+
+
+ An active class with the stereotype AlwaysPassive. This stereotype has a Java constraint that verifies that the class is passive. Thus, this class violates the constraint
+
+
+ This model applies a profile with OCL and Java constraints embedded into the plugin.xml (using DSML validation). profile definition.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.notation
new file mode 100644
index 00000000000..34a35d4548b
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.notation
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.uml
new file mode 100644
index 00000000000..253eeae0e8b
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-definition.profile.uml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OCL
+ base_Class.isActive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OCL
+ self.oclAsType(Class).isActive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-plugin.profile.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-plugin.profile.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/active.rule-in-plugin.profile.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.notation
new file mode 100644
index 00000000000..43c4a817ca0
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.notation
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.uml
new file mode 100644
index 00000000000..e3c51846f3f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/instanceSpecification.uml
@@ -0,0 +1,34 @@
+
+
+
+
+ Instance specification violates constraint for price attribute
+The OCLforUML stereotype guarantees is required to activate OCL validation for this instance specification
+
+
+
+
+ OCL
+ price > 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.notation
new file mode 100644
index 00000000000..611fed1eb43
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.notation
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.di b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.di
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.notation b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.notation
new file mode 100644
index 00000000000..e66e12da098
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.notation
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.uml
new file mode 100644
index 00000000000..c55944a1f3a
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.profile.uml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + requiredAttribute : String {unique}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.uml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.uml
new file mode 100644
index 00000000000..1b92aa09a18
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/resources/simple.uml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Activator.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Activator.java
new file mode 100644
index 00000000000..22a8a350e0c
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Activator.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.validation.tests"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/AllTests.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/AllTests.java
new file mode 100644
index 00000000000..e91c950e977
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/AllTests.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests;
+
+
+import org.eclipse.papyrus.uml.validation.tests.rules.TestOCLConstraintOnInstanceSpec;
+import org.eclipse.papyrus.uml.validation.tests.rules.TestOCLValidationRuleFromFile;
+import org.eclipse.papyrus.uml.validation.tests.rules.TestStereotypeValidation;
+import org.eclipse.papyrus.uml.validation.tests.rules.TestUMLValidationRules;
+import org.eclipse.papyrus.uml.validation.tests.rules.TestValidationRulesInPluginXML;
+import org.eclipse.papyrus.uml.validation.tests.rules.TestValidationRulesInProfile;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * Test suite for validation rules. See suite classes below
+ */
+@RunWith(Suite.class)
+@SuiteClasses({
+
+ /**
+ * Model with OCL constraints on class, verified in instance specification
+ * Model with OCL constraints on redefined attribute of a class.
+ */
+ TestOCLConstraintOnInstanceSpec.class,
+
+ /**
+ * Verify that custom OCL file contributes to validation, see bug 408215* Sample test for cut in model explorer
+ */
+ TestOCLValidationRuleFromFile.class,
+
+ /**
+ * Model with OCL and Java constraints in plugin.xml (EMFv)
+ */
+ TestValidationRulesInPluginXML.class,
+
+ /**
+ * Model with OCL constraints embedded in profile
+ */
+ TestValidationRulesInProfile.class,
+
+ /**
+ * Model with UML warning (identifiers of same name in package),
+ * Model/profile. Model applies a stereotype, but does not set the value of a required stereotype attribute
+ * Model with non-integer multiplicity on attribute (0..MAX)
+ */
+ TestUMLValidationRules.class,
+
+ /**
+ * Model/profile. Model applies a stereotype, but does not set the value of a required stereotype attribute.
+ */
+ TestStereotypeValidation.class
+})
+public class AllTests {
+ // JUnit for test suite
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Messages.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Messages.java
new file mode 100644
index 00000000000..5fc7ba11b81
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/Messages.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.validation.tests;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author ansgar
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.validation.tests.messages"; //$NON-NLS-1$
+ public static String TestOCLConstraintOnInstanceSpec_PriceRule;
+ public static String TestOCLValidationRuleFromFile_CamelCaseRule;
+ public static String TestOCLValidationRuleFromFile_CanNotGetEnvFactory;
+ public static String TestOCLValidationRuleFromFile_OCLCanNotLoadMM;
+ public static String TestStereotypeValidation_UnsetRequiredAttribute;
+ public static String TestUMLValidationRules_DetectNameClash;
+ public static String TestUMLValidationRules_NonStandardMultiplicityMayNotImplyError;
+ public static String TestValidationRulesInPluginXML_ConstraintIsMissing;
+ public static String TestValidationRulesInPluginXML_IsActiveShouldNotTriggerIssue;
+ public static String TestValidationRulesInPluginXML_IsActiveShouldTriggerIssue;
+ public static String TestValidationRulesInPluginXML_IsPassiveShouldNotTriggerIssue;
+ public static String TestValidationRulesInPluginXML_IsPassiveShouldTriggerIssue;
+ public static String TestValidationRulesInProfile_IsActiveMalformedShouldTriggerIssue;
+ public static String TestValidationRulesInProfile_IsActiveShouldNotTriggerIssue;
+ public static String TestValidationRulesInProfile_IsActiveShouldTriggerIssue;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/messages.properties b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/messages.properties
new file mode 100644
index 00000000000..0d5b38d5986
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/messages.properties
@@ -0,0 +1,15 @@
+TestOCLConstraintOnInstanceSpec_PriceRule=The OCL price rule should trigger an issue for this instance specification
+TestOCLValidationRuleFromFile_CamelCaseRule=The rule CamelCaseName in %s should trigger an issue for this class
+TestOCLValidationRuleFromFile_CanNotGetEnvFactory=Can not get environment factory
+TestOCLValidationRuleFromFile_OCLCanNotLoadMM=OCL: can not load meta-models
+TestStereotypeValidation_UnsetRequiredAttribute=The unset required stereotype attribute should trigger an issue for class1
+TestUMLValidationRules_DetectNameClash=The standard UML validation should detect a name clash for class %s
+TestUMLValidationRules_NonStandardMultiplicityMayNotImplyError=Non-standard multiplicities as in class %s may not imply an error
+TestValidationRulesInPluginXML_ConstraintIsMissing=Constraint is missing
+TestValidationRulesInPluginXML_IsActiveShouldNotTriggerIssue=The rule isActive should not trigger an issue for class %s
+TestValidationRulesInPluginXML_IsActiveShouldTriggerIssue=The rule isActive should trigger an issue for class %s
+TestValidationRulesInPluginXML_IsPassiveShouldNotTriggerIssue=The rule isPassive should trigger an issue for class %s
+TestValidationRulesInPluginXML_IsPassiveShouldTriggerIssue=The rule isPassive should not trigger an issue for class %s
+TestValidationRulesInProfile_IsActiveMalformedShouldTriggerIssue=The rule isActiveMalformed should trigger an issue for class %s
+TestValidationRulesInProfile_IsActiveShouldNotTriggerIssue=The rule isActive should not trigger an issue for class %s
+TestValidationRulesInProfile_IsActiveShouldTriggerIssue=The rule isActive should trigger an issue for class %s
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/AbstractValidationEditorTest.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/AbstractValidationEditorTest.java
new file mode 100644
index 00000000000..71ec9879cc6
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/AbstractValidationEditorTest.java
@@ -0,0 +1,81 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
+import org.eclipse.uml2.uml.Element;
+
+
+/**
+ * Abstract test for validat
+ * import org.eclipse.uml2.uml.Element;ion rules
+ */
+public abstract class AbstractValidationEditorTest extends AbstractEditorTest {
+
+ protected static final String PLATFORM_PLUGIN = "platform:/plugin/"; //$NON-NLS-1$
+
+ protected static final String VALIDATE_COMMAND_ID = "org.eclipse.papyrus.validation.ValidateModelCommand"; //$NON-NLS-1$
+
+ protected static final String PROJECT_PREFIX = "org.eclipse.testproject."; //$NON-NLS-1$
+
+ protected static final String RESOURCES_PATH = "/resources/"; //$NON-NLS-1$
+
+ protected static final String CAN_NOT_FIND_ELEMENT = "Can not find element %s in model %s"; //$NON-NLS-1$
+
+ /** validation diagnostic */
+ protected Diagnostic globalDiagnostic;
+
+ /**
+ * find diagnostic by source
+ * (Should be unique per element if the source is correctly defined)
+ */
+ public List findDiagnosticBySource(Diagnostic diagnostic, String source) {
+ List foundDiagnostic = new ArrayList();
+ List children = diagnostic.getChildren();
+ if (source.equals(diagnostic.getSource())) {
+ foundDiagnostic.add(diagnostic);
+ }
+ if (children != null && !children.isEmpty()) {
+ for (Diagnostic diagnostic2 : children) {
+ foundDiagnostic.addAll(findDiagnosticBySource(diagnostic2, source));
+ }
+ }
+ return foundDiagnostic;
+ }
+
+ public List filterDiagnosticsByElement(List diagnostics, Element element) {
+ List filteredDiagnostics = new ArrayList();
+ for (Diagnostic diagnostic : diagnostics) {
+ List> datas = diagnostic.getData();
+ if (datas != null && !datas.isEmpty()) {
+ // try to get first element. According to Diagnostic#getData() documentation : The first element is typically the object that is the primary source of the problem;
+ Object o = datas.get(0);
+ if (element.equals(o)) {
+ filteredDiagnostics.add(diagnostic);
+ }
+ }
+ }
+ return filteredDiagnostics;
+ }
+
+ @Override
+ protected String getSourcePath() {
+ return RESOURCES_PATH;
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLConstraintOnInstanceSpec.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLConstraintOnInstanceSpec.java
new file mode 100644
index 00000000000..aad98f65485
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLConstraintOnInstanceSpec.java
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.Model;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for validation rules. It tests
+ * - Model with OCL constraints on class, verified in instance specification
+ * - Model with OCL constraints on redefined attribute of a class.
+ */
+public class TestOCLConstraintOnInstanceSpec extends AbstractValidationEditorTest {
+
+ public static final String MODEL_NAME = "instanceSpecification"; //$NON-NLS-1$
+
+ public final static String INSTANCE_NAME = "instance"; //$NON-NLS-1$
+
+ /** instance specification with constraint violation */
+ protected InstanceSpecification instance;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ initModel(PROJECT_PREFIX + MODEL_NAME, MODEL_NAME, Activator.getDefault().getBundle());
+
+ Model model = (Model) getRootUMLModel();
+
+ instance = (InstanceSpecification) model.getPackagedElement(INSTANCE_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, INSTANCE_NAME, model), instance);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * Validation needs to create an entry for the violated constraint of the instance specification
+ */
+ @Test
+ public void validateOCLOnInstanceSpec() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), instance);
+ Assert.assertEquals(Messages.TestOCLConstraintOnInstanceSpec_PriceRule, 1, diagnostics.size());
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLValidationRuleFromFile.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLValidationRuleFromFile.java
new file mode 100644
index 00000000000..e46e1e71a42
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestOCLValidationRuleFromFile.java
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.ocl.pivot.internal.resource.OCLAdapter;
+import org.eclipse.ocl.xtext.completeocl.utilities.CompleteOCLLoader;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for validation rules:
+ * Verify that custom OCL file contributes to validation, see bug 408215* Sample test for cut in model explorer
+ */
+public class TestOCLValidationRuleFromFile extends AbstractValidationEditorTest {
+
+ protected static final String EXTRA_UML_VALIDATION_OCL = "ExtraUMLValidation.ocl"; //$NON-NLS-1$
+
+ protected static final String CONSTRAINT_ID = "isActiveEntity"; //$NON-NLS-1$
+
+ protected static final String MODEL_NAME = "UMLValidationTests"; //$NON-NLS-1$
+
+ protected static final String PKG_OCL_FROM_FILE = "oclFromFile"; //$NON-NLS-1$
+
+ protected final static String CLASS_LOWER_CASE = "lowerCaseClass"; //$NON-NLS-1$
+
+ /* class starting with a lower case name (violates constraint in external OCL file) */
+ protected Class lowerCaseClass;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ initModel(PROJECT_PREFIX + MODEL_NAME, MODEL_NAME, Activator.getDefault().getBundle());
+
+ Model model = (Model) getRootUMLModel();
+ Package pkg = (Package) model.getPackagedElement(PKG_OCL_FROM_FILE);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, PKG_OCL_FROM_FILE, model), pkg);
+
+ lowerCaseClass = (Class) pkg.getPackagedElement(CLASS_LOWER_CASE);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, CLASS_LOWER_CASE, model), lowerCaseClass);
+
+ // Registering OCL components
+ //
+ ResourceSet modelResources = model.eResource().getResourceSet();
+ OCLAdapter oclAdapter = OCLAdapter.getAdapter(modelResources);
+ CompleteOCLLoader helper = new CompleteOCLLoader(oclAdapter.getEnvironmentFactory()) {
+ @Override
+ protected boolean error(String primaryMessage, String detailMessage) {
+ Assert.fail(Messages.TestOCLValidationRuleFromFile_CanNotGetEnvFactory);
+ return false;
+ }
+ };
+ Assert.assertTrue(Messages.TestOCLValidationRuleFromFile_OCLCanNotLoadMM, helper.loadMetamodels());
+
+ // load OCL file
+ URI oclURI = URI.createPlatformPluginURI(Activator.PLUGIN_ID + RESOURCES_PATH + EXTRA_UML_VALIDATION_OCL, false);
+ try {
+ if (!helper.loadDocument(oclURI)) {
+ Assert.fail("Can not load OCL document with URI: " + oclURI.path()); //$NON-NLS-1$
+ }
+ } catch (Throwable e) {
+ Assert.fail(String.format("Exception %s during loading of OCL document with URI: %s", e.getMessage(), oclURI.path())); //$NON-NLS-1$
+ }
+ helper.installPackages();
+
+ // it's important to create the validate model command after the OCL file has been loaded
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * Failing validation for rule defined in ExtraUMLValidation
+ */
+ @Test
+ public void validateCamelCaseRule() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), lowerCaseClass);
+ Assert.assertEquals(String.format(
+ Messages.TestOCLValidationRuleFromFile_CamelCaseRule, EXTRA_UML_VALIDATION_OCL),
+ 1, diagnostics.size());
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestStereotypeValidation.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestStereotypeValidation.java
new file mode 100644
index 00000000000..6d287fbfd6f
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestStereotypeValidation.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for validation rules. It tests
+ * Model/profile. Model applies a stereotype, but does not set the value of a required stereotype attribute.
+ */
+public class TestStereotypeValidation extends AbstractValidationEditorTest {
+
+ public static final String MODEL_NAME = "simple"; //$NON-NLS-1$
+
+ public static final String PROFILE_NAME = "simple.profile"; //$NON-NLS-1$
+
+ public final static String CLASS1 = "Class1"; //$NON-NLS-1$
+ protected Class class1;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ createProject(PROJECT_PREFIX + MODEL_NAME);
+ copyModel(PROFILE_NAME, Activator.getDefault().getBundle());
+ initModel(MODEL_NAME, Activator.getDefault().getBundle());
+
+ Model model = (Model) getRootUMLModel();
+
+ class1 = (Class) model.getPackagedElement(CLASS1);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, CLASS1, model), class1);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * Failing validation for stereotype whose required attribute is unset
+ */
+ @Test
+ public void validateUnsetStereotypeAttribute() throws Exception {
+ // get the diagnostic and check for the given capsule
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), class1);
+ Assert.assertEquals(Messages.TestStereotypeValidation_UnsetRequiredAttribute, 1, diagnostics.size());
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestUMLValidationRules.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestUMLValidationRules.java
new file mode 100644
index 00000000000..8595ef369f6
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestUMLValidationRules.java
@@ -0,0 +1,103 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for UML validation rules. It tests
+ * - Model with UML warning (identifiers of same name in package)
+ * - Model with non-integer multiplicity on attribute (0..MAX)
+ */
+public class TestUMLValidationRules extends AbstractValidationEditorTest {
+
+ public static final String MODEL_NAME = "UMLValidationTests"; //$NON-NLS-1$
+
+ public final static String PKG_NAME_CLASH = "nameclash"; //$NON-NLS-1$
+
+ public final static String CLASS1 = "Class1"; //$NON-NLS-1$
+ protected Class class1;
+
+ public final static String PKG_MULTIPLICITY = "multiplicity"; //$NON-NLS-1$
+ public final static String NON_STANDARD_MULTIPLICITY = "NonStandardMultiplicity"; //$NON-NLS-1$
+ protected Class nonStandardMultiplicity;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ initModel(PROJECT_PREFIX + MODEL_NAME, MODEL_NAME, Activator.getDefault().getBundle());
+
+ // validate the new model
+
+ Assert.assertNotNull("RootModel is null", getRootUMLModel()); //$NON-NLS-1$
+ Model model = (Model) getRootUMLModel();
+
+ Package nameclash = (Package) model.getPackagedElement(PKG_NAME_CLASH);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, PKG_NAME_CLASH, model), nameclash);
+ class1 = (Class) nameclash.getPackagedElement(CLASS1);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, CLASS1, model), class1);
+
+ Package multiplicty = (Package) model.getPackagedElement(PKG_MULTIPLICITY);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, PKG_MULTIPLICITY, model), multiplicty);
+ nonStandardMultiplicity = (Class) multiplicty.getPackagedElement(NON_STANDARD_MULTIPLICITY);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, NON_STANDARD_MULTIPLICITY, model), nonStandardMultiplicity);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * Simple failing validation for IsActiveEntityRule
+ */
+ @Test
+ public void validateNameClashDetection() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), class1);
+ Assert.assertEquals(String.format(Messages.TestUMLValidationRules_DetectNameClash, class1), 1, diagnostics.size());
+ }
+
+ /**
+ * Simple valid validation for IsActiveEntityRule
+ */
+ @Test
+ public void validateNonStandardMultiplicity() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), nonStandardMultiplicity);
+ Assert.assertEquals(String.format(Messages.TestUMLValidationRules_NonStandardMultiplicityMayNotImplyError, nonStandardMultiplicity), 0, diagnostics.size());
+ }
+
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInPluginXML.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInPluginXML.java
new file mode 100644
index 00000000000..54f6dc05ada
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInPluginXML.java
@@ -0,0 +1,147 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.emf.validation.service.ConstraintRegistry;
+import org.eclipse.emf.validation.service.IConstraintDescriptor;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.junit.framework.classification.FailingTest;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for validation rules. It tests
+ * Model with OCL constraints in plugin.xml (EMFv)
+ * Model with Java constraints in plugin.xml (EMFv)
+ */
+public class TestValidationRulesInPluginXML extends AbstractValidationEditorTest {
+
+ public static final String CONSTRAINT_PLUGIN = "org.eclipse.papyrus.uml.validation.tests.genvalidation"; //$NON-NLS-1$
+
+ public static final String CONSTRAINT_ID_ALWAYS_ACTIVE = "profile.AlwaysActive.ConstraintAlwaysActive"; //$NON-NLS-1$
+
+ public static final String MODEL_NAME = "active-tst.rule-in-plugin"; //$NON-NLS-1$
+
+ /**
+ * An active class applying a stereotype with an attached OCL constraint requiring that the class is active
+ */
+ public final static String INACTIVE_OCL_NAME = "ActiveOCL"; //$NON-NLS-1$
+ protected Class activeOCL;
+
+ /**
+ * A non active class applying a stereotype with an attached OCL constraint requiring that the class is active
+ */
+ public final static String ACTIVE_OCL_NAME = "InactiveOCL"; //$NON-NLS-1$
+ protected Class inactiveOCL;
+
+ /**
+ * A non active class applying a stereotype with an attached Java constraint requiring that the class is passive
+ */
+ public final static String INACTIVE_JAVA_NAME = "InactiveJava"; //$NON-NLS-1$
+ protected Class inactiveJava;
+
+ /**
+ * An active class applying a stereotype with an attached Java constraint requiring that the class is passive
+ */
+ public final static String ACTIVE_JAVA_NAME = "ActiveJava"; //$NON-NLS-1$
+ protected Class activeJava;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ initModel(PROJECT_PREFIX + MODEL_NAME, MODEL_NAME, Activator.getDefault().getBundle());
+
+ Model model = (Model) getRootUMLModel();
+
+ inactiveOCL = (Class) model.getPackagedElement(INACTIVE_OCL_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, INACTIVE_OCL_NAME, model), inactiveOCL);
+
+ activeOCL = (Class) model.getPackagedElement(ACTIVE_OCL_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, ACTIVE_OCL_NAME, model), activeOCL);
+
+ inactiveJava = (Class) model.getPackagedElement(INACTIVE_JAVA_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, INACTIVE_JAVA_NAME, model), inactiveJava);
+
+ activeJava = (Class) model.getPackagedElement(ACTIVE_JAVA_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, ACTIVE_JAVA_NAME, model), activeJava);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+
+ // check that the constraint exists
+ ConstraintRegistry instance = ConstraintRegistry.getInstance();
+ IConstraintDescriptor descriptor = instance.getDescriptor(CONSTRAINT_PLUGIN, CONSTRAINT_ID_ALWAYS_ACTIVE);
+ Assert.assertNotNull(Messages.TestValidationRulesInPluginXML_ConstraintIsMissing, descriptor);
+
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * Failing validation for IsActiveEntityRule (OCL rule, on inactive class)
+ */
+ @Test
+ public void validateIsActiveOCLRule_inactiveClass() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), inactiveOCL);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInPluginXML_IsActiveShouldTriggerIssue, inactiveOCL), 1, diagnostics.size());
+ }
+
+ /**
+ * Successful validation for IsActiveEntityRule (OCL rule, on active class)
+ */
+ @FailingTest
+ public void validateIsActiveOCLRule_activeClass() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), activeOCL);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInPluginXML_IsActiveShouldNotTriggerIssue, activeOCL), 0, diagnostics.size());
+ }
+
+ /**
+ * Successful validation for IsPassiveEntityRule (Java rule, on inactive class)
+ */
+ @Test
+ public void validateIsPassiveJavaRule_inactiveClass() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), inactiveJava);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInPluginXML_IsPassiveShouldTriggerIssue, inactiveJava), 0, diagnostics.size());
+ }
+
+ /**
+ * Failing validation for IsPassiveEntityRule (Java rule, on active class)
+ */
+ @Test
+ public void validateIsPassiveJavaRule_activeClass() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), activeJava);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInPluginXML_IsPassiveShouldNotTriggerIssue, activeJava), 1, diagnostics.size());
+ }
+}
diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInProfile.java b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInProfile.java
new file mode 100644
index 00000000000..39307091db4
--- /dev/null
+++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/src/org/eclipse/papyrus/uml/validation/tests/rules/TestValidationRulesInProfile.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Extension to validation test suite
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.validation.tests.rules;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand;
+import org.eclipse.papyrus.uml.validation.tests.Activator;
+import org.eclipse.papyrus.uml.validation.tests.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for validation rules. It tests
+ * Model with OCL constraints embedded in profile
+ */
+public class TestValidationRulesInProfile extends AbstractValidationEditorTest {
+
+ public static final String CONSTRAINT_ID = "isActiveEntity"; //$NON-NLS-1$
+
+ public static final String PROFILE_NAME = "active.rule-in-definition.profile"; //$NON-NLS-1$
+
+ public static final String MODEL_NAME = "active-tst.rule-in-definition"; //$NON-NLS-1$
+
+ /**
+ * A non active class applying a stereotype with an attached OCL constraint requiring that the class is active
+ */
+ public final static String INACTIVE_NAME = "Inactive"; //$NON-NLS-1$
+ protected Class active;
+
+ /**
+ * An active class applying a stereotype with an attached OCL constraint requiring that the class is active
+ */
+ public final static String ACTIVE_NAME = "Active"; //$NON-NLS-1$
+ protected Class inactive;
+
+ /**
+ * An active class applying a stereotype with a malformed OCL constraint attached
+ */
+ public final static String ACTIVE_MALFORMED_NAME = "ActiveMalformed"; //$NON-NLS-1$
+ protected Class activeMalformed;
+
+ @Before
+ public void initModelForValidationTest() throws Exception {
+ createProject(PROJECT_PREFIX + MODEL_NAME);
+ copyModel(PROFILE_NAME, Activator.getDefault().getBundle());
+ initModel(MODEL_NAME, Activator.getDefault().getBundle());
+
+
+ // validate the new model
+ Model model = (Model) getRootUMLModel();
+
+ active = (Class) model.getPackagedElement(ACTIVE_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, ACTIVE_NAME, model), active);
+
+ inactive = (Class) model.getPackagedElement(INACTIVE_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, INACTIVE_NAME, model), inactive);
+
+ activeMalformed = (Class) model.getPackagedElement(ACTIVE_MALFORMED_NAME);
+ Assert.assertNotNull(String.format(CAN_NOT_FIND_ELEMENT, ACTIVE_MALFORMED_NAME, model), activeMalformed);
+
+ final EditingDomain domain = TransactionUtil.getEditingDomain(model);
+ final ValidateModelCommand validateModelCommand = new ValidateModelCommand(model);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ domain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(validateModelCommand));
+ }
+ });
+
+ globalDiagnostic = validateModelCommand.getDiagnostic();
+ }
+
+ /**
+ * No errors on active class
+ */
+ @Test
+ public void validateIsActiveRule_ActiveCapsule() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), active);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInProfile_IsActiveShouldNotTriggerIssue, active), 0, diagnostics.size());
+ }
+
+ /**
+ * One warning on inactive class
+ */
+ @Test
+ public void validateIsActiveRule_notActiveCapsule() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), inactive);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInProfile_IsActiveShouldTriggerIssue, inactive), 1, diagnostics.size());
+ }
+
+ /**
+ * One error on malformed class
+ */
+ @Test
+ public void validateMalformedActiveRule_notActiveCapsule() throws Exception {
+ // get the diagnostic and check for the given class
+ List diagnostics = filterDiagnosticsByElement(globalDiagnostic.getChildren(), activeMalformed);
+ Assert.assertEquals(String.format(Messages.TestValidationRulesInProfile_IsActiveMalformedShouldTriggerIssue, activeMalformed), 1, diagnostics.size());
+ }
+}
--
cgit v1.2.3