blob: d6941ffd29ed57a17b28a38420a5084f57db5903 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/*******************************************************************************
* Copyright (c) 2012, 2014 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.compare.uml2.tests;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.uml2.uml.UMLPlugin;
import org.junit.AfterClass;
import org.junit.BeforeClass;
public abstract class AbstractDynamicProfileTest extends AbstractUMLProfileTest {
static URI registeredURI;
static Object registeredPackage;
@BeforeClass
public static void initEPackageNsURIToProfileLocationMap() {
if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
// It is required to link the EPackage to the UML package of the UML Profile
UMLPlugin
.getEPackageNsURIToProfileLocationMap()
.put("http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile",
URI.createURI("pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw")); //$NON-NLS-1$
} else {
registeredURI = UMLPlugin.getEPackageNsURIToProfileLocationMap().remove(
UML2CompareTestProfilePackage.eNS_URI);
registeredPackage = EPackage.Registry.INSTANCE.remove(UML2CompareTestProfilePackage.eNS_URI);
}
}
@AfterClass
public static void resetEPackageNsURIToProfileLocationMap() {
if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
UMLPlugin.getEPackageNsURIToProfileLocationMap().remove(
"http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile");
} else {
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(UML2CompareTestProfilePackage.eNS_URI,
registeredURI);
EPackage.Registry.INSTANCE.put(UML2CompareTestProfilePackage.eNS_URI, registeredPackage);
}
}
}
|