Bug 514747: [Interoperability][Rsa] Move Rsa migration plugin into new
git https://bugs.eclipse.org/bugs/show_bug.cgi?id=514747

- Add the DSML Validation plugins to the RSA feature (because it's
needed for the QvTo transformations)
- Add the JUnit tests to the build

Change-Id: If116c4aebac759f68d21dc63f0de5aa3446b0c34
Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
diff --git a/releng/Papyrus - All - Main.launch b/releng/Papyrus - All - Main.launch
index fb52169..02d8371 100644
--- a/releng/Papyrus - All - Main.launch
+++ b/releng/Papyrus - All - Main.launch
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="true"/>
+<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
 <stringAttribute key="M2_GOALS" value="clean install"/>
 <booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
 <booleanAttribute key="M2_OFFLINE" value="false"/>
diff --git a/releng/Papyrus - All - Tests.launch b/releng/Papyrus - All - Tests.launch
index db0ac19..326886d 100644
--- a/releng/Papyrus - All - Tests.launch
+++ b/releng/Papyrus - All - Tests.launch
@@ -6,7 +6,7 @@
 <booleanAttribute key="M2_OFFLINE" value="false"/>
 <stringAttribute key="M2_PROFILES" value="buildAllTests"/>
 <listAttribute key="M2_PROPERTIES">
-<listEntry value="papyrus.repo.interoperability.main=file:/${project_loc:releng}/../org.eclipse.papyrus.interoperability.all.p2/target/repository"/>
+<listEntry value="papyrus.repo.interoperability.main=file:/${project_loc:releng}/org.eclipse.papyrus.interoperability.all.p2/target/repository"/>
 </listAttribute>
 <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
 <booleanAttribute key="M2_SKIP_TESTS" value="false"/>
diff --git a/releng/main/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target b/releng/main/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
index ba89e50..28de414 100644
--- a/releng/main/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
+++ b/releng/main/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
@@ -8,10 +8,10 @@
 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <repository location="http://download.eclipse.org/mylyn/drops/3.21.1/v20161129-2023"/>
 </location>
-<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<!--location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.eclipse.uml2.sdk.feature.group" version="5.2.3.v20170227-0935"/>
 <repository location="http://download.eclipse.org/modeling/mdt/uml2/updates/5.2.x"/>
-</location>
+</location-->
 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.eclipse.papyrus.sysml.diagram.feature.feature.group" version="0.0.0"/>
 <unit id="org.eclipse.papyrus.sysml.diagram.feature.source.feature.group" version="0.0.0"/>
@@ -69,5 +69,10 @@
 <unit id="org.eclipse.nebula.widgets.nattable.extension.nebula.source.feature.feature.group" version="1.1.0.201703192131"/>
 <repository location="http://download.eclipse.org/nattable/releases/1.5.0/repository"/>
 </location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.source.feature.group" version="0.0.0"/>
+<repository location="https://hudson.eclipse.org/papyrus/job/papyrus-incubation-oxygen/lastSuccessfulBuild/artifact/org.eclipse.papyrus.incubation.p2/target/repository/"/>
+</location>
 </locations>
 </target>
diff --git a/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target b/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
index 80f2d35..13357fd 100644
--- a/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
+++ b/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.targetplatform.oxygen/org.eclipse.papyrus.interoperability.targetplatform.oxygen.target
@@ -71,5 +71,9 @@
 <unit id="org.eclipse.nebula.widgets.nattable.extension.nebula.source.feature.feature.group" version="1.1.0.201703192131"/>
 <repository location="http://download.eclipse.org/nattable/releases/1.5.0/repository"/>
 </location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.feature.group" version="0.0.0"/>
+<repository location="https://hudson.eclipse.org/papyrus/job/papyrus-incubation-oxygen/lastSuccessfulBuild/artifact/org.eclipse.papyrus.incubation.p2/target/repository/"/>
+</location>
 </locations>
 </target>
diff --git a/rsa/features/org.eclipse.papyrus.interoperability.rsa.feature/feature.xml b/rsa/features/org.eclipse.papyrus.interoperability.rsa.feature/feature.xml
index 59f841f..35c6b0d 100644
--- a/rsa/features/org.eclipse.papyrus.interoperability.rsa.feature/feature.xml
+++ b/rsa/features/org.eclipse.papyrus.interoperability.rsa.feature/feature.xml
@@ -16,6 +16,13 @@
    </copyright>
 
    <plugin
