diff options
author | Mikaël Barbero | 2012-10-09 12:44:44 +0000 |
---|---|---|
committer | Mikaël Barbero | 2012-10-09 12:44:44 +0000 |
commit | 00b53b1f67f0b382217ced4de0061c49506dc0ea (patch) | |
tree | f1fc513f5d4d1b072faa774b973bd087f0058fd7 /plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison | |
parent | a3de93fd7db04421b7e6b302b69b8bc516919c73 (diff) | |
download | org.eclipse.emf.compare-00b53b1f67f0b382217ced4de0061c49506dc0ea.tar.gz org.eclipse.emf.compare-00b53b1f67f0b382217ced4de0061c49506dc0ea.tar.xz org.eclipse.emf.compare-00b53b1f67f0b382217ced4de0061c49506dc0ea.zip |
use a EObject to URI cache with max size instead of weakKeys
Diffstat (limited to 'plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison')
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java index 011322067..dcb2bf023 100644 --- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java +++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/DistanceAxiomsTests.java @@ -16,6 +16,7 @@ import static org.junit.Assert.assertTrue; import com.google.common.cache.CacheBuilder; import com.google.common.collect.Lists; +import org.eclipse.emf.compare.match.DefaultMatchEngine; import org.eclipse.emf.compare.match.eobject.EditionDistance; import org.eclipse.emf.compare.match.eobject.ProximityEObjectMatcher.DistanceFunction; import org.eclipse.emf.compare.tests.suite.AllTests; @@ -50,7 +51,7 @@ public class DistanceAxiomsTests { public void setUp() throws Exception { AllTests.fillEMFRegistries(); this.meter = new EditionDistance(EqualityHelper.createDefaultCache(CacheBuilder.newBuilder() - .weakKeys())); + .maximumSize(DefaultMatchEngine.DEFAULT_EOBJECT_URI_CACHE_MAX_SIZE))); } @DataPoints diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java index 2f52d96c9..677f95f22 100644 --- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java +++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/fullcomparison/MatchPerformanceComparisonTest.java @@ -65,7 +65,8 @@ public class MatchPerformanceComparisonTest { @Test
public void warmup() throws IOException {
final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
- EqualityHelper.createDefaultCache(CacheBuilder.newBuilder().weakKeys())).build());
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder().maximumSize(
+ DefaultMatchEngine.DEFAULT_EOBJECT_URI_CACHE_MAX_SIZE))).build());
final IEObjectMatcher matcher = new IdentifierEObjectMatcher(contentMatcher);
IMatchEngine matchEngine = new DefaultMatchEngine(matcher);
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
@@ -85,7 +86,8 @@ public class MatchPerformanceComparisonTest { @Test
public void matchPerContentAlmostIdenticalModels() throws IOException {
final IEObjectMatcher contentMatcher = new ProximityEObjectMatcher(EditionDistance.builder(
- EqualityHelper.createDefaultCache(CacheBuilder.newBuilder().weakKeys())).build());
+ EqualityHelper.createDefaultCache(CacheBuilder.newBuilder().maximumSize(
+ DefaultMatchEngine.DEFAULT_EOBJECT_URI_CACHE_MAX_SIZE))).build());
IMatchEngine matchEngine = new DefaultMatchEngine(contentMatcher);
final IComparisonScope scope = new DefaultComparisonScope(left, right, origin);
for (int i = 0; i < nbIterations; i++) {
|