Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java6
4 files changed, 23 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
index a97ca935a..db75dbf27 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2018 IBM Corporation and others.
+ * Copyright (c) 2009, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -35,7 +35,7 @@ import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
+import org.eclipse.equinox.p2.internal.repository.comparator.ArtifactChecksumComparator;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -777,7 +777,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
// Create a comparator element
AntTaskElement comparator = new AntTaskElement("comparator");
- comparator.addAttribute("comparator", MD5ArtifactComparator.MD5_COMPARATOR_ID);
+ comparator.addAttribute("comparator", ArtifactChecksumComparator.COMPARATOR_ID + ".md5");
comparator.addElement(getRepositoryElement(baselineLocation.toURI(), null));
mirror.addElement(comparator);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
index f41b886d1..36fb61c1e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2017 IBM Corporation and others.
+ * Copyright (c) 2008, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -53,7 +53,7 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState;
import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
+import org.eclipse.equinox.p2.internal.repository.comparator.ArtifactChecksumComparator;
import org.eclipse.equinox.p2.internal.repository.tools.ArtifactRepositoryValidator;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.Version;
@@ -71,6 +71,7 @@ import org.eclipse.equinox.p2.tests.TestArtifactRepository;
import org.eclipse.equinox.spi.p2.publisher.PublisherHelper;
public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
+ private static final String COMPARATOR_ID = ArtifactChecksumComparator.COMPARATOR_ID + ".md5";
private static final String TEST_KEY = "TestKey";
private static final String TEST_VALUE = "TestValue";
//artifact repository to remove on tear down
@@ -756,7 +757,8 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
compRepo.addChild(repo2Location.toURI());
//validate using the MD5 Comparator
- ArtifactRepositoryValidator validator = new ArtifactRepositoryValidator(MD5ArtifactComparator.MD5_COMPARATOR_ID);
+ ArtifactRepositoryValidator validator = new ArtifactRepositoryValidator(
+ COMPARATOR_ID);
assertFalse("Running verify on invalid repository", validator.validateComposite(compRepo).isOK());
}
@@ -791,7 +793,8 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
}
//Add conflicting repositories
- ArtifactRepositoryValidator validator = new ArtifactRepositoryValidator(MD5ArtifactComparator.MD5_COMPARATOR_ID);
+ ArtifactRepositoryValidator validator = new ArtifactRepositoryValidator(
+ COMPARATOR_ID);
assertTrue(validator.validateComposite(compRepo, repo1).isOK());
compRepo.addChild(repo1Location.toURI());
assertFalse(validator.validateComposite(compRepo, repo2).isOK());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
index fbf40e45f..5ecc71c3f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2017, 2020 IBM Corporation and others.
+ * Copyright (c) 2008, 2017, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -38,7 +38,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
+import org.eclipse.equinox.p2.internal.repository.comparator.ArtifactChecksumComparator;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
@@ -63,6 +63,7 @@ import org.eclipse.osgi.util.NLS;
* Test API of the basic mirror application functionality's implementation.
*/
public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
+ private static final String MD5_COMPARATOR = ArtifactChecksumComparator.COMPARATOR_ID + ".md5";
protected File destRepoLocation;
protected File sourceRepoLocation; //helloworldfeature
protected File sourceRepo2Location; //anotherfeature
@@ -1107,7 +1108,9 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
try {
//Set compare flag.
- String[] args = new String[] {"-source", repo1Location.toURL().toExternalForm(), "-destination", repo2Location.toURL().toExternalForm(), "-verbose", "-compare", "-comparator", MD5ArtifactComparator.MD5_COMPARATOR_ID};
+ String[] args = new String[] { "-source", repo1Location.toURL().toExternalForm(), "-destination",
+ repo2Location.toURL().toExternalForm(), "-verbose", "-compare", "-comparator",
+ MD5_COMPARATOR };
//run the mirror application
runMirrorApplication("Running with duplicate descriptors with different md5 values", args);
} catch (Exception e) {
@@ -1159,7 +1162,10 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
try {
//Set compareAgaist
- String[] args = new String[] {"-source", repoLocation.toURL().toExternalForm(), "-destination", destRepoLocation.toURL().toExternalForm(), "-compareAgainst", baselineLocation.toURL().toExternalForm(), "-verbose", "-compare", "-comparator", MD5ArtifactComparator.MD5_COMPARATOR_ID};
+ String[] args = new String[] { "-source", repoLocation.toURL().toExternalForm(), "-destination",
+ destRepoLocation.toURL().toExternalForm(), "-compareAgainst",
+ baselineLocation.toURL().toExternalForm(), "-verbose", "-compare", "-comparator",
+ MD5_COMPARATOR };
//run the mirror application
runMirrorApplication("Running with baseline compare", args);
} catch (Exception e) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
index 2acff1940..700ebd54c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2020 IBM Corporation and others.
+ * Copyright (c) 2008, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -39,7 +39,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
+import org.eclipse.equinox.p2.internal.repository.comparator.ArtifactChecksumComparator;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor;
@@ -1162,7 +1162,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
}
@DataPoints
- public static String[] defaultComparator = {null, MD5ArtifactComparator.MD5_COMPARATOR_ID};
+ public static String[] defaultComparator = { null, ArtifactChecksumComparator.COMPARATOR_ID + ".md5" };
@Theory
public void testCompareUsingMD5Comparator(String comparator) {

Back to the top