+         id="org.eclipse.papyrus.dsml.validation"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
          id="org.eclipse.papyrus.interoperability.common"
          download-size="0"
          install-size="0"
diff --git a/rsa/features/org.eclipse.papyrus.interoperability.rsa.tests.featire/.project b/rsa/features/org.eclipse.papyrus.interoperability.rsa.tests.featire/.project
deleted file mode 100644
index df8cb6c..0000000
--- a/rsa/features/org.eclipse.papyrus.interoperability.rsa.tests.featire/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.papyrus.interoperability.rsa.tests.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/META-INF/MANIFEST.MF b/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/META-INF/MANIFEST.MF
index fe84bc7..37a21f9 100644
--- a/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/META-INF/MANIFEST.MF
+++ b/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/META-INF/MANIFEST.MF
@@ -19,6 +19,7 @@
  org.eclipse.papyrus.interoperability.common;bundle-version="[0.7.0,1.0.0)",
  org.eclipse.papyrus.interoperability.common.blackboxes;bundle-version="[0.7.0,1.0.0)",
  org.eclipse.papyrus.uml.extensionpoints;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.dsml.validation;bundle-version="[1.2.0,2.0.0)",
  org.eclipse.papyrus.uml.documentation.profile;bundle-version="[1.2.0,2.0.0)",
  org.eclipse.team.core,
  org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)",
diff --git a/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/src/org/eclipse/papyrus/interoperability/rsa/transformation/ImportTransformation.java b/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/src/org/eclipse/papyrus/interoperability/rsa/transformation/ImportTransformation.java
index 05d1371..32c578b 100644
--- a/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/src/org/eclipse/papyrus/interoperability/rsa/transformation/ImportTransformation.java
+++ b/rsa/plugins/org.eclipse.papyrus.interoperability.rsa/src/org/eclipse/papyrus/interoperability/rsa/transformation/ImportTransformation.java
@@ -76,6 +76,7 @@
 import org.eclipse.m2m.qvt.oml.util.ISessionData;
 import org.eclipse.m2m.qvt.oml.util.Trace;
 import org.eclipse.m2m.qvt.oml.util.WriterLog;
+import org.eclipse.papyrus.dsml.validation.PapyrusDSMLValidationRule.PapyrusDSMLValidationRulePackage;
 import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage;
 import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain;
 import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
@@ -903,7 +904,7 @@
 
 	protected ModelExtent getInProfileDefinitions() {
 		return new BasicModelExtent(Arrays.asList(new EPackage[] {
-				// PapyrusDSMLValidationRulePackage.eINSTANCE,
+				PapyrusDSMLValidationRulePackage.eINSTANCE,
 				DocumentationPackage.eINSTANCE
 		}));
 	}
@@ -930,14 +931,14 @@
 		List<String> missingProfiles = new LinkedList<>();
 
 		List<EObject> allContents = new LinkedList<>();
