Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2019-04-08 11:15:26 -0400
committerlgoubet2019-04-08 11:31:34 -0400
commit4968f5113d870406a2ebdfe82d6302a3c8549968 (patch)
tree98c98e94cc33f88ebc302d9002ee000b0d1c33f3
parentbb60b171028e0d7bc30a4bd11fd7401e1b9d88bb (diff)
downloadorg.eclipse.emf.compare-4968f5113d870406a2ebdfe82d6302a3c8549968.tar.gz
org.eclipse.emf.compare-4968f5113d870406a2ebdfe82d6302a3c8549968.tar.xz
org.eclipse.emf.compare-4968f5113d870406a2ebdfe82d6302a3c8549968.zip
The UML tests shouldn't use a cached instance of EMFCompare
There are caches at multiple levels in a comparison process, so reusing the same instance might not have the expected result. Change-Id: Ieb924cfad9798b1ca9ff3ffce61ee5663f5fb89f
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/src/org/eclipse/emf/compare/uml2/ide/ui/tests/comparison/tooltip/UMLTooltipProviderTest.java2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractUMLTest.java13
2 files changed, 6 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/src/org/eclipse/emf/compare/uml2/ide/ui/tests/comparison/tooltip/UMLTooltipProviderTest.java b/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/src/org/eclipse/emf/compare/uml2/ide/ui/tests/comparison/tooltip/UMLTooltipProviderTest.java
index 8f97ea648..0422197ed 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/src/org/eclipse/emf/compare/uml2/ide/ui/tests/comparison/tooltip/UMLTooltipProviderTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/src/org/eclipse/emf/compare/uml2/ide/ui/tests/comparison/tooltip/UMLTooltipProviderTest.java
@@ -113,7 +113,7 @@ public class UMLTooltipProviderTest extends AbstractUMLTest {
editingDomain = EMFCompareEditingDomain.create(left, right, origin);
DefaultComparisonScope scope = new DefaultComparisonScope(left, right, origin);
- Comparison comparison = emfCompare.compare(scope);
+ Comparison comparison = getCompare().compare(scope);
EList<Diff> differences = comparison.getDifferences();
assertNotEquals(0, differences.size());
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractUMLTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractUMLTest.java
index cb89c0665..b7408cba4 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractUMLTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractUMLTest.java
@@ -80,8 +80,6 @@ import org.junit.Before;
@SuppressWarnings({"nls", "restriction" })
public abstract class AbstractUMLTest {
- protected EMFCompare emfCompare;
-
private IMerger.Registry mergerRegistry;
/** Cached cascading options before the last time the filter was enabled or disabled. */
@@ -121,12 +119,8 @@ public abstract class AbstractUMLTest {
@Before
public void before() {
- Builder builder = EMFCompare.builder();
// post-processor and merger registry is not filled in runtime (org.eclipse.emf.compare.rcp not
// loaded)
- final IPostProcessor.Descriptor.Registry<String> postProcessorRegistry = new PostProcessorDescriptorRegistryImpl<String>();
- registerPostProcessors(postProcessorRegistry);
- builder.setPostProcessorRegistry(postProcessorRegistry);
mergerRegistry = IMerger.RegistryImpl.createStandaloneInstance();
final IMerger umlMerger = new UMLMerger();
final IMerger umlReferenceChangeMerger = new UMLReferenceChangeMerger();
@@ -137,7 +131,6 @@ public abstract class AbstractUMLTest {
mergerRegistry.add(umlMerger);
mergerRegistry.add(umlReferenceChangeMerger);
mergerRegistry.add(opaqueElementBodyChangeMerger);
- emfCompare = builder.build();
}
/**
@@ -170,7 +163,11 @@ public abstract class AbstractUMLTest {
}
protected EMFCompare getCompare() {
- return emfCompare;
+ Builder builder = EMFCompare.builder();
+ final IPostProcessor.Descriptor.Registry<String> postProcessorRegistry = new PostProcessorDescriptorRegistryImpl<String>();
+ registerPostProcessors(postProcessorRegistry);
+ builder.setPostProcessorRegistry(postProcessorRegistry);
+ return builder.build();
}
protected Comparison compare(Notifier left, Notifier right) {

Back to the top