-//		try {
-//			URI validationProfileURI = URI.createURI("pathmap://DSMLValidation_PROFILES/PapyrusValidationRuleDSML.uml");
-//			Resource validationProfile = resourceSet.getResource(validationProfileURI, true);
-//			checkResource(validationProfile);
-//			allContents.addAll(validationProfile.getContents());
-//		} catch (WrappedException ex) {
-//			missingProfiles.add("Validation Rules Profile");
-//		}
+		try {
+			URI validationProfileURI = URI.createURI("pathmap://DSMLValidation_PROFILES/PapyrusValidationRuleDSML.uml");
+			Resource validationProfile = resourceSet.getResource(validationProfileURI, true);
+			checkResource(validationProfile);
+			allContents.addAll(validationProfile.getContents());
+		} catch (WrappedException ex) {
+			missingProfiles.add("Validation Rules Profile");
+		}
 
 		try {
 			URI documentationProfileURI = URI.createURI("pathmap://PAPYRUS_DOCUMENTATION/Papyrus.profile.uml");
diff --git a/rsa/releng/main/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target b/rsa/releng/main/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
index ef0b8e6..7a70f94 100644
--- a/rsa/releng/main/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
+++ b/rsa/releng/main/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="Tycho Tutorial" sequenceNumber="1465317055">
+<?pde version="3.8"?><target name="Tycho Tutorial" sequenceNumber="1465317057">
 <locations>
 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.10.0.201606071959"/>
@@ -52,5 +52,10 @@
 <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.10.0.201606071631"/>
 <repository location="http://download.eclipse.org/modeling/gmp/gmf-notation/updates/releases"/>
 </location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.source.feature.group" version="0.0.0"/>
+<repository location="https://hudson.eclipse.org/papyrus/job/papyrus-incubation-oxygen/lastSuccessfulBuild/artifact/org.eclipse.papyrus.incubation.p2/target/repository/"/>
+</location>
 </locations>
 </target>
diff --git a/rsa/releng/org.eclipse.papyrus.interoperability.rsa.p2/category.xml b/rsa/releng/org.eclipse.papyrus.interoperability.rsa.p2/category.xml
index c5702fd..3f4d196 100644
--- a/rsa/releng/org.eclipse.papyrus.interoperability.rsa.p2/category.xml
+++ b/rsa/releng/org.eclipse.papyrus.interoperability.rsa.p2/category.xml
@@ -7,7 +7,7 @@
       <category name="org.eclipse.papyrus.category"/>
    </feature>
    
-   <category-def name="org.eclipse.papyrus.category" label="Papyrus Rpy Interoperability">
+   <category-def name="org.eclipse.papyrus.category" label="Papyrus RSA Interoperability">
       <description>
          Papyrus Rsa Interoperability Category
       </description>
diff --git a/rsa/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target b/rsa/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
index f87953c..66c21c4 100644
--- a/rsa/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
+++ b/rsa/releng/tests/targetplatform/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen/org.eclipse.papyrus.interoperability.rsa.targetplatform.oxygen.target
@@ -58,5 +58,9 @@
 <unit id="com.google.guava.source" version="21.0.0.v20170206-1425"/>
 <repository location="http://download.eclipse.org/tools/orbit/S-builds/S20170306214312/repository"/>
 </location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.papyrus.extra.dsml.validation.feature.feature.group" version="0.0.0"/>
+<repository location="https://hudson.eclipse.org/papyrus/job/papyrus-incubation-oxygen/lastSuccessfulBuild/artifact/org.eclipse.papyrus.incubation.p2/target/repository/"/>
+</location>
 </locations>
 </target>
diff --git a/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/META-INF/MANIFEST.MF b/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/META-INF/MANIFEST.MF
index eefc762..e9741ad 100644
--- a/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/META-INF/MANIFEST.MF
+++ b/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/META-INF/MANIFEST.MF
@@ -35,7 +35,9 @@
  org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)",
  org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)",
  org.eclipse.papyrus.uml.diagram.composite;bundle-version="[3.0.0,4.0.0)",
- com.google.guava;bundle-version="21.0.0"
+ com.google.guava;bundle-version="21.0.0",
+ org.eclipse.papyrus.uml.architecture;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.papyrus.dsml.validation;bundle-version="[1.2.0,2.0.0)"
 Export-Package: org.eclipse.papyrus.interoperability.rsa.tests,
  org.eclipse.papyrus.interoperability.rsa.tests.qvt
 Bundle-Vendor: Eclipse Modeling Project
diff --git a/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/pom.xml b/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/pom.xml
index 3ff4a08..0575f7a 100644
--- a/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/pom.xml
+++ b/rsa/tests/org.eclipse.papyrus.interoperability.rsa.tests/pom.xml
@@ -11,4 +11,27 @@
   <artifactId>org.eclipse.papyrus.interoperability.rsa.tests</artifactId>
   <version>1.4.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
+  <build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-surefire-plugin</artifactId>
+				<version>${tycho-version}</version>
+				<configuration>
+					<useUIHarness>true</useUIHarness>
+					<useUIThread>true</useUIThread>
+					<testFailureIgnore>true</testFailureIgnore>
+					<product>org.eclipse.sdk.ide</product>
+					<!-- If a specific <argLine> is required here, make sure to include JaCoCo parameters (See parent pom, Bug 478170) -->
+					<skipTests>${skipAllTests}</skipTests>
+					<testClass>org.eclipse.papyrus.interoperability.rsa.tests.AllTests</testClass>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>target-platform-configuration</artifactId>
+				<version>${tycho-version}</version>
+			</plugin>
+		</plugins>
+	</build>
 </project>